WhatsApp Gateway
API referenceChats

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.

PUT
/api/v1/sessions/{session}/chats/{cid}/presence

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 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.

state?string

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 '{}'
Empty
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}