> ## 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.

# Send a message on a ticket



## OpenAPI

````yaml /api-reference/support-openapi.json post /api/message/send
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/message/send:
    post:
      tags:
        - Messages
      summary: Send a message on a ticket
      operationId: ApiMessageSendSendMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message_schema_SendMessageSchema'
        required: true
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message_schema_SendMessageResponse'
        '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:
    message_schema_SendMessageSchema:
      properties:
        text:
          type: string
        mode:
          $ref: '#/components/schemas/MessageMode'
        ticket_id:
          type: integer
        mentioned_agent_ids:
          oneOf:
            - items:
                type: integer
              type: array
            - type: 'null'
        files:
          items:
            type: integer
          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/HtmlWidget'
          type: array
        email_cc:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
      type: object
      required:
        - mode
        - text
        - ticket_id
      title: SendMessageSchema
    message_schema_SendMessageResponse:
      properties:
        created_at:
          type: string
          format: date-time
        internal_id:
          type: string
        files:
          items:
            $ref: '#/components/schemas/AttachmentFileResponse'
          type: array
      type: object
      required:
        - created_at
        - internal_id
      title: SendMessageResponse
    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
    MessageMode:
      type: string
      enum:
        - message
        - private_note
        - system_notification
      title: MessageMode
    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
    HtmlWidget:
      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/HtmlWidgetParams'
      type: object
      required:
        - id
        - params
        - type
      title: HtmlWidget
    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
    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
    HtmlWidgetParams:
      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/HtmlWidgetAction'
          type: array
      type: object
      required:
        - template_key
      title: HtmlWidgetParams
    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
    HtmlWidgetAction:
      properties:
        key:
          type: string
        mode:
          $ref: '#/components/schemas/HtmlActionMode'
        http_tool:
          oneOf:
            - type: string
            - type: 'null'
        operation:
          oneOf:
            - type: string
            - type: 'null'
        static_params:
          additionalProperties: {}
          type: object
        label:
          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:
            $ref: '#/components/schemas/HtmlActionEffect'
          type: array
        opens_ticket:
          type: boolean
          default: true
        follow_up:
          oneOf:
            - $ref: '#/components/schemas/HtmlFollowUp'
            - type: 'null'
        display_after:
          oneOf:
            - $ref: '#/components/schemas/HtmlDisplayMode'
            - type: 'null'
      type: object
      required:
        - key
        - mode
      title: HtmlWidgetAction
    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
    HtmlActionEffect:
      properties:
        do:
          type: string
      type: object
      required:
        - do
      title: HtmlActionEffect
    HtmlFollowUp:
      properties:
        template_key:
          type: string
        delay_seconds:
          oneOf:
            - type: integer
            - type: 'null'
        on_event:
          oneOf:
            - type: string
            - type: 'null'
        text:
          oneOf:
            - type: string
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
      type: object
      required:
        - template_key
      title: HtmlFollowUp
  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.