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

# Post a message



## OpenAPI

````yaml /api-reference/openapi.json post /v1/channels/{channelId}/messages
openapi: 3.1.0
info:
  title: Mantle Platform API
  version: 1.0.0-beta.1
  description: >-
    Agents and their change sets, task runs, agent responses, outbound webhooks,
    and bots that post with their own tokens. Most endpoints take a workspace
    API key; bot endpoints take a bot token.
servers:
  - url: https://api.mantle.chat
    description: Production
security: []
tags:
  - name: Agents
  - name: Agent drafts
  - name: Agent change-set mutations
  - name: Agent change sets
  - name: Tasks
  - name: Runs
  - name: Agent responses
    description: >-
      Single-turn private responses using a saved agent. Requires explicit
      invoke/read scopes and workspace pilot enablement. No browser conversation
      or task is created.
  - name: Webhooks
  - name: Bots
paths:
  /v1/channels/{channelId}/messages:
    post:
      tags:
        - Bots
      summary: Post a message
      operationId: bot.postChannelMessage
      parameters:
        - name: channelId
          in: path
          schema:
            type: string
            allOf:
              - pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
                format: uuid
          required: true
        - name: idempotency-key
          in: header
          schema:
            type: string
            allOf:
              - minLength: 1
              - maxLength: 128
              - pattern: ^[A-Za-z0-9._:-]+$
          required: false
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                threadKey:
                  type: string
                replyToMessageId:
                  type: string
                  allOf:
                    - pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
                      format: uuid
                actions:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      label:
                        type: string
                      style:
                        type: string
                    required:
                      - id
                      - label
                    additionalProperties: false
              required:
                - text
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  messageId:
                    type: string
                    allOf:
                      - pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
                        format: uuid
                  duplicate:
                    type: boolean
                  threadRootMessageId:
                    type: string
                    allOf:
                      - pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
                        format: uuid
                required:
                  - messageId
                  - duplicate
                additionalProperties: false
        '400':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - invalid_request
                          - empty_text
                          - text_too_long
                          - invalid_thread_key
                          - too_many_actions
                          - invalid_action
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - anyOf:
                                    - type: number
                                    - type: string
                                      enum:
                                        - NaN
                                    - type: string
                                      enum:
                                        - Infinity
                                    - type: string
                                      enum:
                                        - '-Infinity'
                                - type: string
                                  enum:
                                    - Infinity
                                    - '-Infinity'
                                    - NaN
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        anyOf:
                          - type: string
                            enum:
                              - invalid_token
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - type: number
                                - type: string
                                  enum:
                                    - NaN
                                - type: string
                                  enum:
                                    - Infinity
                                - type: string
                                  enum:
                                    - '-Infinity'
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Error
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            anyOf:
                              - type: string
                                enum:
                                  - not_in_channel
                          message:
                            type: string
                            allOf:
                              - minLength: 1
                              - maxLength: 256
                          requestId:
                            type: string
                            allOf:
                              - minLength: 1
                              - maxLength: 128
                          details:
                            type: object
                            additionalProperties:
                              anyOf:
                                - type: string
                                  allOf:
                                    - maxLength: 256
                                - anyOf:
                                    - anyOf:
                                        - type: number
                                        - type: string
                                          enum:
                                            - NaN
                                        - type: string
                                          enum:
                                            - Infinity
                                        - type: string
                                          enum:
                                            - '-Infinity'
                                    - type: string
                                      enum:
                                        - Infinity
                                        - '-Infinity'
                                        - NaN
                                - type: boolean
                                - type: 'null'
                        required:
                          - code
                          - message
                          - requestId
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - app_paused
                              - insufficient_scope
                              - workspace_not_enabled
                          message:
                            type: string
                            allOf:
                              - minLength: 1
                              - maxLength: 256
                          requestId:
                            type: string
                            allOf:
                              - minLength: 1
                              - maxLength: 128
                          details:
                            type: object
                            additionalProperties:
                              anyOf:
                                - type: string
                                  allOf:
                                    - maxLength: 256
                                - anyOf:
                                    - type: number
                                    - type: string
                                      enum:
                                        - NaN
                                    - type: string
                                      enum:
                                        - Infinity
                                    - type: string
                                      enum:
                                        - '-Infinity'
                                - type: boolean
                                - type: 'null'
                        required:
                          - code
                          - message
                          - requestId
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '404':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - channel_not_found
                          - message_not_found
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - anyOf:
                                    - type: number
                                    - type: string
                                      enum:
                                        - NaN
                                    - type: string
                                      enum:
                                        - Infinity
                                    - type: string
                                      enum:
                                        - '-Infinity'
                                - type: string
                                  enum:
                                    - Infinity
                                    - '-Infinity'
                                    - NaN
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '409':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        anyOf:
                          - type: string
                            enum:
                              - channel_archived
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - anyOf:
                                    - type: number
                                    - type: string
                                      enum:
                                        - NaN
                                    - type: string
                                      enum:
                                        - Infinity
                                    - type: string
                                      enum:
                                        - '-Infinity'
                                - type: string
                                  enum:
                                    - Infinity
                                    - '-Infinity'
                                    - NaN
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '429':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        anyOf:
                          - type: string
                            enum:
                              - rate_limited
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - type: number
                                - type: string
                                  enum:
                                    - NaN
                                - type: string
                                  enum:
                                    - Infinity
                                - type: string
                                  enum:
                                    - '-Infinity'
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        anyOf:
                          - type: string
                            enum:
                              - post_failed
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - anyOf:
                                    - type: number
                                    - type: string
                                      enum:
                                        - NaN
                                    - type: string
                                      enum:
                                        - Infinity
                                    - type: string
                                      enum:
                                        - '-Infinity'
                                - type: string
                                  enum:
                                    - Infinity
                                    - '-Infinity'
                                    - NaN
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '503':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        anyOf:
                          - type: string
                            enum:
                              - service_unavailable
                      message:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 256
                      requestId:
                        type: string
                        allOf:
                          - minLength: 1
                          - maxLength: 128
                      details:
                        type: object
                        additionalProperties:
                          anyOf:
                            - type: string
                              allOf:
                                - maxLength: 256
                            - anyOf:
                                - type: number
                                - type: string
                                  enum:
                                    - NaN
                                - type: string
                                  enum:
                                    - Infinity
                                - type: string
                                  enum:
                                    - '-Infinity'
                            - type: boolean
                            - type: 'null'
                    required:
                      - code
                      - message
                      - requestId
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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