Set chat presence (typing/recording)
Broadcasts a typing/recording presence indicator to the chat in the path (`cid`). Set `state` to `composing` ("typing…"), `recording` ("recording audio…"), or `paused` (clear the indicator). **Live client required:** this goes straight to WhatsApp and needs a live, connected client for the session. If the session has no connected client, the call returns **501 `not_implemented`**. On success returns **204 No Content** with no body. The indicator is transient — WhatsApp clears it after a short timeout, so re-send periodically to keep it showing. Requires the `send` capability. **Errors** - `validation_error` (400/422): `state` is missing or not one of the allowed values. - `not_found` (404): the session does not exist or is not owned by the caller's organization. - `not_implemented` (501): the session has no connected WhatsApp client to deliver the presence. - `forbidden` (403): the caller lacks the `send` capability.
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
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.
The chat's JID to send the presence indicator to. Format is 123...@s.whatsapp.net for a direct chat or 123...@g.us for a group.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The presence state to broadcast to the chat. One of: composing — show a "typing…" indicator; recording — show a "recording audio…" indicator; paused — clear an active typing/recording indicator. Required.
Value in
- "composing"
- "paused"
- "recording"
Response Body
application/json
curl -X PUT "https://example.com/api/v1/sessions/01HF.../chats/6281234567890@s.whatsapp.net/presence" \ -H "Content-Type: application/json" \ -d '{}'{ "error": { "code": "not_found", "details": { "property1": null, "property2": null }, "message": "session not found" }}List chat messages GET
Returns a page of messages in the chat named by `cid`, served from the gateway's **stored copy** (the message history the gateway has ingested), newest first. Page through results with `limit` and `cursor`: send the `nextCursor` from the previous response back as `cursor` to fetch the next (older) page. When `nextCursor` is `null` there are no more messages. 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. - `forbidden` (403): the caller lacks the `read` capability.
Mark a chat as read POST
Clears the unread counter on the chat in the path (`cid`) and returns the updated chat. This updates the **gateway's own unread state** — the value the chat viewer reads — and does **not** send per-message read receipts to WhatsApp. **Idempotent:** calling it again on an already-read chat is a no-op and returns the same chat. Requires the `send` 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. - `forbidden` (403): the caller lacks the `send` capability.