WhatsApp Gateway
API referenceChannels

Mute or unmute a channel

Set this session's notification state for the channel identified by `jid`. The request body is optional. Send `{"mute": true}` to mute, `{"mute": false}` to unmute. If the field is omitted (or the body is empty/absent), the channel is **muted** (the default is `true`). **Not implemented in v1.** This endpoint is wired but **always responds `501` with `not_implemented`** — the mute state is not changed. **Authorization:** requires the `send` capability (`403` `forbidden` otherwise; `401` without a valid principal). **When implemented**, this will be an **idempotent** write that sets (not toggles) the mute state, returning `204` (no content) on success regardless of the prior state. **Errors:** `403` `forbidden` (missing `send`), `404` `not_found` (session or channel unknown), `501` `not_implemented` (current behavior).

POST
/api/v1/sessions/{session}/channels/{jid}:mute

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 (one attached WhatsApp number) whose mute state for this channel is being changed.

jid*string

The channel's WhatsApp JID (a newsletter address, e.g. "120363012345678901@newsletter"). Percent-encode reserved characters such as "@" ("%40") in the path.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

mute?boolean

Whether to mute (true) or unmute (false) the channel. Optional: omit the field (or send an empty/absent body) and the channel is muted (defaults to true).

Response Body

application/json

curl -X POST "https://example.com/api/v1/sessions/01HX.../channels/120363012345678901@newsletter:mute" \  -H "Content-Type: application/json" \  -d '{}'
Empty
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}