WhatsApp Gateway
API referenceChats

Get a chat

Returns one chat by its id (`cid`, the chat JID), served from the gateway's **stored copy**. Use this to read a single chat's archive/pin/mute flags and unread count. Requires the `read` capability. **Errors** - `not_found` (404): the session does not exist, is not owned by the caller's organization, or no chat with that `cid` is stored for the session. - `forbidden` (403): the caller lacks the `read` capability.

GET
/api/v1/sessions/{session}/chats/{cid}

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The router accepts two kinds of token and tries each in turn: a frontend-minted login JWT (verified against the frontend JWKS; the person's org + role are read from it), or an api-key for a script/service (carrying a fixed set of gateway permissions). The bearerFormat: JWT label describes the person-login case.

In: header

Path Parameters

session*string

The WhatsApp session id (a session is one attached WhatsApp number). The session must be owned by the caller's organization or the request fails with not_found.

cid*string

The chat's JID (Jabber ID) — WhatsApp's address for a conversation. Format is 123...@s.whatsapp.net for a direct chat or 123...@g.us for a group.

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/sessions/01HF.../chats/6281234567890@s.whatsapp.net"
{  "archived": false,  "id": 3344,  "jid": "6281234567890@s.whatsapp.net",  "lastMessageAt": 1719662400000,  "mutedUntil": 1751198400000,  "name": "Alice",  "pinned": false,  "sessionId": "01J9ZX8K2QHV0M3T6R7P4N5W8C",  "type": "dm",  "unreadCount": 3}
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}