openapi: 3.0.3 info: title: Wootric Declines API description: 'REST API for managing end users, survey responses, declines, settings, metrics, segments, and email survey distribution across NPS, CSAT, and CES programs. Wootric (now part of InMoment) supports multi-region deployments across US, EU, and AU environments. ' version: 1.0.0 contact: name: Wootric API Documentation url: https://docs.wootric.com/api/ servers: - url: https://api.wootric.com description: US production endpoint - url: https://api.eu.wootric.com description: EU production endpoint - url: https://api.au.wootric.com description: AU production endpoint security: - BearerAuth: [] tags: - name: Declines description: Manage survey decline records paths: /v1/declines: get: operationId: listDeclines summary: Get all declines tags: - Declines parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/created' - $ref: '#/components/parameters/updated' - $ref: '#/components/parameters/sort_order' - $ref: '#/components/parameters/sort_key' responses: '200': description: Array of decline objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Decline' '401': $ref: '#/components/responses/Unauthorized' /v1/end_users/{end_user_id}/declines: parameters: - name: end_user_id in: path required: true description: End user ID schema: type: integer get: operationId: listEndUserDeclines summary: Get all declines for an end user tags: - Declines parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/created' - $ref: '#/components/parameters/updated' - $ref: '#/components/parameters/sort_order' - $ref: '#/components/parameters/sort_key' responses: '200': description: Array of decline objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Decline' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' post: operationId: createDecline summary: Create a decline for an end user tags: - Declines requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DeclineInput' responses: '200': description: Created decline object content: application/json: schema: $ref: '#/components/schemas/Decline' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /v1/end_users/{end_user_id}/declines/{id}: parameters: - name: end_user_id in: path required: true description: End user ID schema: type: integer - name: id in: path required: true description: Decline ID schema: type: integer get: operationId: getEndUserDecline summary: Get a specific decline for an end user tags: - Declines responses: '200': description: Single decline object content: application/json: schema: $ref: '#/components/schemas/Decline' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: operationId: deleteDecline summary: Delete a decline tags: - Declines responses: '204': description: No content (deletion successful) '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /v1/declines/{id}: put: operationId: updateDecline summary: Update a decline tags: - Declines parameters: - name: id in: path required: true description: Decline ID schema: type: integer requestBody: required: true content: application/json: schema: type: object properties: end_user: type: object properties: properties: type: object additionalProperties: true responses: '204': description: No content (update successful) '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' components: parameters: sort_order: name: sort_order in: query description: Sort direction schema: type: string enum: - asc - desc page: name: page in: query description: Page number for pagination schema: type: integer minimum: 1 default: 1 created: name: created in: query description: Filter by creation timestamp (Unix epoch) schema: type: integer per_page: name: per_page in: query description: Number of records per page schema: type: integer minimum: 1 maximum: 500 default: 25 updated: name: updated in: query description: Filter by update timestamp (Unix epoch) schema: type: integer sort_key: name: sort_key in: query description: Field to sort by schema: type: string responses: Unauthorized: description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/Error' BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' schemas: Decline: type: object properties: id: type: integer description: Unique identifier origin_url: type: string description: URL where the survey was declined created_at: type: integer description: Unix timestamp of decline updated_at: type: integer description: Unix timestamp of last update end_user: $ref: '#/components/schemas/EndUser' EndUser: type: object properties: id: type: integer description: Unique identifier email: type: string format: email description: End user email address external_id: type: string description: External identifier from your system external_created_at: type: integer description: Unix timestamp of user creation in your system last_surveyed: type: integer description: Unix timestamp of last survey sent surveys_disabled: type: boolean description: Whether surveys are disabled for this user properties: type: object additionalProperties: true description: Custom properties as key-value pairs created_at: type: integer description: Unix timestamp of record creation updated_at: type: integer description: Unix timestamp of last update DeclineInput: type: object properties: origin_url: type: string description: URL where the survey was declined created_at: type: integer description: Unix timestamp for the decline end_user: type: object properties: properties: type: object additionalProperties: true Error: type: object properties: error: type: string description: Error message status: type: integer description: HTTP status code securitySchemes: BearerAuth: type: http scheme: bearer description: 'OAuth 2.0 Bearer token. Obtain via password, client_credentials, or refresh_token grant. Tokens expire after 2 hours. '