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

# List messages

> List organization messages with optional session and thread filters.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public get /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:
    get:
      tags:
        - Messages
      summary: List messages
      description: List organization messages with optional session and thread filters.
      operationId: listMessages
      parameters:
        - in: query
          name: cursor
          schema:
            type: string
            format: uuid
        - in: query
          name: limit
          schema:
            type: string
            default: '50'
        - in: query
          name: sessionId
          schema:
            type: string
            format: uuid
        - in: query
          name: threadId
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: List messages
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      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
                      required:
                        - artifactId
                        - content
                        - createdAt
                        - createdBy
                        - externalAvatarUrl
                        - externalUrl
                        - id
                        - parentMessageId
                        - pullRequestId
                        - role
                        - sessionId
                        - type
                        - updatedAt
                        - richContent
                        - slashCommand
                        - source
                      additionalProperties: false
                  nextCursor:
                    type:
                      - string
                      - 'null'
                    format: uuid
                required:
                  - items
                  - nextCursor
                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
        '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: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const message = await client.messages.list({
              limit: '50',
            });
components:
  schemas:
    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
    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

````