# Get messages

Returns one page of a chat's messages, newest first. page is zero-based and defaults to 0; limit defaults to 1000, which is also its maximum. data.list is the page, data.count is the total, data.currentPage is the page returned and data.hasMore is true when a later page exists. Media URLs are signed and short-lived. Reading a chat marks it read, so its unread counter drops to 0.

Endpoint: GET /v1/messages
Version: 1.0.0
Security: bearerAuth, oauth2

## Security:

  - `bearerAuth` (unknown)
    http bearer API key scopes: inbox.messages:read

  - `oauth2` (unknown)
    oauth2 scopes: inbox.messages:read

## Query parameters:

  - `chatId` (string, required)

  - `page` (integer)
    Zero-based page index. The first page is 0.

  - `limit` (integer)
    Number of messages to return. Maximum 1000.

## Response 200:

  - `200` (unknown)
    One page of the chat's messages, newest first.

## Response 200 fields (application/json):

  - `data` (object, required)

  - `data.list` (array, required)
    The page of messages, newest first.

  - `data.list._id` (string, required)

  - `data.list.id` (string, required)
    The channel's own message id, e.g. a WhatsApp wamid.

  - `data.list.chatId` (string, required)

  - `data.list.source` (string, required)
    Channel the message went through, e.g. whatsappCloudApi.

  - `data.list.fromMe` (boolean, required)
    True for an outbound message.

  - `data.list.timestamp` (string, required)
    ISO 8601.

  - `data.list.type` (string, required)
    text, image, audio, video, document, template, and so on.

  - `data.list.status` (string, required)
    Delivery status, e.g. sent, delivered, read, failed.

  - `data.list.text` (string)

  - `data.list.subject` (string)
    Email only.

  - `data.list.body` (string)
    Email only.

  - `data.list.connectionId` (string)

  - `data.list.connectionName` (string)

  - `data.list.userId` (integer)
    The teammate who sent it, for outbound messages.

  - `data.list.user` (object)

  - `data.list.user.displayName` (string, required)

  - `data.list.user.signedUrl` (string)

  - `data.list.isLocked` (boolean)
    True when the plan or quota hides the content. Only the metadata is returned.

  - `data.list.lockReason` (string)
    Enum: "plan", "quota"

  - `data.list.createdAt` (string)

  - `data.list.updatedAt` (string)

  - `data.count` (integer, required)
    Total messages in the chat within the retention window.

  - `data.currentPage` (integer, required)
    Zero-based index of the page returned.

  - `data.hasMore` (boolean, required)
    True when an older page exists.

  - `data.hasLockedMessages` (boolean)
    Present only when messages older than the retention window exist.

  - `data.retentionDays` (integer)
    The plan's message retention window, in days.

  - `data.sendRestrictions` (object)
    Per-channel sending state for this chat, e.g. whether the WhatsApp 24-hour window is open.

## Response 400:

  - `400` (unknown)
    Bad request or validation failed

## Response 400 fields (application/json):

  - `message` (string, required)
    The first problem, as "field: reason". It is one of the entries in details, not a separate sentence.

  - `details` (object)
    Present on a validation failure.

  - `details.formErrors` (array, required)
    Problems with the request as a whole, which no single field accounts for.

  - `details.fieldErrors` (object, required)
    Field name to the problems with it. A field the endpoint does not accept is listed here under its own name, with "Unrecognized key".

## Response 401:

  - `401` (unknown)
    Unauthorized – missing, invalid, or expired API key (Bearer token required). An expired key returns message "API key expired".

## Response 401 fields (application/json):

  - `message` (string, required)
    e.g. "API key is required", "Invalid API key", or "API key expired"

  - `code` (string)
    Optional code e.g. MISSING_API_KEY when rate limiter runs before valid auth

## Response 403:

  - `403` (unknown)
    Forbidden – insufficient permissions

## Response 403 fields (application/json):

  - `message` (string, required)

## Response 404:

  - `404` (unknown)
    Resource not found (e.g. NOT_FOUND, RECORD_NOT_FOUND, EVENT_NOT_FOUND)

## Response 404 fields (application/json):

  - `message` (string, required)
    e.g. "Resource not found!" or "Record not found!"

## Response 429:

  - `429` (unknown)
    Rate limit exceeded. Each plan has its own allowance per endpoint per 10 seconds: Startup 20, Growth 50, Business 100. Response includes RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and Retry-After headers.

## Response 429 fields (application/json):

  - `code` (string, required)
    Fixed code for rate limit responses
    Enum: "RATE_LIMIT_EXCEEDED"

  - `message` (string, required)
    e.g. "Too many requests, please try again later."

  - `retryAfter` (number)
    Seconds until the rate limit window resets

  - `limit` (object)
    The plan limit that was applied, per endpoint per 10 seconds: Startup 20, Growth 50, Business 100.

  - `limit.points` (number, required)

  - `limit.windowSec` (number, required)

## Response 429 headers (application/json):

  - `RateLimit-Limit` (string)
    Maximum requests allowed in the current window

  - `RateLimit-Remaining` (string)
    Requests remaining in the current window

  - `RateLimit-Reset` (string)
    ISO 8601 timestamp when the rate limit window resets

  - `Retry-After` (string)
    Seconds until the client can retry (when applicable)

## Response 500:

  - `500` (unknown)
    Internal server error. Unhandled errors return a generic message; no stack trace is ever returned.

## Response 500 fields (application/json):

  - `message` (string, required)
    Generic: "Something went wrong", or a safe error message

## Response 400 examples:

  - `A field was out of range` (unknown)

  - `The body carried a field the endpoint does not accept` (unknown)

## Response 401 examples:

  - `Missing API key` (unknown)

  - `Invalid API key` (unknown)

  - `Expired API key` (unknown)

  - `Missing auth when rate limiter runs first` (unknown)

## Response 404 examples:

  - `Generic not found` (unknown)

  - `Record not found` (unknown)

## Response 500 examples:

  - `Generic` (unknown)

  - `Error with message` (unknown)

