> ## Documentation Index
> Fetch the complete documentation index at: https://docs.messagedesk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample opt outs

> Sample data for testing a trigger. Returns up to three of the workspace's most recent opt outs, formatted exactly as the OptOutCreated and OptOutDeleted webhooks deliver them, so a subscriber can see the real payload before any event fires. If the workspace has no opt outs yet, three generated placeholder records in the same shape are returned instead. This is not a history endpoint.



## OpenAPI

````yaml developer/api-reference/openapi.json GET /integrations/developer/zapier/get-opt-outs
openapi: 3.1.0
info:
  contact:
    email: support@messagedesk.com
    name: MessageDesk Support
    url: https://messagedesk.com
  description: >-
    The MessageDesk Developer API. Integration providers use it to read and
    write a workspace on a user's behalf. Zapier is the only supported provider
    today; endpoints are namespaced by provider under
    `/integrations/developer/{provider}`.
  title: MessageDesk API
  version: '1.0'
servers:
  - description: Production
    url: https://c3uezq47el.execute-api.us-west-2.amazonaws.com/main
security: []
tags:
  - description: >-
      Read-only lookups an integration uses while a user configures it: the
      workspaces they belong to, and the users, phone numbers and contact
      properties in a workspace.
    name: Context lookups
  - description: >-
      Write operations an integration performs on behalf of a user. Every
      request body carries the target workspace as `id` and names the calling
      provider in `developerProvider`.
    name: Actions
  - description: >-
      Event subscriptions for instant triggers, plus sample-data endpoints that
      return a workspace's most recent records (or generated placeholders when
      it has none) in exactly the shape the matching webhook delivers.
    name: Triggers
externalDocs:
  description: ''
  url: ''
paths:
  /integrations/developer/zapier/get-opt-outs:
    get:
      tags:
        - Triggers
      summary: Sample opt outs
      description: >-
        Sample data for testing a trigger. Returns up to three of the
        workspace's most recent opt outs, formatted exactly as the OptOutCreated
        and OptOutDeleted webhooks deliver them, so a subscriber can see the
        real payload before any event fires. If the workspace has no opt outs
        yet, three generated placeholder records in the same shape are returned
        instead. This is not a history endpoint.
      operationId: getOptOuts
      parameters:
        - description: Workspace ID
          in: query
          name: workspaceId
          required: true
          schema:
            type: string
        - description: Integration provider making the request
          in: query
          name: developerProvider
          required: true
          schema:
            enum:
              - zapier
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: >-
                    #/components/schemas/developer.DeveloperProviderOptOutWebhook
                type: array
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Missing or invalid bearer token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: The authenticated user is not a member of the workspace
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Workspace or referenced record not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    developer.DeveloperProviderOptOutWebhook:
      properties:
        conversationId:
          description: The conversation ID
          type: string
        createdAt:
          description: The created at timestamp
          type: string
        inboundAddress:
          description: The phone number of the opt out
          type: string
        optOutReason:
          description: The reason for the opt out
          type: string
        workspaceId:
          description: The workspace ID
          type: string
      required:
        - conversationId
        - createdAt
        - inboundAddress
        - optOutReason
        - workspaceId
      type: object
    openapi.ErrorResponse:
      properties:
        error:
          description: Human-readable description of the failure
          example: workspace not found
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: >-
        An OAuth 2.0 access token, sent as `Authorization: Bearer <token>`.
        MessageDesk is the OAuth 2.0 provider (backed by AWS Cognito): an
        integration such as Zapier obtains the token through the
        authorization-code flow when a user connects their MessageDesk account.
        Access tokens are valid for 24 hours and are refreshed with the refresh
        token.
      scheme: bearer
      type: http

````