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

# Get the transcript of a conversation

> Oldest first — the order of a transcript, so it reads the way it was spoken.

Takes `limit` but no `offset`, and that is deliberate rather than an omission: messages live in two different stores depending on how the channel arrived (WhatsApp, Instagram and Messenger come through the provider; the web chat is handled by the agent runtime), and the reply also stitches together rotated threads. There is no single ordering to offset into, so offering one would return wrong pages. Ask for the number of messages you need.



## OpenAPI

````yaml /openapi.json get /v1/conversations/{conversationId}/messages
openapi: 3.1.0
info:
  description: >-
    Trama's REST API. Authenticate with an organization API key, created under
    Settings → Developers, and send it as `Authorization: Bearer <key>` (or in
    the `x-api-key` header).


    Every key is bound to ONE organization: everything this API returns and
    everything it writes stays inside that organization, and no request ever
    names it.


    Errors always come back as `{ "error": { "code", "message" } }`. Branch on
    `code` — it is stable; the `message` text is not.
  title: Trama API
  version: 1.0.0
servers:
  - url: https://api.trama.so
security:
  - bearerAuth: []
  - apiKeyHeader: []
paths:
  /v1/conversations/{conversationId}/messages:
    get:
      tags:
        - Conversations
      summary: Get the transcript of a conversation
      description: >-
        Oldest first — the order of a transcript, so it reads the way it was
        spoken.


        Takes `limit` but no `offset`, and that is deliberate rather than an
        omission: messages live in two different stores depending on how the
        channel arrived (WhatsApp, Instagram and Messenger come through the
        provider; the web chat is handled by the agent runtime), and the reply
        also stitches together rotated threads. There is no single ordering to
        offset into, so offering one would return wrong pages. Ask for the
        number of messages you need.
      parameters:
        - in: path
          name: conversationId
          required: true
          schema:
            type: string
        - description: How many messages to return. Maximum 200.
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: How many messages to return. Maximum 200.
            maximum: 200
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationTranscript'
          description: The transcript.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The request is not valid.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The API key is missing or not valid.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The resource does not exist in this organization.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict with the current state of the resource.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The API key exceeded its request limit. Retry later.
components:
  schemas:
    ConversationTranscript:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ConversationMessage'
          type: array
        total:
          type: integer
      required:
        - data
        - total
      type: object
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
      type: object
    ConversationMessage:
      properties:
        content:
          type: string
        conversationId:
          description: >-
            Which thread this message came from. It matters when the reply
            stitches rotated threads together: without it, two stretches months
            apart read as one continuous chat.
          type: string
        createdAt:
          type: string
        direction:
          example: inbound
          type: string
        id:
          type: string
        messageType:
          type: string
        senderName:
          type:
            - string
            - 'null'
      required:
        - content
        - conversationId
        - createdAt
        - direction
        - id
        - messageType
        - senderName
      type: object
    ApiError:
      properties:
        code:
          description: >-
            A stable, machine-readable code. Branch on this — the `message` text
            may change, the code will not.
          example: CATALOG_PRODUCT_NOT_FOUND
          type: string
        message:
          example: The catalog product does not exist.
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API key
      description: 'The organization API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http
    apiKeyHeader:
      description: The same API key, sent in the `x-api-key` header.
      in: header
      name: x-api-key
      type: apiKey

````