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

# /chat/{id}/messages

`GET /chat/{id}/messages`

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
    - `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
      - `number` string, required — Phone Number that will receive the message
      - `countryCode` string — Country code
    - `customFields` CustomFields
      - `key` string, required — Key of the field
      - `value` union, required — Value of the field
        - string
        - number
        - boolean
    - `organization` Organization
      - `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
      - `number` string, required — Phone Number that will receive the message
      - `countryCode` string — Country code
    - `customFields` CustomFields
      - `key` string, required — Key of the field
      - `value` union, required — Value of the field
        - string
        - number
        - boolean
    - `organization` Organization
      - `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.net/octadesk/apis/octadesk-api.md) · [All operations](https://skmtc.net/octadesk/apis/octadesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/octadesk/octadesk-api/revisions/bc5e6dccb979/schema)
