> ## Documentation Index
> Fetch the complete documentation index at: https://test-8862363a-tembo-docs-commit-attribution-preference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a message

> Create a user message for a session and submit it to the session agent.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public post /v1/messages
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Create a message
      description: Create a user message for a session and submit it to the session agent.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                artifactId:
                  type: string
                  format: uuid
                content:
                  type: string
                  minLength: 1
                  maxLength: 1000000
                mcpServers:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 200
                  maxItems: 100
                pullRequestId:
                  type: string
                  format: uuid
                sessionId:
                  type: string
                  format: uuid
                agentOptions:
                  $ref: '#/components/schemas/AgentOptionsInput'
                deliveryMode:
                  type: string
                  enum:
                    - queue
                    - steer
                richContent:
                  $ref: '#/components/schemas/TipTapDocument'
                  description: >-
                    Optional rich-text representation of the message. Provide
                    the required text content separately.
                slashCommand:
                  type: object
                  properties:
                    command:
                      type: string
                      minLength: 1
                      maxLength: 200
                    arguments:
                      type: string
                      maxLength: 100000
                  required:
                    - command
                  additionalProperties: false
              required:
                - content
                - sessionId
              additionalProperties: false
      responses:
        '201':
          description: Create a message
          content:
            application/json:
              schema:
                type: object
                properties:
                  hotPath:
                    type:
                      - object
                      - 'null'
                    properties:
                      activeProviderTurnId:
                        type:
                          - string
                          - 'null'
                      mode:
                        type: string
                        enum:
                          - started
                          - steered
                          - queued
                      providerSessionId:
                        type:
                          - string
                          - 'null'
                      queuedTurnId:
                        type:
                          - string
                          - 'null'
                      transport:
                        type: string
                    additionalProperties: false
                  job:
                    type:
                      - object
                      - 'null'
                    properties:
                      id:
                        type: string
                        format: uuid
                      task:
                        type: string
                    required:
                      - id
                      - task
                    additionalProperties: false
                  message:
                    type: object
                    properties:
                      artifactId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      content:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                      createdBy:
                        type:
                          - string
                          - 'null'
                      externalAvatarUrl:
                        type:
                          - string
                          - 'null'
                      externalUrl:
                        type:
                          - string
                          - 'null'
                      id:
                        type: string
                        format: uuid
                      parentMessageId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      pullRequestId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                          - system
                      sessionId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      type:
                        type: string
                      updatedAt:
                        type: string
                        format: date-time
                      richContent:
                        oneOf:
                          - $ref: '#/components/schemas/TipTapDocument'
                          - type: 'null'
                        description: >-
                          Rich-text representation of the message, including
                          formatting and mentions. The content field contains
                          its text representation.
                      slashCommand:
                        type:
                          - object
                          - 'null'
                        properties:
                          command:
                            type: string
                            minLength: 1
                            maxLength: 200
                          arguments:
                            type: string
                            maxLength: 100000
                        required:
                          - command
                        additionalProperties: false
                      source:
                        type:
                          - string
                          - 'null'
                        maxLength: 100
                      isQueued:
                        type: boolean
                    required:
                      - artifactId
                      - content
                      - createdAt
                      - createdBy
                      - externalAvatarUrl
                      - externalUrl
                      - id
                      - parentMessageId
                      - pullRequestId
                      - role
                      - sessionId
                      - type
                      - updatedAt
                      - richContent
                      - slashCommand
                      - source
                      - isQueued
                    additionalProperties: false
                  session:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      title:
                        type: string
                    required:
                      - id
                      - title
                    additionalProperties: false
                required:
                  - hotPath
                  - job
                  - message
                  - session
                additionalProperties: false
        '400':
          description: >-
            Invalid request or missing required organization or user
            information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: Creating a message requires credentials associated with a user.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Message or session not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Message operation conflicts with its current state
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Message operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  schemas:
    AgentOptionsInput:
      anyOf:
        - type: object
          properties:
            reasoningLevel:
              type: string
              minLength: 1
              maxLength: 100
            mode:
              type: string
              enum:
                - normal
                - planning
            speed:
              type: string
              enum:
                - normal
                - fast
            goal:
              type: object
              properties:
                enabled:
                  type: boolean
                objective:
                  type: string
                  maxLength: 100000
              additionalProperties: false
          additionalProperties: true
        - $ref: '#/components/schemas/RuntimeAgentOptions'
      description: >-
        Execution settings for the selected agent runtime, including
        provider-specific options.
    TipTapDocument:
      anyOf:
        - $ref: '#/components/schemas/TipTapNode'
        - $ref: '#/components/schemas/CustomDocument'
      description: >-
        Rich-text document containing text, formatting, images, and mentions. A
        document typically has a "doc" root with nested content nodes.
      example:
        type: doc
        content:
          - type: paragraph
            content:
              - type: text
                text: Hello
    RuntimeAgentOptions:
      type: object
      additionalProperties: {}
      description: Runtime-specific execution settings and provider extensions.
    TipTapNode:
      anyOf:
        - oneOf:
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: image
                attrs:
                  $ref: '#/components/schemas/TipTapImageAttributes'
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: mention
                attrs:
                  $ref: '#/components/schemas/TipTapMentionAttributes'
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: heading
                attrs:
                  type: object
                  properties:
                    level:
                      type: integer
                      minimum: 1
                      maximum: 6
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: orderedList
                attrs:
                  type: object
                  properties:
                    start:
                      type: integer
                    type:
                      type:
                        - string
                        - 'null'
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: taskItem
                attrs:
                  type: object
                  properties:
                    checked:
                      type: boolean
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: codeBlock
                attrs:
                  type: object
                  properties:
                    language:
                      type:
                        - string
                        - 'null'
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
        - $ref: '#/components/schemas/TipTapContentNode'
    CustomDocument:
      type: object
      additionalProperties: {}
      description: Rich-text content with custom document properties and node attributes.
    TipTapLinkMark:
      type: object
      properties:
        type:
          type: string
          const: link
        attrs:
          type: object
          properties:
            href:
              type:
                - string
                - 'null'
            target:
              type:
                - string
                - 'null'
            rel:
              type:
                - string
                - 'null'
            class:
              type:
                - string
                - 'null'
            title:
              type:
                - string
                - 'null'
          additionalProperties: {}
      required:
        - type
      additionalProperties: {}
    TipTapMark:
      type: object
      properties:
        type:
          type: string
          minLength: 1
          maxLength: 100
          not:
            enum:
              - link
        attrs:
          $ref: '#/components/schemas/TipTapExtensionAttributes'
      required:
        - type
      additionalProperties: {}
    TipTapImageAttributes:
      type: object
      properties:
        src:
          type:
            - string
            - 'null'
        alt:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
        width:
          type:
            - string
            - 'null'
        data-uploading:
          type:
            - string
            - 'null'
        data-placeholder-id:
          type:
            - string
            - 'null'
        upload-progress:
          type:
            - string
            - 'null'
      additionalProperties: {}
    TipTapMentionAttributes:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
        label:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        mentionSuggestionChar:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          properties:
            integrationType:
              type: string
            codeRepositoryId:
              type: string
            isHeader:
              type: boolean
            argumentHint:
              type: string
            commandName:
              type: string
            source:
              type: string
          additionalProperties: {}
      additionalProperties: {}
    TipTapContentNode:
      type: object
      properties:
        text:
          type: string
          maxLength: 1000000
        marks:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/TipTapLinkMark'
              - $ref: '#/components/schemas/TipTapMark'
          maxItems: 1000
        type:
          type: string
          minLength: 1
          maxLength: 100
          not:
            enum:
              - image
              - mention
              - heading
              - orderedList
              - taskItem
              - codeBlock
        attrs:
          $ref: '#/components/schemas/TipTapExtensionAttributes'
        content:
          type: array
          items:
            $ref: '#/components/schemas/TipTapNode'
          maxItems: 10000
      additionalProperties: {}
    TipTapExtensionAttributes:
      type: object
      additionalProperties: {}
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````