openapi: 3.1.0
info:
  title: ThriveDesk Public API
  version: 1.1.2
  summary: REST API for the ThriveDesk helpdesk data plane.
  description: |
    The ThriveDesk Public API gives external integrators programmatic access
    to conversations, contacts, inboxes, tags, saved replies, reports, and the
    Knowledge Base. The same surface that powers the ThriveDesk web app is
    available here, scoped via bearer access tokens.

    ## Quick links

    - [Quickstart](/docs/quickstart.html)
    - [Authentication and scopes](/docs/authentication.html)
    - [Errors](/docs/errors.html)
    - [Pagination and rate limits](/docs/pagination.html)
    - [Changelog](/docs/changelog.html)

    ## What is documented

    The 76 endpoints in this spec cover the helpdesk data plane:
    conversations, contacts, inboxes (with their automations, custom fields,
    and saved replies), tags, teammates, saved replies, reports, the
    Knowledge Base, attachments, messages, notes, and the search and `me`
    utilities.

    First-party app, billing, onboarding, webhook,
    broadcasting, widget, and admin-dashboard endpoints are not part of this
    public surface and are not documented here. The same goes for the web
    app's own session and UI mechanics (password login, undo-send, saved-view
    and folder organization, usage counters) and for irreversible or
    admin-plane operations (permanent deletion, automation writes, Knowledge
    Base member management): those routes exist for the first-party clients
    but are not supported for integrations.

    ## Compatibility

    - OpenAPI 3.1
    - All requests are `application/json` except for attachment downloads
      (binary stream).
    - All responses are `application/json` except for attachment downloads.
  contact:
    name: ThriveDesk Developer Support
    email: help@thrivedesk.com
    url: https://www.thrivedesk.com
  license:
    name: Proprietary
    url: https://www.thrivedesk.com/terms
servers:
  - url: https://api.thrivedesk.com/v1
security:
  - bearerToken: []
tags:
  - name: Conversations
    description: Tickets and their thread events (replies, notes, drafts, scheduled replies, spam, snooze, merge, split, move, tags).
  - name: Contacts
    description: People who send and receive messages.
  - name: Inboxes
    description: Mailboxes/channels and their automations, custom fields, and saved replies.
  - name: Tags
    description: Conversation labels, organized per organization.
  - name: Users
    description: Teammates (agents, admins, owners) and their pending invitations.
  - name: Saved Replies
    description: Templated replies agents can apply to conversations.
  - name: Reports
    description: Aggregate metrics for conversations, happiness, productivity, ratings, and agent performance.
  - name: Knowledge Base
    description: Public help centers, their articles, and member access.
  - name: Attachments
    description: File uploads and downloads on conversations.
  - name: Messages and Notes
    description: 'Thread events: message bodies and internal notes.'
  - name: Misc
    description: 'Utilities: current user (`/v1/me`) and global search (`/v1/search`).'
paths:
  /me:
    get:
      summary: Get current user, organization, and badge counts
      operationId: me-get
      tags:
        - Misc
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/me" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /conversation/{conversation_id}:
    get:
      summary: View a conversation
      operationId: conversation-resource-get
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationView'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    patch:
      summary: Update a conversation
      operationId: conversation-resource-patch
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationUpdateBody'
            example:
              status: Pending
              assign_to: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              tags:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              subject: Order INV-1042 arrived damaged
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "status": "Pending",
              "assign_to": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "tags": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ],
              "subject": "Order INV-1042 arrived damaged"
            }'
      security:
        - bearerToken: []
    delete:
      summary: Delete a conversation
      operationId: conversation-resource-delete
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/change-contact:
    patch:
      summary: Change the contact on a conversation
      operationId: conversation-change-contact-patch
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeContactBody'
            example:
              contact_id: a2259012-556c-452c-ae91-e8d55e4107c0
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/change-contact" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "contact_id": "a2259012-556c-452c-ae91-e8d55e4107c0"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/custom-fields:
    patch:
      summary: Update custom field values on a conversation
      operationId: conversation-custom-fields-patch
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldsUpdateBody'
            example:
              order_number: INV-1042
              issue_category: shipping_damage
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/custom-fields" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "order_number": "INV-1042",
              "issue_category": "shipping_damage"
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/draft:
    post:
      summary: Create or update the reply draft
      operationId: conversation-draft-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftSaveResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-notes: 'One draft per user per conversation: posting again updates the existing draft. The returned draft_id is what reply and attachment upload consume.'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftBody'
            example:
              message: <p>Hi Jane, a replacement is on the way.</p>
              cc:
                - colleague@example.com
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/draft" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "message": "<p>Hi Jane, a replacement is on the way.</p>",
              "cc": [
                "colleague@example.com"
              ]
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/forward:
    post:
      summary: Forward a conversation
      operationId: conversation-forward-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForwardBody'
            example:
              body: Forwarding this conversation for a second opinion.
              message_id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              to:
                - colleague@example.com
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/forward" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "body": "Forwarding this conversation for a second opinion.",
              "message_id": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "to": [
                "colleague@example.com"
              ]
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/merge:
    post:
      summary: Merge other conversations into this one
      operationId: conversation-merge-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergeBody'
            example:
              mergeable_conversation_ids:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              include_notes: true
              include_merge_summary: true
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/merge" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "mergeable_conversation_ids": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ],
              "include_notes": true,
              "include_merge_summary": true
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/messages:
    get:
      summary: Get thread messages for a conversation
      operationId: conversation-messages-get
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
        - in: query
          name: event_id
          schema:
            type: string
          description: Return only the thread event with this message ID.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/messages" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /conversation/{conversation_id}/move:
    post:
      summary: Move a conversation to another inbox
      operationId: conversation-move-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveBody'
            example:
              inbox_id: 3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/move" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "inbox_id": "3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f"
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/note:
    post:
      summary: Add an internal note
      operationId: conversation-note-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteBody'
            example:
              message: Customer confirmed the invoice number over chat.
              mentioned_ids:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/note" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "message": "Customer confirmed the invoice number over chat.",
              "mentioned_ids": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ]
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/reply:
    post:
      summary: Reply to a conversation
      operationId: conversation-reply-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplyBody'
            example:
              status: Closed
              assign_to: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              action: send_and_next_active
              cc:
                - supervisor@example.com
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/reply" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "status": "Closed",
              "assign_to": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "action": "send_and_next_active",
              "cc": [
                "supervisor@example.com"
              ]
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/reply/schedule:
    post:
      summary: Schedule a reply
      operationId: conversation-reply-schedule-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledReplyWrite'
            example:
              message: <p>Following up on your damaged order.</p>
              scheduled_at: '2026-07-10T09:00:00Z'
              type: if_no_reply
              status: Pending
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/reply/schedule" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "message": "<p>Following up on your damaged order.</p>",
              "scheduled_at": "2026-07-10T09:00:00Z",
              "type": "if_no_reply",
              "status": "Pending"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/reply/unschedule/{message_id}:
    delete:
      summary: Cancel a scheduled reply
      operationId: conversation-reply-unschedule-delete
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
        - in: path
          name: message_id
          required: true
          schema:
            type: string
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/reply/unschedule/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/restore:
    patch:
      summary: Restore a trashed conversation
      operationId: conversation-restore-patch
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
            example: {}
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/restore" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/scheduled/{message_id}:
    patch:
      summary: Update a scheduled reply
      operationId: conversation-scheduled-update-patch
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
        - in: path
          name: message_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledReplyUpdate'
            example:
              scheduled_at: '2026-07-10T09:00:00Z'
              message: <p>Updated follow-up message.</p>
              status: Pending
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/scheduled/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "scheduled_at": "2026-07-10T09:00:00Z",
              "message": "<p>Updated follow-up message.</p>",
              "status": "Pending"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/scheduled/{message_id}/send-now:
    post:
      summary: Send a scheduled reply now
      operationId: conversation-scheduled-send-now-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
        - in: path
          name: message_id
          required: true
          schema:
            type: string
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/scheduled/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9/send-now" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/snooze:
    put:
      summary: Snooze a conversation
      operationId: conversation-snooze-put
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnoozeBody'
            example:
              snoozed_until: '2026-07-10T09:00:00Z'
              type: if_no_reply
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/snooze" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "snoozed_until": "2026-07-10T09:00:00Z",
              "type": "if_no_reply"
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/spam:
    post:
      summary: Mark a conversation as spam
      operationId: conversation-spam-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/spam" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    delete:
      summary: Unmark a conversation as spam
      operationId: conversation-spam-delete
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/spam" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /conversation/{conversation_id}/split:
    post:
      summary: Split a conversation at a message
      operationId: conversation-split-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitBody'
            example:
              thread_event_id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              direction: after
              subject: Order INV-1042 arrived damaged
              status: Active
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/split" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "thread_event_id": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "direction": "after",
              "subject": "Order INV-1042 arrived damaged",
              "status": "Active"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /conversation/{conversation_id}/tags:
    post:
      summary: Attach a tag
      operationId: conversation-tags-post
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagAttachBody'
            example:
              tag: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/tags" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "tag": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
            }'
      security:
        - bearerToken: []
    delete:
      summary: Detach a tag
      operationId: conversation-tags-delete
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagDetachBody'
            example:
              tag: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/tags" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "tag": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
            }'
      security:
        - bearerToken: []
  /conversation/{conversation_id}/unsnooze:
    delete:
      summary: Unsnooze a conversation
      operationId: conversation-unsnooze-delete
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/unsnooze" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /conversation/{conversation_id}/update/priority:
    put:
      summary: Update a conversation's priority
      operationId: conversation-update-priority-put
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriorityBody'
            example:
              priority: High
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/update/priority" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "priority": "High"
            }'
      security:
        - bearerToken: []
  /conversations/mine:
    get:
      summary: List conversations assigned to the current user
      operationId: conversations-mine-get
      tags:
        - Conversations
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-notes: Returns at most the five most recently active conversations. Not paginated.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/conversations/mine" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /contacts:
    get:
      summary: List contacts
      operationId: contacts-index-get
      tags:
        - Contacts
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/Page'
        - in: query
          name: per_page
          schema:
            type: integer
            default: 15
        - in: query
          name: q
          schema:
            type: string
          description: Search by name or email.
        - in: query
          name: inbox
          schema:
            type: string
          description: Only contacts with conversations in this inbox.
        - in: query
          name: with_orphan
          schema:
            type: boolean
          description: Include contacts with no conversations.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/contacts" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    post:
      summary: Create a contact
      operationId: contacts-index-post
      tags:
        - Contacts
      responses:
        '201':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactCreateResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactCreate'
            example:
              email: jane@example.com
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/contacts" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "email": "jane@example.com"
            }'
      security:
        - bearerToken: []
  /contacts/{contact_id}:
    get:
      summary: View a contact
      operationId: contacts-resource-get
      tags:
        - Contacts
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ContactId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/contacts/a2259012-556c-452c-ae91-e8d55e4107c0" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    patch:
      summary: Update a contact
      operationId: contacts-resource-patch
      tags:
        - Contacts
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ContactId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUpdate'
            example:
              name: Jane Cooper
              company: Acme Inc
              job_title: CTO
              website: https://example.com
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/contacts/a2259012-556c-452c-ae91-e8d55e4107c0" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Jane Cooper",
              "company": "Acme Inc",
              "job_title": "CTO",
              "website": "https://example.com"
            }'
      security:
        - bearerToken: []
  /contacts/{contact_id}/conversations:
    get:
      summary: List conversations for a contact
      operationId: contacts-conversations-get
      tags:
        - Contacts
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactConversationsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ContactId'
        - in: query
          name: inbox_id
          schema:
            type: string
          description: Only conversations in this inbox.
        - in: query
          name: except
          schema:
            type: string
          description: Conversation ID to exclude.
        - in: query
          name: limit
          schema:
            type: integer
          description: Maximum number of conversations to return.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/contacts/a2259012-556c-452c-ae91-e8d55e4107c0/conversations" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /inboxes:
    get:
      summary: List inboxes
      operationId: inboxes-index-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /inboxes/{inbox_id}:
    get:
      summary: List conversations in an inbox
      operationId: inboxes-resource-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - in: query
          name: view
          schema:
            type: string
          description: Custom view ID whose filters shape the list.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    post:
      summary: Filter conversations in an inbox
      operationId: inboxes-resource-post
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxFilterBody'
            example:
              filters:
                condition: and
                groups:
                  - attribute: status
                    comparison: eq
                    values:
                      - value: Active
              display:
                sort: newest
                per_page: 25
                page: 1
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "filters": {
                "condition": "and",
                "groups": [
                  {
                    "attribute": "status",
                    "comparison": "eq",
                    "values": [
                      {
                        "value": "Active"
                      }
                    ]
                  }
                ]
              },
              "display": {
                "sort": "newest",
                "per_page": 25,
                "page": 1
              }
            }'
      security:
        - bearerToken: []
  /inboxes/{inbox_id}/automations:
    get:
      summary: List automations
      operationId: inbox-automations-index-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/automations" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/automations/{automation_id}:
    get:
      summary: View an automation
      operationId: inbox-automations-resource-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/AutomationId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/automations/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/batch/delete:
    post:
      summary: Soft-delete many conversations
      operationId: inbox-batch-delete-post
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxBatchDeleteBody'
            example:
              conversations:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/batch/delete" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "conversations": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ]
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/batch/restore:
    post:
      summary: Restore many trashed conversations
      operationId: inbox-batch-restore-post
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxBatchIdsBody'
            example:
              conversation_ids:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/batch/restore" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "conversation_ids": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ]
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/batch/update:
    post:
      summary: Bulk update conversations
      operationId: inbox-batch-update-post
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '412':
          description: No update field was provided.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Nothing to update
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxBatchUpdateBody'
            example:
              conversations:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              status: Closed
              assign_to: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              priority: High
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/batch/update" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "conversations": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ],
              "status": "Closed",
              "assign_to": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "priority": "High"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/conversations:
    post:
      summary: Start a new conversation in an inbox
      operationId: inbox-conversations-store-post
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxConversationCreate'
            example:
              to: customer@example.com
              status: Active
              subject: Order INV-1042 arrived damaged
              message: Hi, my order arrived with a cracked screen. Can you help?
              agent: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              tags:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
              contact:
                name: Jane Cooper
                company: Acme Inc
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/conversations" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "to": "customer@example.com",
              "status": "Active",
              "subject": "Order INV-1042 arrived damaged",
              "message": "Hi, my order arrived with a cracked screen. Can you help?",
              "agent": "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
              "tags": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9"
              ],
              "contact": {
                "name": "Jane Cooper",
                "company": "Acme Inc"
              }
            }'
      security:
        - bearerToken: []
  /inboxes/{inbox_id}/custom-fields:
    post:
      summary: Create a custom field
      operationId: inbox-custom-fields-index-post
      tags:
        - Inboxes
      responses:
        '201':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldCreate'
            example:
              name: Order Number
              type: text
              key: order_number
              is_required: true
              is_active: true
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/custom-fields" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Order Number",
              "type": "text",
              "key": "order_number",
              "is_required": true,
              "is_active": true
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/custom-fields/{field_id}:
    patch:
      summary: Update a custom field
      operationId: inbox-custom-fields-resource-patch
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/FieldId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldUpdate'
            example:
              description: The customer's order reference.
              is_required: true
              is_active: true
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PATCH "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/custom-fields/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "description": "The customer's order reference.",
              "is_required": true,
              "is_active": true
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
    delete:
      summary: Delete a custom field
      operationId: inbox-custom-fields-resource-delete
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/FieldId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/custom-fields/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /inboxes/{inbox_id}/saved-replies:
    get:
      summary: List saved replies for an inbox
      operationId: inbox-saved-replies-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedReplyList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/saved-replies" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /inboxes/{inbox_id}/tags:
    get:
      summary: List tags assigned in an inbox
      operationId: inbox-tags-get
      tags:
        - Inboxes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxTagCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-notes: 'Uses simple pagination: `links.last`, `meta.last_page`, and `meta.total` are absent.'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/Page'
        - in: query
          name: per_page
          schema:
            type: integer
            default: 15
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/inboxes/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/tags" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /settings/tags:
    get:
      summary: List tags
      operationId: tags-index-get
      tags:
        - Tags
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/Page'
        - in: query
          name: per_page
          schema:
            type: integer
            default: 15
        - in: query
          name: q
          schema:
            type: string
          description: Search tags by name.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/settings/tags" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    post:
      summary: Create a tag
      operationId: tags-index-post
      tags:
        - Tags
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagCreateResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagWrite'
            example:
              name: Billing
              color: '#FF0000'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/settings/tags" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Billing",
              "color": "#FF0000"
            }'
      security:
        - bearerToken: []
  /settings/tags/{tag_id}:
    put:
      summary: Update a tag
      operationId: tags-resource-put
      tags:
        - Tags
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/TagId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagUpdate'
            example:
              name: Billing
              color: '#FF0000'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/settings/tags/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Billing",
              "color": "#FF0000"
            }'
      security:
        - bearerToken: []
    delete:
      summary: Delete a tag
      operationId: tags-resource-delete
      tags:
        - Tags
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/TagId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/settings/tags/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /settings/tags/merge:
    post:
      summary: Merge tags into one
      operationId: tags-merge-post
      tags:
        - Tags
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagsMergeBody'
            example:
              name: Billing
              color: '#FF0000'
              tags:
                - 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
                - 1a2b3c4d-5e6f-4708-9a0b-1c2d3e4f5a6b
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/settings/tags/merge" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Billing",
              "color": "#FF0000",
              "tags": [
                "9c81790c-ae74-4cbd-b2ca-d246ae0df1a9",
                "1a2b3c4d-5e6f-4708-9a0b-1c2d3e4f5a6b"
              ]
            }'
      security:
        - bearerToken: []
  /settings/users:
    get:
      summary: List teammates and pending invitations
      operationId: settings-users-index-get
      tags:
        - Users
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersIndexResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-notes: Organization owners see every member. Other roles see only agents sharing an inbox with them. Not paginated.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/settings/users" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /settings/users/{user_id}:
    get:
      summary: View a teammate
      operationId: settings-users-resource-get
      tags:
        - Users
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/UserId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/settings/users/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /saved-replies:
    get:
      summary: List saved replies
      operationId: saved-replies-index-get
      tags:
        - Saved Replies
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedReplyList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - in: query
          name: inbox_id
          required: true
          schema:
            type: string
          description: Inbox to list saved replies for. Pass "all" for every inbox plus global replies.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/saved-replies?inbox_id=all" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    post:
      summary: Create a saved reply
      operationId: saved-replies-index-post
      tags:
        - Saved Replies
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavedReplyWrite'
            example:
              name: Refund acknowledgement
              message: <p>We've started your refund.</p>
              folder: Billing
              inbox_id: 3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/saved-replies" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Refund acknowledgement",
              "message": "<p>We've started your refund.</p>",
              "folder": "Billing",
              "inbox_id": "3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f"
            }'
      security:
        - bearerToken: []
  /saved-replies/{saved_reply_id}:
    put:
      summary: Update a saved reply
      operationId: saved-replies-resource-put
      tags:
        - Saved Replies
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/SavedReplyId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavedReplyUpdate'
            example:
              name: Refund acknowledgement
              message: <p>Your refund is being processed.</p>
              folder: Billing
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/saved-replies/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Refund acknowledgement",
              "message": "<p>Your refund is being processed.</p>",
              "folder": "Billing"
            }'
      security:
        - bearerToken: []
    delete:
      summary: Delete a saved reply
      operationId: saved-replies-resource-delete
      tags:
        - Saved Replies
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/SavedReplyId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/saved-replies/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /reports/{inbox_id}/agents:
    get:
      summary: Agent leaderboard
      operationId: reports-agents-get
      tags:
        - Reports
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsAgents'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/reports/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/agents" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /reports/{inbox_id}/conversations:
    get:
      summary: Conversation volume report
      operationId: reports-conversations-get
      tags:
        - Reports
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsConversations'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/reports/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/conversations" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /reports/{inbox_id}/happiness:
    get:
      summary: Happiness ratings report
      operationId: reports-happiness-get
      tags:
        - Reports
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsHappiness'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/reports/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/happiness" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /reports/{inbox_id}/productivity:
    get:
      summary: Productivity report
      operationId: reports-productivity-get
      tags:
        - Reports
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsProductivity'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/InboxId'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/reports/3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f/productivity" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /knowledgebases:
    get:
      summary: List knowledge bases
      operationId: knowledgebase-index-get
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/knowledgebases" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
    post:
      summary: Create a knowledge base
      operationId: knowledgebase-index-post
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseCreateResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseCreate'
            example:
              name: Help Center
              slug: help-center
              is_private: false
              members:
                - email: colleague@example.com
                  role: editor
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/knowledgebases" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Help Center",
              "slug": "help-center",
              "is_private": false,
              "members": [
                {
                  "email": "colleague@example.com",
                  "role": "editor"
                }
              ]
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /knowledgebases/{knowledgebase_id}:
    get:
      summary: View a knowledge base
      operationId: knowledgebase-resource-get
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/knowledgebases/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
    post:
      summary: Update a knowledge base
      operationId: knowledgebase-resource-post
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-notes: Uses POST because the extension's route file uses POST-for-update.
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseUpdate'
            example:
              name: Help Center
              slug: help-center
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/knowledgebases/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "name": "Help Center",
              "slug": "help-center"
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
    delete:
      summary: Delete a knowledge base
      operationId: knowledgebase-resource-delete
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/knowledgebases/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /knowledgebases/{knowledgebase_slug}/articles:
    get:
      summary: List articles
      operationId: knowledgebase-articles-index-get
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseArticleList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseSlug'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/knowledgebases/help-center/articles" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /knowledgebases/{knowledgebase_slug}/articles/{article_id}:
    get:
      summary: View an article
      operationId: knowledgebase-articles-show-get
      tags:
        - Knowledge Base
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseArticle'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseSlug'
        - $ref: '#/components/parameters/ArticleId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/knowledgebases/help-center/articles/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /attachments/{attachmentId}/download:
    get:
      summary: Download an attachment (binary stream)
      operationId: attachments-download-get
      tags:
        - Attachments
      responses:
        '200':
          description: Binary file stream. Content-Disposition header indicates the filename.
          headers:
            Content-Disposition:
              schema:
                type: string
              description: attachment; filename=<original-name>
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/AttachmentId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/attachments/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9/download" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /attachments/{attachmentId}/delete:
    delete:
      summary: Delete an attachment
      operationId: attachments-delete-delete
      tags:
        - Attachments
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/AttachmentId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/attachments/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9/delete" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
  /attachments/conversation/{conversationId}/attachment:
    post:
      summary: Upload attachments to a conversation draft
      operationId: attachments-store-post
      tags:
        - Attachments
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUploadResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/ConversationIdCamel'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachments[]:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: One or more files.
                draft_id:
                  type: string
                  description: Draft message to attach to. Pass the literal string "null" to create a draft on the fly.
                is_inline:
                  type: boolean
                  description: Mark the files as inline images.
              required:
                - attachments[]
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/attachments/conversation/7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d/attachment" \
              -H "Authorization: Bearer $TOKEN" \
              -F "attachments[]=@/path/to/file.pdf"
      security:
        - bearerToken: []
  /messages/{message_id}:
    get:
      summary: View a single message body
      operationId: messages-resource-get
      tags:
        - Messages and Notes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDetailResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/MessageId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X GET "https://api.thrivedesk.com/v1/messages/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
    put:
      summary: Update a message
      operationId: messages-resource-put
      tags:
        - Messages and Notes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/MessageId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadUpdateBody'
            example:
              html_body: <p>Corrected reply text.</p>
              text_body: Corrected reply text.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/messages/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "html_body": "<p>Corrected reply text.</p>",
              "text_body": "Corrected reply text."
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /notes/{message_id}:
    put:
      summary: Update a note
      operationId: notes-resource-put
      tags:
        - Messages and Notes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/MessageId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadUpdateBody'
            example:
              html_body: <p>Updated internal note.</p>
              text_body: Updated internal note.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X PUT "https://api.thrivedesk.com/v1/notes/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "html_body": "<p>Updated internal note.</p>",
              "text_body": "Updated internal note."
            }'
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
    delete:
      summary: Delete a note
      operationId: notes-resource-delete
      tags:
        - Messages and Notes
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      parameters:
        - $ref: '#/components/parameters/MessageId'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X DELETE "https://api.thrivedesk.com/v1/notes/9c81790c-ae74-4cbd-b2ca-d246ae0df1a9" \
              -H "Authorization: Bearer $TOKEN"
      security:
        - bearerToken: []
      description: Personal access token only. The API supports a second, partner-issued token class that is not part of the public surface. This endpoint does not accept that class.
  /search:
    post:
      summary: Search conversations
      operationId: search-post
      tags:
        - Misc
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchBody'
            example:
              q:
                subject: refund
                status: Active
              per-page: 20
              sort: newest
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST "https://api.thrivedesk.com/v1/search" \
              -H "Authorization: Bearer $TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
              "q": {
                "subject": "refund",
                "status": "Active"
              },
              "per-page": 20,
              "sort": "newest"
            }'
      security:
        - bearerToken: []
components:
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: Personal access token
      description: |
        Personal access tokens created from the ThriveDesk UI.
        Create one under Integrations -> API Keys.
  schemas:
    Organization:
      type: object
      description: |
        An organization (tenant) on ThriveDesk, as returned in the `company`
        block of `GET /v1/me`.
      properties:
        id:
          type: string
        owner_id:
          type: string
        company:
          type: string
          description: The organization (company) name.
        slug:
          type: string
        options:
          type: object
          description: Organization-level options such as `timezone` (free-form).
        permissions:
          type: object
          description: Role-to-capability permission matrix (free-form).
        domain:
          type: object
          description: The organization's sending domain.
          properties:
            id:
              type: string
            domain:
              type: string
            config:
              type: object
              description: Domain provider configuration (free-form).
            authorized:
              type: boolean
            extra:
              type: object
              description: Additional domain metadata (free-form).
            organization_id:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
    User:
      type: object
      description: A teammate (agent, admin, or owner) on the organization.
      properties:
        id:
          type: string
        name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        phone:
          type:
            - string
            - 'null'
        job_title:
          type:
            - string
            - 'null'
        avatar:
          type:
            - string
            - 'null'
          format: uri
        role:
          type: string
          enum:
            - Account Owner
            - Administrator
            - User
        presence:
          type:
            - string
            - 'null'
          enum:
            - online
            - away
            - null
        timezone:
          type:
            - string
            - 'null'
        time_format:
          type:
            - string
            - 'null'
          description: 12h or 24h.
        active_organization_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        extra:
          type: object
          description: Per-user preferences.
          properties:
            password_reset_required:
              type: boolean
            notification_preferences:
              type: object
              additionalProperties: true
            firebase_notification_preferences:
              type: object
              additionalProperties: true
            mobile_notification_preferences:
              type: object
              additionalProperties: true
            auto_advance_ticket_enabled:
              type: boolean
            undo_send_enabled:
              type: boolean
            undo_send_delay:
              type:
                - integer
                - 'null'
      example:
        id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
        name: Alex Morgan
        first_name: Alex
        last_name: Morgan
        email: agent@example.com
        phone: null
        job_title: Support Lead
        avatar: null
        role: Administrator
        presence: online
        timezone: UTC
        time_format: 24h
        active_organization_id: 0b9a8c7d-6e5f-4a3b-9c2d-1e0f3a4b5c6d
        created_at: '2026-07-10T09:00:00Z'
        extra:
          auto_advance_ticket_enabled: true
          undo_send_enabled: false
    OrganizationSummary:
      type: object
      description: |
        A membership summary for an organization the user belongs to (an item
        of the `organizations` array in `GET /v1/me`).
      properties:
        id:
          type: string
        company:
          type: string
        slug:
          type: string
        owner_id:
          type: string
        assigned_tickets_count:
          type: integer
    MeResponse:
      type: object
      required:
        - company
        - user
        - inboxes
        - organizations
        - onboarding
        - had_onboarding_survey
        - badge_count
      properties:
        company:
          $ref: '#/components/schemas/Organization'
        user:
          $ref: '#/components/schemas/User'
        inboxes:
          type: array
          items:
            type: string
          description: Array of inbox IDs the user can access.
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationSummary'
        onboarding:
          type: object
          additionalProperties: true
        had_onboarding_survey:
          type: boolean
        badge_count:
          type: integer
    Error:
      type: object
      description: |
        Standard JSON error envelope. The exact shape depends on the error.
        Validation errors include an `errors` object keyed by field name. Auth
        errors include a `message`. Throttle errors include a `message` of
        "Too Many Attempts." See [Errors](/docs/errors.html) for the full catalog.
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
          example: The given data was invalid.
        errors:
          type: object
          description: |
            Field-level validation errors. Present on 422 responses, when the
            request body fails validation.
          additionalProperties:
            type: array
            items:
              type: string
          example:
            email:
              - The email field is required.
    ValidationError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
    Contact:
      type: object
      description: A person who sends or receives messages.
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        email:
          type: string
          format: email
        avatar:
          type:
            - string
            - 'null'
          format: uri
        company:
          type:
            - string
            - 'null'
        website:
          type:
            - string
            - 'null'
        job_title:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        should_display_image:
          type: boolean
        notes:
          type:
            - string
            - 'null'
        conversations_count:
          type: integer
      example:
        id: a2259012-556c-452c-ae91-e8d55e4107c0
        name: Jane Cooper
        email: jane@example.com
        avatar: null
        company: Acme Inc
        website: https://example.com
        job_title: CTO
        address: null
        should_display_image: false
        notes: null
        conversations_count: 4
    ConversationLastMessage:
      type: object
      description: A compact view of the most recent message on a conversation.
      properties:
        id:
          type: string
        cc:
          type:
            - array
            - 'null'
          items:
            type: string
        bcc:
          type:
            - array
            - 'null'
          items:
            type: string
        record_type:
          type: string
        status:
          type: string
        direction:
          type: string
        viewed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        text_body:
          type:
            - string
            - 'null'
        excerpt:
          type:
            - string
            - 'null'
        html_body:
          type:
            - string
            - 'null'
        extra:
          type: object
          description: Additional message metadata (free-form).
        is_clipped:
          type: boolean
        intended_inbox_address_id:
          type:
            - string
            - 'null'
    Conversation:
      type: object
      description: |
        A conversation (ticket) as returned in list responses
        (`GET /v1/conversations/mine`, `GET /v1/inboxes/{inbox_id}`).
      properties:
        id:
          type: string
        inbox_id:
          type: string
        ticket_id:
          type: integer
        has_attachment:
          type: boolean
        has_inline_attachment:
          type: boolean
        is_draft:
          type: boolean
        is_scheduled:
          type: boolean
        is_snoozed:
          type: boolean
        active:
          type: boolean
        subject:
          type:
            - string
            - 'null'
        updated_subject:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
        is_spam:
          type: boolean
        priority:
          type: string
          enum:
            - High
            - Medium
            - Low
        assignable_type:
          type:
            - string
            - 'null'
          description: Polymorphic type of the assignee (a user or a team).
        assignable_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
        excerpt:
          type:
            - string
            - 'null'
        messages_count:
          type:
            - integer
            - 'null'
        last_message_created_at:
          type:
            - string
            - 'null'
          format: date-time
        intended_inbox_address_id:
          type:
            - string
            - 'null'
        agents:
          type: array
          description: IDs of agents assigned to the conversation.
          items:
            type: string
        contact:
          $ref: '#/components/schemas/Contact'
        last_message:
          $ref: '#/components/schemas/ConversationLastMessage'
        custom_field_values:
          type: object
          description: Custom-field values keyed by field key (free-form).
        viewer_id:
          type:
            - string
            - 'null'
        viewed_at:
          type:
            - string
            - 'null'
        last_message_by:
          type:
            - string
            - 'null'
    ConversationTag:
      type: object
      description: A tag as embedded on a conversation (id, name, and color only).
      properties:
        id:
          type: string
        name:
          type: string
        color:
          type: string
          description: Hex color in `#RRGGBB` form.
          pattern: ^#[0-9A-Fa-f]{6}$
    ConversationDetail:
      type: object
      description: |
        A single conversation as returned by
        `GET /v1/conversation/{conversation_id}`: the list shape plus the
        attached `tags`.
      allOf:
        - $ref: '#/components/schemas/Conversation'
        - type: object
          properties:
            tags:
              type: array
              items:
                $ref: '#/components/schemas/ConversationTag'
    Message:
      type: object
      description: A full message record, embedded as the `event` of a message thread event.
      properties:
        id:
          type: string
        cc:
          type:
            - array
            - 'null'
          items:
            type: string
        bcc:
          type:
            - array
            - 'null'
          items:
            type: string
        record_type:
          type: string
        status:
          type: string
        direction:
          type: string
        viewed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        text_body:
          type:
            - string
            - 'null'
        excerpt:
          type:
            - string
            - 'null'
        html_body:
          type:
            - string
            - 'null'
        extra:
          type: object
          description: Additional message metadata (free-form).
        downloadable_attachments:
          type: array
          description: Attachments on the message, with direct and API download URLs.
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              size:
                type: integer
              url:
                type: string
                format: uri
              download_url:
                type: string
                format: uri
        is_clipped:
          type: boolean
        intended_inbox_address_id:
          type:
            - string
            - 'null'
    Actor:
      type: object
      description: A compact identity (user or contact) that performed an action or authored content.
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
          format: email
        avatar:
          type:
            - string
            - 'null'
          format: uri
    ThreadEvent:
      type: object
      description: |
        A single event in a conversation thread: a message, note, or a system
        event (assignment, tag change, contact change, and so on). Message
        events carry the full message in `event`. System events have `event`
        set to null.
      properties:
        id:
          type: string
        action:
          type: string
          description: The kind of thread event (e.g. `started`, `conversation_contact_changed`).
        created_at:
          type: string
          format: date-time
        event_id:
          type:
            - string
            - 'null'
        event_type:
          type:
            - string
            - 'null'
          description: Polymorphic type of the linked event record, when present.
        event:
          description: The linked message on message events, null for system events.
          allOf:
            - $ref: '#/components/schemas/Message'
        actor_id:
          type:
            - string
            - 'null'
        actor_type:
          type:
            - string
            - 'null'
          description: Polymorphic type of the actor (a user or a contact).
        actor:
          $ref: '#/components/schemas/Actor'
        extra:
          type: object
          description: Event-specific metadata that varies by action (free-form).
        conversation_id:
          type: string
    PaginationLinks:
      type: object
      properties:
        first:
          type:
            - string
            - 'null'
          format: uri
        last:
          type:
            - string
            - 'null'
          format: uri
        prev:
          type:
            - string
            - 'null'
          format: uri
        next:
          type:
            - string
            - 'null'
          format: uri
    PaginationMeta:
      type: object
      description: Standard (counting) paginator meta block.
      properties:
        current_page:
          type: integer
          example: 1
        from:
          type:
            - integer
            - 'null'
          example: 1
        last_page:
          type: integer
          example: 10
        per_page:
          type: integer
          example: 20
        to:
          type:
            - integer
            - 'null'
          example: 20
        total:
          type: integer
          example: 200
        path:
          type: string
          format: uri
          example: https://api.thrivedesk.com/v1/contacts
        links:
          type: array
          description: |
            Rendered paginator links: the numbered pages plus the previous/next
            controls (whose `url` and `page` are null when unavailable).
          items:
            type: object
            properties:
              url:
                type:
                  - string
                  - 'null'
                format: uri
              label:
                type: string
              page:
                type:
                  - integer
                  - 'null'
              active:
                type: boolean
    ConversationView:
      type: object
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationDetail'
        events:
          type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/ThreadEvent'
            links:
              $ref: '#/components/schemas/PaginationLinks'
            meta:
              $ref: '#/components/schemas/PaginationMeta'
    ConversationUpdateBody:
      type: object
      description: Partial update for a conversation.
      properties:
        status:
          type:
            - string
            - 'null'
          enum:
            - Active
            - Pending
            - Closed
            - null
        assign_to:
          type:
            - string
            - 'null'
          description: Agent ID to assign, or null to unassign.
        tags:
          type: array
          items:
            type: string
        intended_inbox_address_id:
          type:
            - string
            - 'null'
        subject:
          type: string
        custom_fields:
          type: object
          additionalProperties: true
          description: Map of custom-field keys to values.
    ChangeContactBody:
      type: object
      required:
        - contact_id
      properties:
        contact_id:
          type: string
    CustomFieldsUpdateBody:
      type: object
      description: |
        Flat map of custom-field keys to their new values, for fields defined
        on the conversation's inbox. Keys that do not match a custom field
        visible on this conversation are rejected with 422.
      additionalProperties: true
    DraftBody:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Draft body (HTML).
        intended_inbox_address_id:
          type:
            - string
            - 'null'
          description: Email alias ID to send from.
        cc:
          type: array
          maxItems: 20
          items:
            type: string
        bcc:
          type: array
          maxItems: 20
          items:
            type: string
    DraftSaveResponse:
      type: object
      required:
        - message
        - draft_id
      properties:
        message:
          type: string
          example: Draft Saved
        draft_id:
          type: string
          description: Thread-event ID of the stored draft. Reuse it to update the draft or to attach files.
    ForwardBody:
      type: object
      required:
        - body
        - message_id
        - to
      properties:
        body:
          type: string
          description: Body of the forwarding message.
        message_id:
          type: string
          format: uuid
          description: The message being forwarded.
        to:
          type: array
          items:
            type: string
            format: email
        cc:
          type: array
          items:
            type: string
            format: email
        bcc:
          type: array
          items:
            type: string
            format: email
        attachment_ids:
          type: array
          items:
            type: string
            format: uuid
    MergeBody:
      type: object
      required:
        - mergeable_conversation_ids
        - include_notes
        - include_merge_summary
      properties:
        mergeable_conversation_ids:
          type: array
          minItems: 1
          items:
            type: string
        include_notes:
          type: boolean
        include_merge_summary:
          type: boolean
    MessageContact:
      type: object
      description: |
        The contact on a message thread. This is the raw contact model (with
        `organization_id` and timestamps) rather than the contacts-endpoint
        resource, so it carries no `conversations_count`.
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        email:
          type: string
          format: email
        avatar:
          type:
            - string
            - 'null'
          format: uri
        company:
          type:
            - string
            - 'null'
        website:
          type:
            - string
            - 'null'
        job_title:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        should_display_image:
          type: integer
          description: 0 or 1.
        notes:
          type:
            - string
            - 'null'
        extra:
          type: object
          description: Additional contact metadata (free-form).
        organization_id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    MessagesResponse:
      type: object
      properties:
        event:
          type: array
          items:
            $ref: '#/components/schemas/ThreadEvent'
          description: |
            Thread events, oldest first. When the `event_id` query parameter
            is given, this is a single event object instead of an array.
        contact:
          $ref: '#/components/schemas/MessageContact'
        inbox:
          type:
            - string
            - 'null'
          description: Email address of the conversation's inbox.
        subject:
          type:
            - string
            - 'null'
        ticket_id:
          type: integer
    MoveBody:
      type: object
      required:
        - inbox_id
      properties:
        inbox_id:
          type: string
    NoteBody:
      type: object
      required:
        - message
      properties:
        message:
          type: string
        mentioned_ids:
          type: array
          items:
            type: string
          description: IDs of teammates mentioned in the note.
    ReplyBody:
      type: object
      description: |
        Sending a reply dispatches the authenticated user's current draft on
        the conversation. The message content itself is not part of this body.
        The request fails with 404 if no draft exists. Required custom fields
        on the inbox must also be supplied, keyed by their field key.
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
          description: Conversation status to set after sending.
        assign_to:
          type:
            - string
            - 'null'
          description: Agent ID to assign after sending.
        action:
          type: string
          enum:
            - send_and_next_active
            - send_and_back_to_folder
            - send_and_stay_on_page
          description: UI follow-up action recorded with the reply.
        intended_inbox_address_id:
          type:
            - string
            - 'null'
          description: Email alias ID to send from.
        cc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
        bcc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
    ScheduledReplyWrite:
      type: object
      required:
        - message
        - scheduled_at
      properties:
        message:
          type: string
        scheduled_at:
          type: string
          format: date-time
          description: Must be at least 5 minutes in the future (user's timezone).
        type:
          type: string
          enum:
            - regardless
            - if_no_reply
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
          description: Conversation status to set when the reply is sent.
        assign_to:
          type:
            - string
            - 'null'
        intended_inbox_address_id:
          type:
            - string
            - 'null'
        cc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
        bcc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
    ScheduledReplyUpdate:
      type: object
      properties:
        message:
          type: string
        scheduled_at:
          type: string
          format: date-time
          description: Must be at least 5 minutes in the future (user's timezone).
        type:
          type: string
          enum:
            - regardless
            - if_no_reply
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
        assign_to:
          type:
            - string
            - 'null'
        intended_inbox_address_id:
          type:
            - string
            - 'null'
        cc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
        bcc:
          type: array
          maxItems: 20
          items:
            type: string
            format: email
    SnoozeBody:
      type: object
      required:
        - snoozed_until
        - type
      properties:
        snoozed_until:
          type: string
          format: date-time
          description: Must be at least 5 minutes in the future (user's timezone).
        type:
          type: string
          enum:
            - if_no_reply
            - regardless
        is_updating:
          type: boolean
    SplitBody:
      type: object
      required:
        - thread_event_id
        - direction
        - subject
        - status
      properties:
        thread_event_id:
          type: string
          format: uuid
          description: The thread event at which to split.
        direction:
          type: string
          enum:
            - before
            - after
            - only
          description: Which side of the thread event moves to the new conversation.
        subject:
          type: string
          maxLength: 255
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
        additional_note:
          type: string
        priority:
          type:
            - string
            - 'null'
          enum:
            - High
            - Medium
            - Low
            - null
        labels:
          type: array
          items:
            type: string
            format: uuid
        assignable_id:
          type:
            - string
            - 'null'
          format: uuid
    TagAttachBody:
      type: object
      required:
        - tag
      properties:
        tag:
          type: string
          description: ID of the tag to attach.
    TagDetachBody:
      type: object
      required:
        - tag
      properties:
        tag:
          type: string
          description: ID of the tag to detach.
    PriorityBody:
      type: object
      required:
        - priority
      properties:
        priority:
          type: string
          enum:
            - High
            - Medium
            - Low
    ConversationList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Conversation'
    ContactCollection:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    ContactCreate:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
          description: |
            The only field persisted on create. Set the remaining profile
            fields with a follow-up `PATCH /v1/contacts/{contact_id}`.
    ContactCreateResponse:
      type: object
      required:
        - message
        - contact
      properties:
        message:
          type: string
          example: Contact created successfully
        contact:
          $ref: '#/components/schemas/Contact'
    ContactResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Contact'
    ContactUpdate:
      type: object
      description: |
        All fields optional. Only the provided keys are updated. An avatar
        image can also be set by sending `multipart/form-data` with an
        `avatar` file part alongside these fields.
      properties:
        name:
          type: string
          maxLength: 255
        email:
          type: string
          format: email
        phone:
          type: string
          maxLength: 64
        company:
          type: string
          maxLength: 255
        job_title:
          type: string
          maxLength: 255
        address:
          type: string
        website:
          type: string
          format: uri
          maxLength: 255
        notes:
          type: string
        should_display_image:
          type: boolean
    ContactConversationItem:
      type: object
      description: |
        A conversation in a contact's history. This is a compact shape distinct
        from the main conversation resource.
      properties:
        id:
          type: string
        subject:
          type:
            - string
            - 'null'
        status:
          type: string
        type:
          type: string
          description: Conversation channel (e.g. `Email`).
        excerpt:
          type:
            - string
            - 'null'
        inbox_id:
          type: string
        priority:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ConversationTag'
        last_message_by:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
    ContactConversationsResponse:
      type: object
      required:
        - conversations
        - total
      properties:
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/ContactConversationItem'
        total:
          type: integer
    Inbox:
      type: object
      description: |
        An inbox as returned by `GET /v1/inboxes`, including per-folder
        conversation counts and the assigned teams/agents.
      properties:
        id:
          type: string
        name:
          type: string
        inbox_address:
          type: string
        connected_email_address:
          type:
            - string
            - 'null'
        email_forwarding_enabled:
          type: integer
        from_name:
          type:
            - string
            - 'null'
        default_status:
          type: string
        default_assignee:
          type: string
        signature:
          type:
            - string
            - 'null'
        auto_bcc_enabled:
          type: boolean
        auto_bcc:
          type:
            - string
            - 'null'
        auto_reply_enabled:
          type: boolean
        auto_reply_subject:
          type:
            - string
            - 'null'
        auto_reply_body:
          type:
            - string
            - 'null'
        satisfaction_ratings_enabled:
          type: boolean
        satisfaction_ratings:
          type: object
          description: Satisfaction-ratings configuration and copy (free-form).
        all_count:
          type: integer
        mine_count:
          type: integer
        assigned_count:
          type: integer
        unassigned_count:
          type: integer
        draft_count:
          type: integer
        scheduled_count:
          type: integer
        snoozed_count:
          type: integer
        later_count:
          type: integer
        spam_count:
          type: integer
        teams:
          type: array
          description: IDs of teams with access to the inbox.
          items:
            type: string
        agents:
          type: array
          description: IDs of agents assigned to the inbox.
          items:
            type: string
        agents_conversations_count:
          type: object
          description: Open conversation counts keyed by agent ID (free-form).
        aliases:
          type: array
          description: Email aliases configured on the inbox.
          items:
            type: object
        custom_fields:
          type: array
          description: Custom fields defined on the inbox.
          items:
            type: object
        reply_as_alias:
          type: boolean
        insert_signature:
          type: integer
    InboxList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Inbox'
    ConversationCollection:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Conversation'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    FilterTree:
      type: object
      description: |
        Boolean filter tree. `condition` combines the entries in `groups`.
        Each group is either a leaf (`attribute` + `comparison` + `values`)
        or a nested tree with its own `condition` and `groups`.
      required:
        - condition
      properties:
        condition:
          type: string
          enum:
            - and
            - or
        groups:
          type: array
          items:
            type: object
            properties:
              condition:
                type: string
                enum:
                  - and
                  - or
              groups:
                type: array
                items:
                  type: object
                  additionalProperties: true
              attribute:
                type:
                  - string
                  - 'null'
              comparison:
                type:
                  - string
                  - 'null'
                enum:
                  - eq
                  - neq
                  - gt
                  - gte
                  - lt
                  - lte
                  - contains
                  - not_contains
                  - starts_with
                  - ends_with
                  - contains_exact
                  - 'null'
                  - known
                  - between
                  - 'true'
                  - 'false'
                  - in
                  - any
                  - all
                  - exclude_any
                  - exclude_all
                  - null
              values:
                type:
                  - array
                  - 'null'
                items:
                  type: object
                  properties:
                    value: {}
                    data:
                      type:
                        - array
                        - 'null'
                      items: {}
    InboxFilterBody:
      type: object
      required:
        - filters
      properties:
        filters:
          $ref: '#/components/schemas/FilterTree'
        display:
          type: object
          properties:
            sort:
              type: string
              enum:
                - newest
                - oldest
            per_page:
              type: integer
              minimum: 1
              maximum: 100
            page:
              type: integer
              minimum: 1
    Automation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        automatic:
          type: boolean
        active:
          type: boolean
        when:
          type: object
          description: Trigger definition (free-form, see Automation docs).
          additionalProperties: true
        rules:
          type: object
          description: |
            Rule definition. Array-of-conditions form when paired with multiple
            rules, single object form otherwise.
          additionalProperties: true
        actions:
          type: array
          description: Actions to perform when the automation fires.
          items:
            type: object
            additionalProperties: true
        created_by:
          $ref: '#/components/schemas/User'
        uses_count:
          type:
            - integer
            - 'null'
        last_used_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        id: 2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a
        name: Auto-assign billing questions
        automatic: true
        active: true
        when:
          event: conversation_created
        rules:
          all:
            - attribute: subject
              comparison: contains
              value: refund
        actions:
          - type: assign
            value: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
        created_by:
          id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
          name: Alex Morgan
          email: agent@example.com
          role: Administrator
        uses_count: 8
        last_used_at: '2026-07-10T09:00:00Z'
        created_at: '2026-07-10T09:00:00Z'
        updated_at: '2026-07-10T09:00:00Z'
    AutomationList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Automation'
    AutomationResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Automation'
    InboxBatchDeleteBody:
      type: object
      required:
        - conversations
      properties:
        conversations:
          type: array
          minItems: 1
          items:
            type: string
          description: IDs of the conversations to soft-delete.
    InboxBatchIdsBody:
      type: object
      required:
        - conversation_ids
      properties:
        conversation_ids:
          type: array
          minItems: 1
          items:
            type: string
    InboxBatchUpdateBody:
      type: object
      required:
        - conversations
      properties:
        conversations:
          type: array
          minItems: 1
          items:
            type: string
          description: IDs of the conversations to update.
        status:
          type:
            - string
            - 'null'
          enum:
            - Active
            - Pending
            - Processing
            - Closed
            - null
        is_spam:
          type:
            - boolean
            - 'null'
        assign_to:
          type:
            - string
            - 'null'
          description: Agent ID to assign, or null to unassign.
        tag:
          type:
            - string
            - 'null'
          format: uuid
          description: A single tag ID to attach to every conversation.
        priority:
          type:
            - string
            - 'null'
          enum:
            - High
            - Medium
            - Low
            - null
    InboxConversationCreate:
      type: object
      required:
        - to
        - status
        - subject
        - message
      properties:
        to:
          type: string
          format: email
          maxLength: 100
        status:
          type: string
          enum:
            - Active
            - Pending
            - Closed
        subject:
          type: string
        message:
          type: string
        cc:
          type: array
          maxItems: 100
          items:
            type: string
            format: email
        bcc:
          type: array
          maxItems: 100
          items:
            type: string
            format: email
        agent:
          type:
            - string
            - 'null'
          description: ID of the agent to assign.
        tags:
          type: array
          items:
            type: string
        is_draft:
          type:
            - boolean
            - 'null'
        message_id:
          type: string
          format: uuid
        intended_inbox_address_id:
          type:
            - string
            - 'null'
          format: uuid
        contact:
          type:
            - object
            - 'null'
          properties:
            name:
              type:
                - string
                - 'null'
              maxLength: 191
            company:
              type:
                - string
                - 'null'
              maxLength: 191
            job_title:
              type:
                - string
                - 'null'
              maxLength: 191
            address:
              type:
                - string
                - 'null'
              maxLength: 191
            website:
              type:
                - string
                - 'null'
              maxLength: 191
            notes:
              type:
                - string
                - 'null'
            is_actor:
              type:
                - boolean
                - 'null'
        custom_fields:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Map of custom-field keys to values.
    CustomFieldCreate:
      type: object
      required:
        - name
        - type
        - key
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 25
        type:
          type: string
          enum:
            - text
            - textarea
            - dropdown
            - toggle
            - number
        key:
          type: string
          minLength: 3
          maxLength: 25
          pattern: ^[A-Za-z0-9_]+$
          description: Unique per inbox.
        description:
          type:
            - string
            - 'null'
          maxLength: 250
        is_required:
          type: boolean
        is_active:
          type: boolean
        default_value:
          description: Type must match the field type (string, boolean, or number).
        options:
          type: array
          minItems: 1
          items:
            type: string
          description: Only for dropdown fields, rejected for other types.
        conditions:
          type: array
          description: Only for field types that support conditional visibility.
          items:
            type: object
            required:
              - expected_value
              - dependent_field_ids
            properties:
              expected_value:
                type: string
                maxLength: 255
              dependent_field_ids:
                type: array
                minItems: 1
                items:
                  type: string
                  format: uuid
    CustomField:
      type: object
      properties:
        id:
          type: string
        inbox_id:
          type: string
        name:
          type: string
        key:
          type: string
        description:
          type:
            - string
            - 'null'
        type:
          type: string
          enum:
            - text
            - textarea
            - dropdown
            - toggle
            - number
        default_value: {}
        is_required:
          type: boolean
        is_active:
          type: boolean
        order:
          type: integer
        extra:
          type:
            - object
            - 'null'
          additionalProperties: true
        options:
          type: array
          description: Present for dropdown fields.
          items:
            type: object
            properties:
              id:
                type: string
              value:
                type: string
        conditions:
          type: array
          items:
            type: object
            additionalProperties: true
        created_at:
          type: string
          format: date-time
        readable_created_at:
          type:
            - string
            - 'null'
      example:
        id: 4f5e6d7c-8b9a-4c0d-9e1f-2a3b4c5d6e7f
        inbox_id: 3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f
        name: Order Number
        key: order_number
        description: The customer's order reference.
        type: text
        default_value: null
        is_required: true
        is_active: true
        order: 1
        extra: null
        options: []
        conditions: []
        created_at: '2026-07-10T09:00:00Z'
        readable_created_at: Jul 10, 2026
    CustomFieldResponse:
      type: object
      required:
        - message
        - data
      properties:
        message:
          type: string
          example: Custom field created successfully
        data:
          $ref: '#/components/schemas/CustomField'
    CustomFieldUpdate:
      type: object
      description: |
        `name` and `type` are immutable. Sending a changed value for either is
        rejected with 422.
      properties:
        description:
          type:
            - string
            - 'null'
          maxLength: 250
        is_required:
          type: boolean
        is_active:
          type: boolean
        default_value:
          description: Type must match the field type (string, boolean, or number).
        options:
          type: array
          description: |
            Only for dropdown fields. Objects with `id: null` create new
            options, and existing IDs update them.
          items:
            type: object
            required:
              - value
            properties:
              id:
                type:
                  - string
                  - 'null'
              value:
                type: string
                maxLength: 255
        conditions:
          type:
            - array
            - 'null'
          items:
            type: object
            required:
              - expected_value
              - dependent_field_ids
            properties:
              expected_value:
                type: string
                maxLength: 255
              dependent_field_ids:
                type: array
                minItems: 1
                items:
                  type: string
                  format: uuid
    SavedReply:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        message:
          type: string
        folder:
          type: string
        inbox_id:
          type:
            - string
            - 'null'
        uses_count:
          type: integer
        author:
          $ref: '#/components/schemas/Actor'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        id: 8c7b6a5d-4e3f-4a2b-9c1d-0e1f2a3b4c5d
        name: Refund acknowledgement
        message: <p>We've started your refund and will email confirmation shortly.</p>
        folder: Billing
        inbox_id: 3f7c1e94-2b6a-4d0e-8c5f-9a1b2c3d4e5f
        uses_count: 12
        created_at: '2026-07-10T09:00:00Z'
        updated_at: '2026-07-10T09:00:00Z'
    SavedReplyList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SavedReply'
    Tag:
      type: object
      description: A tag, as returned by the tag list endpoints.
      properties:
        id:
          type: string
        name:
          type: string
        color:
          type: string
          description: Hex color in `#RRGGBB` form.
          pattern: ^#[0-9A-Fa-f]{6}$
          example: '#FF0000'
        conversations_count:
          type: integer
    SimplePaginationMeta:
      type: object
      description: |
        Simple (non-counting) paginator meta. Omits `last_page` and `total`
        and adds `current_page_url`.
      properties:
        current_page:
          type: integer
        current_page_url:
          type:
            - string
            - 'null'
          format: uri
        from:
          type:
            - integer
            - 'null'
        to:
          type:
            - integer
            - 'null'
        per_page:
          type: integer
        path:
          type: string
          format: uri
    InboxTagCollection:
      type: object
      description: Tags assigned within an inbox. Uses simple pagination.
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/SimplePaginationMeta'
    TagCollection:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    TagWrite:
      type: object
      description: Fields accepted by tag create.
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 64
          description: Unique per organization.
        color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
    TagCreateResponse:
      type: object
      required:
        - message
        - tag
      properties:
        message:
          type: string
          example: Tag has been created
        tag:
          $ref: '#/components/schemas/Tag'
    TagUpdate:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Unique per organization.
        color:
          type:
            - string
            - 'null'
    TagsMergeBody:
      type: object
      required:
        - name
        - tags
      properties:
        name:
          type: string
          maxLength: 64
          description: Name of the merged tag. Must be unique within the organization.
        color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
        tags:
          type: array
          minItems: 2
          items:
            type: string
          description: IDs of the tags being merged into the new one.
    Invitation:
      type: object
      description: A pending teammate invitation.
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        role:
          type: string
          enum:
            - Administrator
            - User
        accept_url:
          type: string
          format: uri
        decline_url:
          type: string
          format: uri
        created_at:
          type: string
          format: date-time
      example:
        id: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
        email: colleague@example.com
        role: User
        accept_url: https://app.thrivedesk.com/invitations/9a8b7c6d/accept
        decline_url: https://app.thrivedesk.com/invitations/9a8b7c6d/decline
        created_at: '2026-07-10T09:00:00Z'
    UsersIndexResponse:
      type: object
      required:
        - users
        - invitations
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: |
            Teammates visible to the caller. Organization owners see every
            member. Other roles see only agents who share an inbox with them.
        invitations:
          type: array
          items:
            $ref: '#/components/schemas/Invitation'
    UserResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/User'
    SavedReplyWrite:
      type: object
      required:
        - name
        - message
        - folder
      properties:
        name:
          type: string
        message:
          type: string
        folder:
          type: string
        inbox_id:
          type:
            - string
            - 'null'
          description: |
            When null, the saved reply is global (available to every inbox).
    SavedReplyUpdate:
      type: object
      properties:
        name:
          type: string
        message:
          type: string
        folder:
          type: string
        inbox_id:
          type:
            - string
            - 'null'
    ReportAgent:
      type: object
      description: An agent's totals in the agent leaderboard report.
      properties:
        id:
          type: string
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        name:
          type: string
        conversation_count:
          type: integer
        resolution_count:
          type: integer
        pivot:
          type: object
          description: Inbox-accessor pivot metadata (free-form).
      example:
        id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
        first_name: Alex
        last_name: Morgan
        name: Alex Morgan
        conversation_count: 87
        resolution_count: 64
    ReportsAgents:
      type: object
      properties:
        agents:
          type: array
          items:
            $ref: '#/components/schemas/ReportAgent'
    ReportDayCount:
      type: object
      description: A per-day metric bucket (a count for a given year/month/day).
      properties:
        count:
          type: integer
        year:
          type: integer
        month:
          type: integer
        day:
          type: integer
      example:
        count: 12
        year: 2026
        month: 7
        day: 10
    InboxDetail:
      type: object
      description: |
        The full inbox model (with `extra`, `organization_id`, and the
        soft-delete timestamp), as embedded in a report or a single-message
        response. Differs from the list shape returned by `GET /v1/inboxes`.
      properties:
        id:
          type: string
        name:
          type: string
        inbox_address:
          type: string
        connected_email_address:
          type:
            - string
            - 'null'
        email_forwarding_enabled:
          type: integer
        from_name:
          type:
            - string
            - 'null'
        default_status:
          type: string
        default_assignee:
          type: string
        signature:
          type:
            - string
            - 'null'
        auto_bcc_enabled:
          type: boolean
        auto_bcc:
          type:
            - string
            - 'null'
        auto_reply_enabled:
          type: boolean
        auto_reply_subject:
          type:
            - string
            - 'null'
        auto_reply_body:
          type:
            - string
            - 'null'
        satisfaction_ratings_enabled:
          type: boolean
        satisfaction_ratings:
          type: object
          description: Satisfaction-ratings configuration and copy (free-form).
        extra:
          type: object
          description: Additional inbox metadata (free-form).
        organization_id:
          type: string
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        reply_as_alias:
          type: boolean
        insert_signature:
          type: integer
    ReportsConversations:
      type: object
      properties:
        total_conversations:
          type: integer
        new_conversations_count:
          type: integer
        new_conversations:
          type: array
          items:
            $ref: '#/components/schemas/ReportDayCount'
        resolutions_count:
          type: integer
        resolutions:
          type: array
          items:
            $ref: '#/components/schemas/ReportDayCount'
        contacts_helped_count:
          type: integer
        contacts_helped:
          type: array
          items:
            $ref: '#/components/schemas/ReportDayCount'
        inbox:
          $ref: '#/components/schemas/InboxDetail'
    ReportsHappiness:
      type: object
      properties:
        total_ratings_count:
          type: integer
        great_ratings_count:
          type: integer
        great_ratings:
          type: array
          description: Individual great ratings.
          items:
            type: object
        bad_ratings_count:
          type: integer
        bad_ratings:
          type: array
          description: Individual bad ratings.
          items:
            type: object
        okay_ratings_count:
          type: integer
        okay_ratings:
          type: array
          description: Individual okay ratings.
          items:
            type: object
    ProductivityMessage:
      type: object
      properties:
        id:
          type: string
        created_at:
          type: string
          format: date-time
        conversation_id:
          type: string
    ProductivityConversation:
      type: object
      description: A conversation that received agent responses, with its reply messages.
      properties:
        id:
          type: string
        created_at:
          type: string
          format: date-time
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ProductivityMessage'
    ResolutionTime:
      type: object
      description: A resolution and the time it took, in seconds (as a string).
      properties:
        date:
          type: string
          format: date
        resolution_time:
          type: string
    ReportsProductivity:
      type: object
      properties:
        resolved_conversations_with_multiple_reply:
          type: integer
        resolved_conversations_with_one_reply:
          type: integer
        assigned_conversations:
          type: integer
        created_conversations:
          type: integer
        conversations_with_responses:
          type: array
          items:
            $ref: '#/components/schemas/ProductivityConversation'
        resolutions_with_time:
          type: array
          items:
            $ref: '#/components/schemas/ResolutionTime'
        avg_replies_to_resolution:
          type: number
    KnowledgeBase:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        visibility:
          type: string
        extra:
          type:
            - object
            - 'null'
          additionalProperties: true
      example:
        id: 9c81790c-ae74-4cbd-b2ca-d246ae0df1a9
        name: Help Center
        slug: help-center
        visibility: public
        extra: null
    KnowledgeBaseList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBase'
    KnowledgeBaseCreate:
      type: object
      required:
        - name
        - slug
        - is_private
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 50
        slug:
          type: string
          minLength: 3
          maxLength: 50
          description: Must be unique. Reserved slugs are rejected.
        is_private:
          type: boolean
        members:
          type: array
          items:
            type: object
            required:
              - email
              - role
            properties:
              email:
                type: string
                format: email
                maxLength: 255
              role:
                type: string
    KnowledgeBaseCreateResponse:
      type: object
      properties:
        knowledgebase_id:
          type: string
        message:
          type: string
          example: Knowledgebase created
    KnowledgeBaseResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/KnowledgeBase'
    KnowledgeBaseUpdate:
      type: object
      required:
        - name
        - slug
      properties:
        name:
          type: string
          minLength: 5
          maxLength: 50
        slug:
          type: string
          minLength: 5
          maxLength: 50
          description: Must be unique. Reserved slugs are rejected.
        members:
          type: array
          items:
            type: object
            required:
              - email
              - role
            properties:
              email:
                type: string
                format: email
                maxLength: 255
              role:
                type: string
    KnowledgeBaseArticleListItem:
      type: object
      description: An article summary in a knowledge base's article list.
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        excerpt:
          type:
            - string
            - 'null'
        published_at:
          type:
            - string
            - 'null'
          format: date-time
        knowledgebase:
          type: object
          description: The knowledge base the article belongs to.
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
            visibility:
              type:
                - string
                - 'null'
    KnowledgeBaseArticleList:
      type: object
      description: A paginated list of published articles in a knowledge base.
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseArticleListItem'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    KnowledgeBaseArticle:
      type: object
      description: |
        Articles are passed through from an upstream service. The exact shape is
        owned by the help-center service.
      additionalProperties: true
    AttachmentUploadResponse:
      type: object
      required:
        - message
        - draft_id
        - data
      properties:
        message:
          type: string
          example: Attachment uploaded
        draft_id:
          type: string
          description: The draft the files were attached to (created on the fly when `draft_id` is "null").
        data:
          type: array
          description: The stored attachment records.
          items:
            type: object
            properties:
              attachment_id:
                type: string
              name:
                type: string
              size:
                type: integer
              type:
                type: string
                description: MIME type.
              inline:
                type: boolean
            additionalProperties: true
    MessageDetail:
      type: object
      properties:
        id:
          type: string
        html_body:
          type:
            - string
            - 'null'
          description: HTML body, falling back to the text body.
        cc:
          type:
            - array
            - 'null'
          items:
            type: string
            format: email
        bcc:
          type:
            - array
            - 'null'
          items:
            type: string
            format: email
        extra:
          type:
            - object
            - 'null'
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        conversation:
          $ref: '#/components/schemas/Conversation'
        contact:
          $ref: '#/components/schemas/MessageContact'
        inbox:
          $ref: '#/components/schemas/InboxDetail'
    MessageDetailResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/MessageDetail'
    ThreadUpdateBody:
      type: object
      properties:
        html_body:
          type:
            - string
            - 'null'
        text_body:
          type:
            - string
            - 'null'
    SearchBody:
      type: object
      properties:
        q:
          type: object
          description: |
            Filter object passed to the search engine. Common keys: `subject`,
            `status`, `inbox_id`, `assignee_id`, `tag_id`, `contact_id`,
            `from_date`, `to_date`. Defaults to no filters.
          additionalProperties: true
        per-page:
          type: integer
          default: 20
        sort:
          type: string
          enum:
            - newest
            - oldest
          default: newest
    SearchResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            conversations:
              type: object
              description: Paginated collection of conversations.
      example:
        success: true
        data:
          conversations:
            current_page: 1
            data:
              - id: 7b1d4e2a-9c8f-4a3b-b6d5-1e2f3a4b5c6d
                ticket_id: 1042
                subject: Order INV-1042 arrived damaged
                status: open
                priority: high
            per_page: 20
            total: 1
  parameters:
    ConversationId:
      in: path
      name: conversation_id
      required: true
      description: Conversation identifier.
      schema:
        type: string
    Page:
      in: query
      name: page
      schema:
        type: integer
        minimum: 1
        default: 1
    ContactId:
      in: path
      name: contact_id
      required: true
      schema:
        type: string
    InboxId:
      in: path
      name: inbox_id
      required: true
      description: Inbox identifier.
      schema:
        type: string
    PerPage:
      in: query
      name: per-page
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
    AutomationId:
      in: path
      name: automation_id
      required: true
      schema:
        type: string
    FieldId:
      in: path
      name: field_id
      required: true
      schema:
        type: string
    TagId:
      in: path
      name: tag_id
      required: true
      schema:
        type: string
    UserId:
      in: path
      name: user_id
      required: true
      description: Teammate identifier.
      schema:
        type: string
    SavedReplyId:
      in: path
      name: saved_reply_id
      required: true
      schema:
        type: string
    StartDate:
      in: query
      name: start_date
      required: true
      description: Start of the reporting window.
      schema:
        type: string
        format: date
    EndDate:
      in: query
      name: end_date
      required: true
      description: End of the reporting window.
      schema:
        type: string
        format: date
    KnowledgeBaseId:
      in: path
      name: knowledgebase_id
      required: true
      schema:
        type: string
    KnowledgeBaseSlug:
      in: path
      name: knowledgebase_slug
      required: true
      schema:
        type: string
    ArticleId:
      in: path
      name: article_id
      required: true
      schema:
        type: string
    AttachmentId:
      in: path
      name: attachmentId
      required: true
      description: Attachment identifier. Named in camelCase, unlike the snake_case path parameters elsewhere.
      schema:
        type: string
    ConversationIdCamel:
      in: path
      name: conversationId
      required: true
      description: Conversation identifier. Named in camelCase, unlike the snake_case path parameters elsewhere.
      schema:
        type: string
    MessageId:
      in: path
      name: message_id
      required: true
      schema:
        type: string
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              value:
                message: Unauthenticated.
    Forbidden:
      description: Token is valid but does not include a required scope, or the user does not have access to the resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Request body failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    TooManyRequests:
      description: |
        Rate limit exceeded. The `Retry-After` header indicates how long to wait
        before retrying. See [Pagination and rate limits](/docs/pagination.html) for
        the full rate-limit policy.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            throttled:
              value:
                message: Too Many Attempts.
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
x-tagGroups:
  - name: Getting started
    tags:
      - Misc
  - name: Core
    tags:
      - Conversations
      - Contacts
      - Inboxes
  - name: Organization
    tags:
      - Tags
      - Saved Replies
      - Users
  - name: Analytics
    tags:
      - Reports
  - name: Knowledge Base
    tags:
      - Knowledge Base
  - name: Attachments
    tags:
      - Attachments
      - Messages and Notes
