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

# Get ticket messages

> Retrieve chronological chat message history for a specific conversation ticket

Retrieve the full message dialogue history for a given conversation ticket (`inbox_id`). Messages default to ascending chronological order (`asc`) suitable for chat rendering.

***

### Authentication

This endpoint requires Bearer token authentication.

```http theme={null}
Authorization: Bearer <token>
```

| Header          | Type     | Required | Description                                     | Format           |
| :-------------- | :------- | :------- | :---------------------------------------------- | :--------------- |
| `Authorization` | `string` | **Yes**  | Scoped organization API key or Bearer JWT token | `Bearer <token>` |

***

### Path Parameters

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer <token>`.
</ParamField>

<ParamField path="inbox_id" type="string" required>
  Unique UUID identifier of the inbox ticket whose message thread is being requested.
</ParamField>

***

### Query Parameters

<ParamField query="limit" type="integer" default="50">
  Maximum number of messages to retrieve (1 to 100).
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Pagination offset (minimum `0`).
</ParamField>

<ParamField query="order" type="string" default="asc">
  Chronological ordering direction (`asc` or `desc`).
</ParamField>

***

### Response Fields

<ResponseField name="total" type="integer">
  Total number of messages in the ticket conversation thread.
</ResponseField>

<ResponseField name="page" type="integer">
  Calculated page index.
</ResponseField>

<ResponseField name="size" type="integer">
  Count of returned messages in current batch.
</ResponseField>

<ResponseField name="messages" type="object[]">
  Ordered array of message entries.

  <Expandable title="MessageResponse Fields">
    <ResponseField name="id" type="string">
      UUID identifier of the message.
    </ResponseField>

    <ResponseField name="inbox_id" type="string">
      Parent inbox ticket UUID.
    </ResponseField>

    <ResponseField name="whatsapp_message_id" type="string">
      Meta WhatsApp message ID (`wamid...`).
    </ResponseField>

    <ResponseField name="direction" type="string">
      `inbound` or `outbound`.
    </ResponseField>

    <ResponseField name="message_type" type="string">
      Message kind (`text`, `image`, `document`, `audio`, `video`).
    </ResponseField>

    <ResponseField name="body" type="string">
      Message text or media description.
    </ResponseField>

    <ResponseField name="status" type="string">
      State (`sent`, `delivered`, `read`, `failed`).
    </ResponseField>

    <ResponseField name="media_url" type="string">
      Streaming media download URL if file attached.
    </ResponseField>

    <ResponseField name="media_mime_type" type="string">
      MIME content type of attached file.
    </ResponseField>

    <ResponseField name="reactions" type="object">
      Map of sender identifier to emoji reactions.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Message timestamp.
    </ResponseField>
  </Expandable>
</ResponseField>

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.sayvy.ai/api/v1/inbox/messages/e4f3a2b1-9c8d-7e6f-5a4b-3c2d1e0f9a8b?limit=50&order=asc" \
    -H "Authorization: Bearer <token>"
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.sayvy.ai/api/v1/inbox/messages/e4f3a2b1-9c8d-7e6f-5a4b-3c2d1e0f9a8b"
  headers = {
      "Authorization": "Bearer <token>"
  }
  params = {
      "limit": 50,
      "order": "asc"
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.status_code)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.sayvy.ai/api/v1/inbox/messages/e4f3a2b1-9c8d-7e6f-5a4b-3c2d1e0f9a8b?limit=50&order=asc", {
    method: "GET",
    headers: {
      "Authorization": "Bearer <token>"
    }
  });

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "total": 2,
    "page": 1,
    "size": 50,
    "messages": [
      {
        "id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
        "inbox_id": "e4f3a2b1-9c8d-7e6f-5a4b-3c2d1e0f9a8b",
        "organization_id": "e0b973dc-13a8-4c9f-861a-03e5b4b1a8d9",
        "contact_id": "8a7c2b3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
        "whatsapp_message_id": "wamid.HBgLMTE4OTAwOTk5MTE1FQIAERgSRjQ1Q0IzOTk3RTYwRTczMzNCAA==",
        "direction": "inbound",
        "message_type": "text",
        "body": "Hi, could you please confirm the demo time?",
        "status": "read",
        "media_url": null,
        "media_mime_type": null,
        "media_filename": null,
        "context_message_id": null,
        "reactions": null,
        "created_at": "2026-09-07T15:30:15Z",
        "updated_at": "2026-09-07T15:30:16Z"
      },
      {
        "id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
        "inbox_id": "e4f3a2b1-9c8d-7e6f-5a4b-3c2d1e0f9a8b",
        "organization_id": "e0b973dc-13a8-4c9f-861a-03e5b4b1a8d9",
        "contact_id": "8a7c2b3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
        "whatsapp_message_id": "wamid.HBgLMTE4OTAwOTk5MTE1FQIAERgSRjQ1Q0IzOTk3RTYwRTczMzNDBB==",
        "direction": "outbound",
        "message_type": "text",
        "body": "Hello Sarah, your enterprise demonstration has been scheduled for tomorrow at 2 PM.",
        "status": "delivered",
        "media_url": null,
        "media_mime_type": null,
        "media_filename": null,
        "context_message_id": "wamid.HBgLMTE4OTAwOTk5MTE1FQIAERgSRjQ1Q0IzOTk3RTYwRTczMzNCAA==",
        "reactions": {
          "+14155552671": "👍"
        },
        "created_at": "2026-09-07T15:32:00Z",
        "updated_at": "2026-09-07T15:33:10Z"
      }
    ]
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Inbox ticket not found"
  }
  ```
</ResponseExample>
