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

# Get ticket details



## OpenAPI

````yaml /api-reference/support-openapi.json get /api/integration/ai_service/ticket/{ticket_id}/details
openapi: 3.1.0
info:
  title: Clarity Support API
  version: '1.0'
  description: Tickets, customers, messages, the knowledge base, and webhooks.
servers:
  - url: https://back.leap.onclarity.com
security:
  - organizationApiKey: []
tags:
  - name: AI service
    description: >-
      Hand a customer conversation to your Clarity AI agent from your own app or
      backend.
  - name: Messages
    description: Reply to customers on their ticket's channel and add private notes.
  - name: Customers
    description: Create, update, and look up customers and their custom attributes.
  - name: Tickets
    description: >-
      Change a ticket's status, assignee, category, and tags, and list the
      values they take.
  - name: Knowledge base
    description: Manage the articles your AI agents answer from.
  - name: Webhooks
    description: Subscribe your endpoints to events in your organization.
paths:
  /api/integration/ai_service/ticket/{ticket_id}/details:
    get:
      tags:
        - AI service
      summary: Get ticket details
      operationId: ApiIntegrationAiServiceTicketTicketIdDetailsGetTicketDetails
      parameters:
        - name: ticket_id
          in: path
          schema:
            type: integer
          required: true
          deprecated: false
        - name: events_limit
          in: query
          schema:
            type: integer
            default: 20
          required: false
          deprecated: false
          allowEmptyValue: false
          allowReserved: false
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetailsResponse'
        '400':
          description: Bad request syntax or unsupported method
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KTSErrorResponse'
        '500':
          description: Server got itself in trouble
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KTSErrorResponse'
      deprecated: false
components:
  schemas:
    TicketDetailsResponse:
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
        ticket:
          $ref: '#/components/schemas/AIServiceTicket'
        tags:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
        team:
          oneOf:
            - $ref: '#/components/schemas/TicketTeam'
            - type: 'null'
        events:
          items:
            $ref: '#/components/schemas/ConversationEvent'
          type: array
        handoff_brief:
          oneOf:
            - $ref: '#/components/schemas/HandoffBrief'
            - type: 'null'
      type: object
      required:
        - customer
        - events
        - tags
        - ticket
      title: TicketDetailsResponse
    KTSErrorResponse:
      properties:
        status:
          type: string
          default: error
        code:
          type: string
        message:
          oneOf:
            - type: string
            - type: 'null'
        extra:
          oneOf:
            - additionalProperties: {}
              type: object
            - items: {}
              type: array
            - type: 'null'
      type: object
      required:
        - code
      title: KTSErrorResponse
    Customer:
      properties:
        id:
          type: integer
        first_name:
          type: string
        last_name:
          oneOf:
            - type: string
            - type: 'null'
        avatar_url:
          oneOf:
            - type: string
            - type: 'null'
        organization_id:
          type: integer
        attributes:
          items:
            $ref: '#/components/schemas/CustomerAttribute'
          type: array
        tags:
          oneOf:
            - items:
                $ref: '#/components/schemas/Tag'
              type: array
            - type: 'null'
        custom_attributes:
          additionalProperties: {}
          type: object
          default: {}
        gender:
          oneOf:
            - type: string
            - type: 'null'
        gender_source:
          oneOf:
            - type: string
            - type: 'null'
        merged_into_id:
          oneOf:
            - type: integer
            - type: 'null'
        has_open_suggestion:
          type: boolean
          default: false
        channels:
          items:
            $ref: '#/components/schemas/ChannelType'
          type: array
      type: object
      required:
        - attributes
        - first_name
        - id
        - organization_id
      title: Customer
    AIServiceTicket:
      properties:
        id:
          type: integer
        conversation_id:
          type: integer
        status:
          $ref: '#/components/schemas/TicketStatus'
        priority:
          $ref: '#/components/schemas/TicketPriority'
        category:
          oneOf:
            - $ref: '#/components/schemas/TicketCategory'
            - type: 'null'
        is_archived:
          type: boolean
        custom_attributes:
          additionalProperties: {}
          type: object
          default: {}
      type: object
      required:
        - conversation_id
        - id
        - is_archived
        - priority
        - status
      title: AIServiceTicket
    Tag:
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          oneOf:
            - type: string
            - type: 'null'
        color:
          type: string
      type: object
      required:
        - color
        - id
        - name
      title: Tag
    TicketTeam:
      properties:
        id:
          type: integer
        name:
          type: string
        avatar_url:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - id
        - name
      title: TicketTeam
    ConversationEvent:
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/ConversationEventType'
        created_at:
          type: string
          format: date-time
        ticket_id:
          type: integer
        conversation_id:
          type: integer
        payload:
          oneOf:
            - $ref: >-
                #/components/schemas/ConversationEventStatusChangePayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventPriorityChangePayloadResponse
            - $ref: '#/components/schemas/ConversationEventSnoozedPayloadResponse'
            - $ref: '#/components/schemas/ConversationEventMessagePayloadResponse'
            - $ref: >-
                #/components/schemas/ConversationEventRecommendationPayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventAssigneeChangePayloadResponse
            - $ref: '#/components/schemas/ConversationEventTeamChangePayloadResponse'
            - $ref: >-
                #/components/schemas/ConversationEventTicketClosedPayloadResponse
            - $ref: '#/components/schemas/ConversationEventFormSubmittedPayload'
            - $ref: >-
                #/components/schemas/ConversationEventCategoryChangePayloadResponse
            - $ref: '#/components/schemas/ConversationEventTagsChangedPayloadResponse'
            - $ref: '#/components/schemas/ConversationEventSurveySentPayloadResponse'
            - $ref: >-
                #/components/schemas/ConversationEventWATemplateSendPayloadResponse
            - $ref: '#/components/schemas/ConversationEventSnoozeEndPayloadResponse'
            - $ref: >-
                #/components/schemas/ConversationEventSystemNotificationPayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventErrorMessagePayloadResponse
            - $ref: '#/components/schemas/WidgetSendMessagePayloadResponse'
            - $ref: '#/components/schemas/WidgetFormSubmittedPayloadResponse'
            - $ref: '#/components/schemas/WidgetApiCallPayloadResponse'
            - $ref: '#/components/schemas/WidgetHtmlActionPayloadResponse'
            - $ref: >-
                #/components/schemas/ConversationEventArticleUpdatePayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventArticleCreatePayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventArticleDeletePayloadResponse
            - $ref: >-
                #/components/schemas/ConversationEventConfigChangePayloadResponse
        internal_id:
          type: string
        status:
          oneOf:
            - $ref: '#/components/schemas/ConversationMessageStatus'
            - type: 'null'
      type: object
      required:
        - conversation_id
        - created_at
        - id
        - internal_id
        - payload
        - ticket_id
        - type
      title: ConversationEvent
    HandoffBrief:
      properties:
        reason:
          type: string
          default: ''
        summary:
          type: string
          default: ''
        key_facts:
          items:
            $ref: '#/components/schemas/BriefKeyFact'
          type: array
        commitments:
          items:
            type: string
          type: array
        open_question:
          type: string
          default: ''
        opening_line:
          oneOf:
            - type: string
            - type: 'null'
        language:
          oneOf:
            - type: string
            - type: 'null'
        caller_verified:
          type:
            - 'null'
            - string
          enum:
            - verified
            - not_verified
            - exhausted
            - null
        customer:
          oneOf:
            - $ref: '#/components/schemas/BriefCustomer'
            - type: 'null'
        source:
          oneOf:
            - $ref: '#/components/schemas/BriefSource'
            - type: 'null'
      type: object
      required: []
      title: HandoffBrief
    CustomerAttribute:
      properties:
        key:
          type: string
        value:
          oneOf:
            - type: string
            - items:
                oneOf:
                  - type: string
                  - type: 'null'
              type: array
            - type: 'null'
      type: object
      required:
        - key
      title: CustomerAttribute
    ChannelType:
      type: string
      enum:
        - whatsapp
        - android_sdk
        - ios_sdk
        - web
        - voice
        - social
        - x
        - email
        - instagram
        - linkedin
      title: ChannelType
      description: Channel type (web, android_sdk, ios_sdk, whatsapp)
    TicketStatus:
      properties:
        id:
          type: integer
        organization_id:
          type: integer
        name:
          type: string
        state:
          $ref: '#/components/schemas/TicketStatusState'
        color:
          type: string
        description:
          type: string
      type: object
      required:
        - color
        - description
        - id
        - name
        - organization_id
        - state
      title: TicketStatus
    TicketPriority:
      properties:
        id:
          type: integer
        organization_id:
          type: integer
        name:
          type: string
        color:
          type: string
        weight:
          type: integer
      type: object
      required:
        - color
        - id
        - name
        - organization_id
        - weight
      title: TicketPriority
    TicketCategory:
      properties:
        id:
          type: integer
        organization_id:
          type: integer
        label:
          type: string
        parent_id:
          oneOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - id
        - label
        - organization_id
      title: TicketCategory
    ConversationEventType:
      type: string
      enum:
        - message
        - private_note
        - status_change
        - assignee_change
        - team_change
        - priority_change
        - snoozed
        - snooze_end
        - ticket_closed
        - category_change
        - embedded_form_submitted
        - ticket_tags_changed
        - survey_sent
        - wa_template_message
        - prompt
        - recommendation
        - system_notification
        - error_message
        - widget_send_message
        - widget_form_submitted
        - widget_api_call
        - widget_html_action
        - article_update
        - article_create
        - article_delete
        - config_change
      title: ConversationEventType
    ConversationEventStatusChangePayloadResponse:
      properties:
        old_status_id:
          oneOf:
            - type: integer
            - type: 'null'
        new_status_id:
          type: integer
        type:
          type: string
          const: status_change
      type: object
      required:
        - new_status_id
        - type
      title: ConversationEventStatusChangePayloadResponse
    ConversationEventPriorityChangePayloadResponse:
      properties:
        old_priority_id:
          oneOf:
            - type: integer
            - type: 'null'
        new_priority_id:
          type: integer
        type:
          type: string
          const: priority_change
      type: object
      required:
        - new_priority_id
        - type
      title: ConversationEventPriorityChangePayloadResponse
    ConversationEventSnoozedPayloadResponse:
      properties:
        until_dt:
          type: string
          format: date-time
        type:
          type: string
          const: snoozed
      type: object
      required:
        - type
        - until_dt
      title: ConversationEventSnoozedPayloadResponse
    ConversationEventMessagePayloadResponse:
      properties:
        text:
          type: string
        text_i18n:
          oneOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
        source:
          $ref: '#/components/schemas/ConversationEventSource'
        agent:
          oneOf:
            - $ref: '#/components/schemas/ConversationAgent'
            - type: 'null'
        type:
          type: string
          enum:
            - message
            - private_note
            - prompt
        status:
          oneOf:
            - $ref: '#/components/schemas/ConversationMessageStatus'
            - type: 'null'
        mentioned_agents:
          oneOf:
            - items:
                $ref: '#/components/schemas/ConversationAgent'
              type: array
            - type: 'null'
        customer_name:
          oneOf:
            - type: string
            - type: 'null'
        assigned_agent_id:
          oneOf:
            - type: integer
            - type: 'null'
        files:
          items:
            $ref: '#/components/schemas/AttachmentFileResponse'
          type: array
        widgets:
          items:
            oneOf:
              - $ref: '#/components/schemas/LinkWidget'
              - $ref: '#/components/schemas/SendMessageWidget'
              - $ref: '#/components/schemas/OptionWidget'
              - $ref: '#/components/schemas/CopyWidget'
              - $ref: '#/components/schemas/FormWidget'
              - $ref: '#/components/schemas/ApiCallWidget'
              - $ref: '#/components/schemas/DisplayWidget'
              - $ref: '#/components/schemas/HtmlWidgetResponse'
          type: array
        voice_call:
          oneOf:
            - $ref: '#/components/schemas/VoiceCallPayload'
            - type: 'null'
        x_post_id:
          oneOf:
            - type: string
            - type: 'null'
        x_post_type:
          oneOf:
            - type: string
            - type: 'null'
        x_screen_name:
          oneOf:
            - type: string
            - type: 'null'
        x_display_name:
          oneOf:
            - type: string
            - type: 'null'
        x_conversation_id:
          oneOf:
            - type: string
            - type: 'null'
        x_quoted_text:
          oneOf:
            - type: string
            - type: 'null'
        x_quoted_post_url:
          oneOf:
            - type: string
            - type: 'null'
        x_quoted_files:
          items:
            $ref: '#/components/schemas/AttachmentFileResponse'
          type: array
        email_subject:
          oneOf:
            - type: string
            - type: 'null'
        email_from:
          oneOf:
            - type: string
            - type: 'null'
        email_message_id:
          oneOf:
            - type: string
            - type: 'null'
        email_in_reply_to:
          oneOf:
            - type: string
            - type: 'null'
        email_references:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
        email_to:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
        email_cc:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
        ig_event_type:
          oneOf:
            - type: string
            - type: 'null'
        ig_username:
          oneOf:
            - type: string
            - type: 'null'
        ig_display_name:
          oneOf:
            - type: string
            - type: 'null'
        ig_comment_id:
          oneOf:
            - type: string
            - type: 'null'
        ig_media_id:
          oneOf:
            - type: string
            - type: 'null'
        ig_thread_id:
          oneOf:
            - type: string
            - type: 'null'
        ig_permalink:
          oneOf:
            - type: string
            - type: 'null'
        ig_media_product_type:
          oneOf:
            - type: string
            - type: 'null'
        li_event_type:
          oneOf:
            - type: string
            - type: 'null'
        li_actor_urn:
          oneOf:
            - type: string
            - type: 'null'
        li_actor_name:
          oneOf:
            - type: string
            - type: 'null'
        li_vanity_name:
          oneOf:
            - type: string
            - type: 'null'
        li_comment_urn:
          oneOf:
            - type: string
            - type: 'null'
        li_post_urn:
          oneOf:
            - type: string
            - type: 'null'
        li_thread_id:
          oneOf:
            - type: string
            - type: 'null'
        li_permalink:
          oneOf:
            - type: string
            - type: 'null'
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        buttons:
          items:
            oneOf:
              - $ref: '#/components/schemas/LinkWidget'
              - $ref: '#/components/schemas/SendMessageWidget'
              - $ref: '#/components/schemas/OptionWidget'
              - $ref: '#/components/schemas/CopyWidget'
              - $ref: '#/components/schemas/FormWidget'
              - $ref: '#/components/schemas/ApiCallWidget'
              - $ref: '#/components/schemas/DisplayWidget'
              - $ref: '#/components/schemas/HtmlWidgetResponse'
          type: array
          readOnly: true
      type: object
      required:
        - buttons
        - source
        - text
        - type
      title: ConversationEventMessagePayloadResponse
    ConversationEventRecommendationPayloadResponse:
      properties:
        type:
          type: string
          const: recommendation
        text:
          type: string
        source:
          $ref: '#/components/schemas/RecommendationSource'
        agent:
          $ref: '#/components/schemas/ConversationAgent'
        trigger_internal_id:
          type: string
        reaction_state:
          oneOf:
            - $ref: '#/components/schemas/MessageReactionState'
            - type: 'null'
        suggested_actions:
          items:
            $ref: '#/components/schemas/SuggestedAction'
          type: array
          default: []
        threads:
          items:
            $ref: '#/components/schemas/ThreadItem'
          type: array
          default: []
        state:
          $ref: '#/components/schemas/RecommendationState'
        suggestion_feedback:
          oneOf:
            - $ref: '#/components/schemas/SuggestionFeedbackInfo'
            - type: 'null'
        related_articles:
          items:
            $ref: '#/components/schemas/RelatedArticle'
          type: array
        tools_used:
          items:
            $ref: '#/components/schemas/ToolUsage'
          type: array
        widgets:
          items:
            oneOf:
              - $ref: '#/components/schemas/LinkWidget'
              - $ref: '#/components/schemas/SendMessageWidget'
              - $ref: '#/components/schemas/OptionWidget'
              - $ref: '#/components/schemas/CopyWidget'
              - $ref: '#/components/schemas/FormWidget'
              - $ref: '#/components/schemas/ApiCallWidget'
              - $ref: '#/components/schemas/DisplayWidget'
              - $ref: '#/components/schemas/HtmlWidgetResponse'
          type: array
        evidence_summary:
          oneOf:
            - type: string
            - type: 'null'
        buttons:
          items:
            oneOf:
              - $ref: '#/components/schemas/LinkWidget'
              - $ref: '#/components/schemas/SendMessageWidget'
              - $ref: '#/components/schemas/OptionWidget'
              - $ref: '#/components/schemas/CopyWidget'
              - $ref: '#/components/schemas/FormWidget'
              - $ref: '#/components/schemas/ApiCallWidget'
              - $ref: '#/components/schemas/DisplayWidget'
              - $ref: '#/components/schemas/HtmlWidgetResponse'
          type: array
          readOnly: true
      type: object
      required:
        - agent
        - buttons
        - state
        - text
        - trigger_internal_id
        - type
      title: ConversationEventRecommendationPayloadResponse
    ConversationEventAssigneeChangePayloadResponse:
      properties:
        old_assignee:
          oneOf:
            - $ref: '#/components/schemas/ConversationAgent'
            - type: 'null'
        new_assignee:
          oneOf:
            - $ref: '#/components/schemas/ConversationAgent'
            - type: 'null'
        type:
          type: string
          const: assignee_change
      type: object
      required:
        - type
      title: ConversationEventAssigneeChangePayloadResponse
    ConversationEventTeamChangePayloadResponse:
      properties:
        old_team:
          oneOf:
            - $ref: '#/components/schemas/ConversationTeam'
            - type: 'null'
        new_team:
          oneOf:
            - $ref: '#/components/schemas/ConversationTeam'
            - type: 'null'
        type:
          type: string
          const: team_change
      type: object
      required:
        - type
      title: ConversationEventTeamChangePayloadResponse
    ConversationEventTicketClosedPayloadResponse:
      properties:
        type:
          type: string
          const: ticket_closed
        feedback_given:
          type: boolean
          default: false
      type: object
      required:
        - type
      title: ConversationEventTicketClosedPayloadResponse
    ConversationEventFormSubmittedPayload:
      properties:
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        ticket_id:
          type: integer
        form_id:
          type: integer
        submitted_form_id:
          type: integer
        data:
          additionalProperties: {}
          type: object
        type:
          type: string
          const: embedded_form_submitted
      type: object
      required:
        - data
        - form_id
        - submitted_form_id
        - ticket_id
        - type
      title: ConversationEventFormSubmittedPayload
    ConversationEventCategoryChangePayloadResponse:
      properties:
        old_category_id:
          oneOf:
            - type: integer
            - type: 'null'
        new_category_id:
          type: integer
        type:
          type: string
          const: category_change
      type: object
      required:
        - new_category_id
        - type
      title: ConversationEventCategoryChangePayloadResponse
    ConversationEventTagsChangedPayloadResponse:
      properties:
        old_tag_ids:
          items:
            type: integer
          type: array
        new_tag_ids:
          items:
            type: integer
          type: array
        type:
          type: string
          const: ticket_tags_changed
      type: object
      required:
        - new_tag_ids
        - old_tag_ids
        - type
      title: ConversationEventTagsChangedPayloadResponse
    ConversationEventSurveySentPayloadResponse:
      properties:
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        rating:
          oneOf:
            - type: integer
            - type: 'null'
        comment:
          oneOf:
            - type: string
            - type: 'null'
        ticket_id:
          type: integer
        type:
          type: string
          const: survey_sent
      type: object
      required:
        - ticket_id
        - type
      title: ConversationEventSurveySentPayloadResponse
    ConversationEventWATemplateSendPayloadResponse:
      properties:
        types:
          additionalProperties: {}
          type: object
        variables:
          additionalProperties:
            type: string
          type: object
        agent:
          oneOf:
            - $ref: '#/components/schemas/ConversationAgent'
            - type: 'null'
        type:
          type: string
          const: wa_template_message
        status:
          oneOf:
            - $ref: '#/components/schemas/ConversationMessageStatus'
            - type: 'null'
      type: object
      required:
        - type
        - types
        - variables
      title: ConversationEventWATemplateSendPayloadResponse
    ConversationEventSnoozeEndPayloadResponse:
      properties:
        type:
          type: string
          const: snooze_end
        assigned_agent_id:
          oneOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - type
      title: ConversationEventSnoozeEndPayloadResponse
    ConversationEventSystemNotificationPayloadResponse:
      properties:
        text:
          type: string
        type:
          type: string
          const: system_notification
      type: object
      required:
        - text
        - type
      title: ConversationEventSystemNotificationPayloadResponse
    ConversationEventErrorMessagePayloadResponse:
      properties:
        text:
          type: string
        error_code:
          oneOf:
            - type: string
            - type: 'null'
        type:
          type: string
          const: error_message
      type: object
      required:
        - text
        - type
      title: ConversationEventErrorMessagePayloadResponse
    WidgetSendMessagePayloadResponse:
      properties:
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        widget_event_id:
          type: string
        widget_id:
          type: string
        message_text:
          type: string
        silent:
          type: boolean
          default: false
        type:
          type: string
          const: widget_send_message
      type: object
      required:
        - message_text
        - type
        - widget_event_id
        - widget_id
      title: WidgetSendMessagePayloadResponse
    WidgetFormSubmittedPayloadResponse:
      properties:
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        widget_event_id:
          type: string
        widget_id:
          type: string
        form_data:
          additionalProperties: {}
          type: object
        http_tool:
          oneOf:
            - type: string
            - type: 'null'
        status:
          oneOf:
            - type: string
            - type: 'null'
        error_text:
          oneOf:
            - type: string
            - type: 'null'
        result_summary:
          oneOf:
            - type: string
            - type: 'null'
        tool_results:
          oneOf:
            - items:
                type: object
              type: array
            - type: 'null'
        type:
          type: string
          const: widget_form_submitted
      type: object
      required:
        - form_data
        - type
        - widget_event_id
        - widget_id
      title: WidgetFormSubmittedPayloadResponse
    WidgetApiCallPayloadResponse:
      properties:
        widget_event_id:
          type: string
        widget_id:
          type: string
        http_tool:
          type: string
        payload:
          additionalProperties: {}
          type: object
        status:
          oneOf:
            - type: string
            - type: 'null'
        error_text:
          oneOf:
            - type: string
            - type: 'null'
        result_summary:
          oneOf:
            - type: string
            - type: 'null'
        tool_results:
          oneOf:
            - items:
                type: object
              type: array
            - type: 'null'
        type:
          type: string
          const: widget_api_call
      type: object
      required:
        - http_tool
        - type
        - widget_event_id
        - widget_id
      title: WidgetApiCallPayloadResponse
    WidgetHtmlActionPayloadResponse:
      properties:
        pii_redaction:
          oneOf:
            - $ref: '#/components/schemas/MessagePiiRedaction'
            - type: 'null'
        widget_event_id:
          type: string
        widget_id:
          type: string
        action:
          type: string
        mode:
          oneOf:
            - type: string
            - type: 'null'
        http_tool:
          oneOf:
            - type: string
            - type: 'null'
        operation:
          oneOf:
            - type: string
            - type: 'null'
        ticket_category:
          oneOf:
            - type: string
            - type: 'null'
        summary:
          oneOf:
            - type: string
            - type: 'null'
        ticket_status:
          oneOf:
            - type: string
            - type: 'null'
        assign_team:
          oneOf:
            - type: string
            - type: 'null'
        effects:
          items:
            additionalProperties: {}
            type: object
          type: array
        follow_up:
          oneOf:
            - additionalProperties: {}
              type: object
            - type: 'null'
        static_params:
          additionalProperties: {}
          type: object
        payload:
          additionalProperties: {}
          type: object
        subject_text:
          oneOf:
            - type: string
            - type: 'null'
        request_id:
          oneOf:
            - type: string
            - type: 'null'
        status:
          oneOf:
            - type: string
            - type: 'null'
        error_text:
          oneOf:
            - type: string
            - type: 'null'
        result_summary:
          oneOf:
            - type: string
            - type: 'null'
        result_data:
          oneOf:
            - additionalProperties: {}
              type: object
            - type: 'null'
        tool_results:
          oneOf:
            - items:
                type: object
              type: array
            - type: 'null'
        original_organization_id:
          oneOf:
            - type: integer
            - type: 'null'
        type:
          type: string
          const: widget_html_action
      type: object
      required:
        - action
        - type
        - widget_event_id
        - widget_id
      title: WidgetHtmlActionPayloadResponse
    ConversationEventArticleUpdatePayloadResponse:
      properties:
        text:
          type: string
        article_id:
          type: integer
        article_title:
          type: string
        article_content:
          type: string
        article_start_index:
          type: integer
        article_conflict_length:
          type: integer
        suggested_text:
          type: string
        replacements:
          items:
            $ref: '#/components/schemas/ArticleReplacementRegion'
          type: array
        content_hash:
          oneOf:
            - type: string
            - type: 'null'
        collection_name:
          oneOf:
            - type: string
            - type: 'null'
        collection_id:
          oneOf:
            - type: string
            - type: 'null'
        accepted:
          type: boolean
          description: >-
            Whether the proposal was applied (gaps) or marked accepted from
            office.
          default: false
        type:
          type: string
          const: article_update
      type: object
      required:
        - article_conflict_length
        - article_content
        - article_id
        - article_start_index
        - article_title
        - suggested_text
        - text
        - type
      title: ConversationEventArticleUpdatePayloadResponse
    ConversationEventArticleCreatePayloadResponse:
      properties:
        text:
          type: string
        article_title:
          type: string
        article_content:
          type: string
        collection_name:
          type: string
        collection_id:
          oneOf:
            - type: string
            - type: 'null'
        context_before:
          oneOf:
            - type: string
            - type: 'null'
        accepted:
          type: boolean
          description: >-
            Whether the proposal was applied (gaps) or marked accepted from
            office.
          default: false
        type:
          type: string
          const: article_create
      type: object
      required:
        - article_content
        - article_title
        - collection_name
        - text
        - type
      title: ConversationEventArticleCreatePayloadResponse
    ConversationEventArticleDeletePayloadResponse:
      properties:
        text:
          type: string
        article_id:
          type: integer
        article_title:
          type: string
        deletion_rationale:
          type: string
        article_content:
          type: string
        content_hash:
          oneOf:
            - type: string
            - type: 'null'
        accepted:
          type: boolean
          description: >-
            Whether the proposal was applied (gaps) or marked accepted from
            office.
          default: false
        collection_name:
          oneOf:
            - type: string
            - type: 'null'
        collection_id:
          oneOf:
            - type: string
            - type: 'null'
        type:
          type: string
          const: article_delete
      type: object
      required:
        - article_content
        - article_id
        - article_title
        - deletion_rationale
        - text
        - type
      title: ConversationEventArticleDeletePayloadResponse
    ConversationEventConfigChangePayloadResponse:
      properties:
        text:
          type: string
        change_type:
          type: string
        operation:
          type: string
          default: set
        suggested_value:
          oneOf:
            - type: string
            - type: 'null'
        current_value:
          oneOf:
            - type: string
            - type: 'null'
        target_ai_agent_key:
          type: string
        accepted:
          type: boolean
          description: >-
            Whether the proposal was applied (gaps) or marked accepted from
            office.
          default: false
        type:
          type: string
          const: config_change
      type: object
      required:
        - change_type
        - target_ai_agent_key
        - text
        - type
      title: ConversationEventConfigChangePayloadResponse
    ConversationMessageStatus:
      type: string
      enum:
        - sending
        - delivered
        - sent
        - failed
        - read
      title: ConversationMessageStatus
    BriefKeyFact:
      properties:
        label:
          type: string
          default: ''
        value:
          type: string
          default: ''
      type: object
      required: []
      title: BriefKeyFact
    BriefCustomer:
      properties:
        name:
          oneOf:
            - type: string
            - type: 'null'
        phone:
          oneOf:
            - type: string
            - type: 'null'
        email:
          oneOf:
            - type: string
            - type: 'null'
        customer_id:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required: []
      title: BriefCustomer
    BriefSource:
      properties:
        channel:
          oneOf:
            - type: string
            - type: 'null'
        agent_name:
          oneOf:
            - type: string
            - type: 'null'
        voice_conversation_id:
          oneOf:
            - type: string
            - type: 'null'
        ab_ticket_id:
          oneOf:
            - type: string
            - type: 'null'
        link:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required: []
      title: BriefSource
    TicketStatusState:
      type: string
      enum:
        - open
        - closed
      title: TicketStatusState
      default: open
    ConversationEventSource:
      type: string
      enum:
        - customer
        - agent
        - ai
      title: ConversationEventSource
    ConversationAgent:
      properties:
        id:
          type: integer
        first_name:
          type: string
        last_name:
          oneOf:
            - type: string
            - type: 'null'
        avatar_url:
          oneOf:
            - type: string
            - type: 'null'
        organization_id:
          type: integer
        kind:
          $ref: '#/components/schemas/AgentKind'
      type: object
      required:
        - first_name
        - id
        - kind
        - organization_id
      title: ConversationAgent
    AttachmentFileResponse:
      properties:
        id:
          type: integer
        original_url:
          type: string
        thumbnail_url:
          oneOf:
            - type: string
            - type: 'null'
        mime_type:
          type: string
        original_filename:
          type: string
      type: object
      required:
        - id
        - mime_type
        - original_filename
        - original_url
      title: AttachmentFileResponse
    LinkWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: link
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/widgets_domain_LinkWidgetParams'
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: LinkWidget
    SendMessageWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: send_message
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/widgets_domain_SendMessageWidgetParams'
        silent:
          type: boolean
          default: false
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: SendMessageWidget
    OptionWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: option
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/OptionWidgetParams'
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: OptionWidget
    CopyWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: copy
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/widgets_domain_CopyWidgetParams'
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: CopyWidget
    FormWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: form
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/FormWidgetParams'
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: FormWidget
    ApiCallWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: api_call
        label:
          type: string
        style:
          $ref: '#/components/schemas/ButtonStyle'
        params:
          $ref: '#/components/schemas/ApiCallWidgetParams'
      type: object
      required:
        - id
        - label
        - params
        - style
        - type
      title: ApiCallWidget
    DisplayWidget:
      properties:
        id:
          type: string
        type:
          type: string
          const: display
        label:
          oneOf:
            - type: string
            - type: 'null'
        style:
          oneOf:
            - $ref: '#/components/schemas/ButtonStyle'
            - type: 'null'
        params:
          $ref: '#/components/schemas/widgets_domain_DisplayWidgetParams'
      type: object
      required:
        - id
        - params
        - type
      title: DisplayWidget
    HtmlWidgetResponse:
      properties:
        id:
          type: string
        type:
          type: string
          const: html
        label:
          oneOf:
            - type: string
            - type: 'null'
        style:
          oneOf:
            - $ref: '#/components/schemas/ButtonStyle'
            - type: 'null'
        params:
          $ref: '#/components/schemas/HtmlWidgetParamsResponse'
      type: object
      required:
        - id
        - params
        - type
      title: HtmlWidgetResponse
    VoiceCallPayload:
      properties:
        call_id:
          oneOf:
            - type: string
            - type: 'null'
        hangup_reason:
          oneOf:
            - type: string
            - type: 'null'
        duration_seconds:
          oneOf:
            - type: integer
            - type: 'null'
        language:
          oneOf:
            - type: string
            - type: 'null'
        agent_name:
          oneOf:
            - type: string
            - type: 'null'
        summary:
          oneOf:
            - type: string
            - type: 'null'
        handoff_id:
          oneOf:
            - type: string
            - type: 'null'
        handoff_status:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required: []
      title: VoiceCallPayload
    MessagePiiRedaction:
      properties:
        status:
          $ref: '#/components/schemas/PiiRedactionStatus'
        entity_types:
          items:
            type: string
          type: array
        counts:
          additionalProperties:
            type: integer
          type: object
        settings_source:
          $ref: '#/components/schemas/PiiRedactionSettingsSource'
        redact_for_integrations:
          type: boolean
          default: false
        applied_at:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
      type: object
      required:
        - settings_source
        - status
      title: MessagePiiRedaction
    RecommendationSource:
      type: string
      enum:
        - agent
        - autopilot
      title: RecommendationSource
      default: agent
    MessageReactionState:
      type: string
      enum:
        - liked
        - disliked
      title: MessageReactionState
    SuggestedAction:
      properties:
        internal_id:
          oneOf:
            - type: string
            - type: 'null'
        reaction_state:
          oneOf:
            - $ref: '#/components/schemas/MessageReactionState'
            - type: 'null'
        type:
          type: string
        value:
          type: string
        confidence:
          $ref: '#/components/schemas/SuggestedActionConfidence'
        explanation:
          type: string
        suggestion_feedback:
          oneOf:
            - $ref: '#/components/schemas/SuggestionFeedbackInfo'
            - type: 'null'
      type: object
      required:
        - confidence
        - explanation
        - type
        - value
      title: SuggestedAction
    ThreadItem:
      properties:
        event_type:
          type: string
        text:
          type: string
      type: object
      required:
        - event_type
        - text
      title: ThreadItem
    RecommendationState:
      type: string
      enum:
        - is_generating
        - done
        - error
        - stopped
      title: RecommendationState
    SuggestionFeedbackInfo:
      properties:
        comment:
          oneOf:
            - type: string
            - type: 'null'
        type:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required: []
      title: SuggestionFeedbackInfo
    RelatedArticle:
      properties:
        id:
          type: string
        collection_id:
          type: string
        title:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - collection_id
        - id
      title: RelatedArticle
    ToolUsage:
      properties:
        function:
          type: string
        tool:
          oneOf:
            - type: string
            - type: 'null'
        count:
          type: integer
          default: 1
      type: object
      required:
        - function
      title: ToolUsage
    ConversationTeam:
      properties:
        id:
          type: integer
        name:
          type: string
        avatar_url:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - id
        - name
      title: ConversationTeam
    ArticleReplacementRegion:
      properties:
        article_start_index:
          type: integer
        article_conflict_length:
          type: integer
        suggested_text:
          type: string
      type: object
      required:
        - article_conflict_length
        - article_start_index
        - suggested_text
      title: ArticleReplacementRegion
    AgentKind:
      type: string
      enum:
        - human
        - ai
      title: AgentKind
    ButtonStyle:
      type: string
      enum:
        - Primary
        - Secondary
        - Success
        - Warning
      title: ButtonStyle
    widgets_domain_LinkWidgetParams:
      properties:
        url:
          type: string
      type: object
      required:
        - url
      title: LinkWidgetParams
    widgets_domain_SendMessageWidgetParams:
      properties:
        message:
          type: string
      type: object
      required:
        - message
      title: SendMessageWidgetParams
    OptionWidgetParams:
      properties:
        message:
          type: string
      type: object
      required:
        - message
      title: OptionWidgetParams
    widgets_domain_CopyWidgetParams:
      properties:
        text:
          type: string
      type: object
      required:
        - text
      title: CopyWidgetParams
    FormWidgetParams:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/widgets_domain_FormField'
          type: array
        submit_label:
          type: string
          default: Submit
        http_tool:
          oneOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - fields
      title: FormWidgetParams
    ApiCallWidgetParams:
      properties:
        http_tool:
          type: string
        payload:
          additionalProperties: {}
          type: object
      type: object
      required:
        - http_tool
      title: ApiCallWidgetParams
    widgets_domain_DisplayWidgetParams:
      properties:
        kind:
          type: string
        data:
          oneOf:
            - additionalProperties: {}
              type: object
            - type: 'null'
      type: object
      required:
        - kind
      title: DisplayWidgetParams
    HtmlWidgetParamsResponse:
      properties:
        template_key:
          type: string
        props:
          additionalProperties: {}
          type: object
        artifact_id:
          type: integer
          default: 0
        template_version:
          type: integer
          default: 0
        dir:
          $ref: '#/components/schemas/TextDirection'
        title:
          type: string
          default: ''
        display:
          $ref: '#/components/schemas/HtmlWidgetDisplay'
        actions:
          items:
            $ref: '#/components/schemas/HtmlWidgetActionResponse'
          type: array
      type: object
      required:
        - template_key
      title: HtmlWidgetParamsResponse
    PiiRedactionStatus:
      type: string
      enum:
        - not_required
        - pending
        - failed
        - applied
      title: PiiRedactionStatus
    PiiRedactionSettingsSource:
      type: string
      enum:
        - fresh
        - stale
        - unavailable
        - no_org
      title: PiiRedactionSettingsSource
    SuggestedActionConfidence:
      type: string
      enum:
        - high
        - medium
        - low
      title: SuggestedActionConfidence
    widgets_domain_FormField:
      properties:
        field_type:
          type: string
          enum:
            - text
            - radio
            - select
        name:
          type: string
        label:
          type: string
        required:
          type: boolean
          default: false
        placeholder:
          oneOf:
            - type: string
            - type: 'null'
        options:
          oneOf:
            - items:
                $ref: '#/components/schemas/widgets_domain_FormFieldOption'
              type: array
            - type: 'null'
      type: object
      required:
        - field_type
        - label
        - name
      title: FormField
    TextDirection:
      type: string
      enum:
        - ltr
        - rtl
      title: TextDirection
      default: ltr
    HtmlWidgetDisplay:
      properties:
        fullscreen:
          items:
            $ref: '#/components/schemas/HtmlDisplayMode'
          type: array
        initial:
          $ref: '#/components/schemas/HtmlDisplayMode'
      type: object
      required: []
      title: HtmlWidgetDisplay
    HtmlWidgetActionResponse:
      properties:
        key:
          type: string
        mode:
          $ref: '#/components/schemas/HtmlActionMode'
        label:
          oneOf:
            - type: string
            - type: 'null'
        display_after:
          oneOf:
            - $ref: '#/components/schemas/HtmlDisplayMode'
            - type: 'null'
      type: object
      required:
        - key
        - mode
      title: HtmlWidgetActionResponse
    widgets_domain_FormFieldOption:
      properties:
        value:
          type: string
        label:
          type: string
      type: object
      required:
        - label
        - value
      title: FormFieldOption
    HtmlDisplayMode:
      type: string
      enum:
        - inline
        - chat
        - host
      title: HtmlDisplayMode
      default: inline
    HtmlActionMode:
      type: string
      enum:
        - tool
        - agent
        - platform
      title: HtmlActionMode
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: >-
        Your organization API key (it starts with `anek_org_`). The same key
        works on the Voice API and the Support API. See
        [Authentication](/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.