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

# Send message



## OpenAPI

````yaml /openapi.json post /api/v1/threads/{threadId}/message
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
  description: Programmatic access to Capy's agent platform.
servers:
  - url: https://api.capy.ai
security:
  - bearerAuth: []
tags:
  - name: automations
  - name: projects
  - name: threads
  - name: captains
  - name: folders
  - name: subagents
  - name: tasks
  - name: messages
  - name: streams
  - name: reviews
  - name: reviewRules
  - name: reviewFilters
  - name: usage
  - name: users
paths:
  /api/v1/threads/{threadId}/message:
    post:
      tags:
        - messages
      summary: Send message
      operationId: messages.send
      parameters:
        - name: threadId
          in: path
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
        required: true
      responses:
        '200':
          description: AdmitReceipt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdmitReceiptEncoded'
        '400':
          description: ModelSelection.Rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelSelection.RejectedEncoded'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_UnauthorizedEncoded'
        '403':
          description: capy/DeviceAccessDenied | capy/Forbidden
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/capy_DeviceAccessDeniedEncoded'
                  - $ref: '#/components/schemas/capy_ForbiddenEncoded'
                  - $ref: '#/components/schemas/capy_ForbiddenEncoded'
        '404':
          description: capy/ThreadNotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ThreadNotFoundEncoded'
        '409':
          description: capy/EditNotAllowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_EditNotAllowedEncoded'
        '429':
          description: capy/RateLimited
          headers:
            retry-after:
              schema:
                type: integer
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_RateLimitedEncoded'
      security:
        - bearerAuth: []
components:
  schemas:
    SendMessageRequest:
      type: object
      properties:
        text:
          type: string
        model:
          $ref: '#/components/schemas/ModelSelection'
        delivery:
          type: string
          enum:
            - queue
            - steer
            - interrupt
        clientKey:
          type: string
          minLength: 1
          maxLength: 64
        editOf:
          type: string
          allOf:
            - minLength: 26
            - maxLength: 26
          description: >-
            Resend one of your earlier messages as a new version. The thread
            resets to that message before the agent reads the new text; the rows
            after it stay stored and can be switched back to.
        switchTo:
          type: string
          allOf:
            - minLength: 26
            - maxLength: 26
          description: >-
            Make this superseded version of an edited message live before the
            send lands, so the message answers on that branch.
        pullRequestAuthor:
          anyOf:
            - type: string
              enum:
                - user
                - capy
            - type: 'null'
          description: >-
            Set the thread's pull request author: `capy` or `user` sets it, null
            clears it back to the Git identity preference, and absent leaves it
            unchanged. It applies when the agent picks this message up, so a
            queued message never changes a pull request opened before it.
      required:
        - text
      additionalProperties: false
    AdmitReceiptEncoded:
      type: object
      properties:
        id:
          type: string
          allOf:
            - minLength: 26
            - maxLength: 26
        deduped:
          type: boolean
      required:
        - id
        - deduped
      additionalProperties: false
    ModelSelection.RejectedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ModelSelection.Rejected
        message:
          type: string
        candidates:
          type: array
          items:
            type: object
            properties:
              entryId:
                type: string
              name:
                type: string
              billingLabel:
                type: string
            required:
              - entryId
              - name
              - billingLabel
            additionalProperties: false
        rejection:
          type: string
          enum:
            - disconnected
            - not_connected
        modelId:
          type: string
        service:
          type: string
          enum:
            - codex
            - copilot
            - supergrok
        health:
          type: object
          properties:
            state:
              type: string
              enum:
                - connected
                - not_connected
                - signed_out
                - disabled
                - usage_exhausted
            kind:
              type: string
              enum:
                - subscription
                - key
            provider:
              type: string
            action:
              type: string
              enum:
                - connect
                - reconnect
                - replace_key
                - enable
            resetsAt:
              type: string
          required:
            - state
            - kind
            - provider
          additionalProperties: false
      required:
        - _tag
        - message
        - candidates
      additionalProperties: false
    capy_UnauthorizedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    capy_DeviceAccessDeniedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/DeviceAccessDenied
        deviceId:
          type: string
        deviceName:
          type: string
        status:
          type: string
          enum:
            - requested
            - denied
            - revoked
            - none
        held:
          type: boolean
      required:
        - _tag
        - deviceId
        - deviceName
        - status
        - held
      additionalProperties: false
    capy_ForbiddenEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Forbidden
      required:
        - _tag
      additionalProperties: false
    capy_ThreadNotFoundEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/ThreadNotFound
        threadId:
          type: string
      required:
        - _tag
        - threadId
      additionalProperties: false
    capy_EditNotAllowedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/EditNotAllowed
        eventId:
          type: string
          allOf:
            - minLength: 26
            - maxLength: 26
        reason:
          type: string
          enum:
            - not_settled
            - not_author
            - inherited
            - not_version
            - live
      required:
        - _tag
        - eventId
        - reason
      additionalProperties: false
    capy_RateLimitedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/RateLimited
        retryAfterSeconds:
          type: integer
      required:
        - _tag
        - retryAfterSeconds
      additionalProperties: false
    ModelSelection:
      type: object
      properties:
        modelId:
          type: string
        reasoningMode:
          type: string
          enum:
            - none
            - instant
            - minimal
            - low
            - medium
            - high
            - xhigh
            - max
        modes:
          type: object
          properties:
            fast:
              type: boolean
            pro:
              type: boolean
            ultrafast:
              type: boolean
          additionalProperties: false
      required:
        - modelId
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Capy API key
      description: An API key created in Capy under Settings → API.

````

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