---
title: "/chat/{id}/messages"
method: GET
path: "/chat/{id}/messages"
tags: ["Chat"]
---

# /chat/{id}/messages

`GET /chat/{id}/messages`

## Request

- Base URL: `<<api-url>>` (relative, and the document’s source URL is not known)
- URL: `<<api-url>>/chat/{id}/messages`
- Auth: API key in header `X-API-KEY`

Retrieve all messages by passing a specific chat

## Path parameters

- `id` string, required

## Query parameters

- `page` number
- `limit` number
- `property` string, required
- `direction` 'asc' | 'desc', required

## Headers

- `octa-agent-email` string

## Response `201`

- Message[]
  - `id` string, required: Message identifier
  - `chatId` string, required: Chat identifier
  - `time` string, date-time, required: Message sending date
  - `type` 'public' | 'internal', required: Indicate whether the message is intended for internal or public communication
  - `body` string, required: Message content
  - `readAt` string, date-time: Date the message was read
  - `attachments` Attachment[]: Attachments included in the message
    - `id` string, required: The attachment id
    - `name` string: Name of the attachment sent
    - `url` string: Attachment link in Octadesk files
  - `sentBy` User, required: Information about who sent the message
    - `id` string, required: Person identifier
    - `name` string, required: Person name
    - `email` string, required: Person email
    - `type` string: Person type, if is an agent or a contact
    - `phoneContacts` PhoneContacts: Person phone number
      - `number` string, required: Phone Number that will receive the message
      - `countryCode` string: Country code
    - `customFields` CustomFields: Custom fields
      - `key` string, required: Key of the field
      - `value` union, required: Value of the field
        - string
        - number
        - boolean
    - `organization` Organization: This field refers to the organization to which the contact belongs
      - `id` string, required: Organization ID
      - `name` string, required: Organization name
      - `customField` CustomFields[], required: Organization custom fields
        - `key` string, required: Key of the field
        - `value` union, required: Value of the field
          - string
          - number
          - boolean
  - `status` 'sending' | 'sended' | 'received' | 'read' | 'error' | 'deleted' | 'scheduled' | 'spam', required: Message status
  - `mentions` User[]: Mentions made in the message
    - `id` string, required: Person identifier
    - `name` string, required: Person name
    - `email` string, required: Person email
    - `type` string: Person type, if is an agent or a contact
    - `phoneContacts` PhoneContacts: Person phone number
      - `number` string, required: Phone Number that will receive the message
      - `countryCode` string: Country code
    - `customFields` CustomFields: Custom fields
      - `key` string, required: Key of the field
      - `value` union, required: Value of the field
        - string
        - number
        - boolean
    - `organization` Organization: This field refers to the organization to which the contact belongs
      - `id` string, required: Organization ID
      - `name` string, required: Organization name
      - `customField` CustomFields[], required: Organization custom fields
        - `key` string, required: Key of the field
        - `value` union, required: Value of the field
          - string
          - number
          - boolean
  - `quoted` object: Message that was quoted
  - `externalLink` string: External links sent in the message
  - `errorSource` string: Source of the error (e.g. "meta", "platform") when status is "error"
  - `errorCode` string: Error code returned by the provider (e.g. Meta/WhatsApp) when status is "error"
  - `errorMessage` string: Detailed error message from the provider when status is "error"

---

[API](https://skmtc.dev/octadesk/apis/octadesk-api.md) - [All operations](https://skmtc.dev/octadesk/apis/octadesk-api/llms.txt) - [OpenAPI document](https://skmtc.dev/octadesk/apis/octadesk-api/revisions/cf3224b37a34?raw)
