Referência

Referência da API

Todas as 161 operações que a sua chave de API alcança, geradas da especificação OpenAPI do serviço (versão 0.32.1). Toda chamada leva o cabeçalho X-API-Key. Campos marcados com * são obrigatórios. As descrições técnicas vêm da especificação, em inglês; os guias ao lado explicam cada tarefa em português.

Sessões (números conectados)

POST /api/sessionsCreate a new WhatsApp session

An admin key with no session restriction creates any session. An operator key with a `sessionQuota` creates up to that many, and each one is added to its `allowedSessions`, so only that key (and an admin) sees it. Any other key is refused.

Corpo (application/json)

Campo Tipo Descrição
name * string Unique name for the session (alphanumeric and hyphens only)
ex.: "my-bot"
config object Session configuration. Only four keys are read: autoRejectCalls (boolean, default false, Baileys engine only) rejects incoming calls as soon as they ring, and the call.received event is still emitted first; maxReconnectAttempts (0-20, default unlimited) caps consecutive reconnects (the count restarts once the session has stayed READY for 5 minutes); reconnectBaseDelay (1000-300000 ms, default 5000
ex.: {"autoRejectCalls":false,"maxReconnectAttempts":5,"reconnectBaseDelay":5000}
proxyUrl string Optional per-session egress proxy URL (http/https/socks4/socks5; credentialed form "http://user:pass@host" allowed). Must be a REAL, REACHABLE proxy — an unreachable value silently blocks the WhatsApp WebSocket (no QR is ever delivered). On whatsapp-web.js the session start then times out (~30s → 504 Gateway Timeout); on Baileys the start succeeds and the session keeps retrying the connection. Lea
proxyType "http" | "https" | "socks4" | "socks5" Deprecated and ignored: the proxyUrl scheme selects the proxy protocol. Accepted for compatibility.

Respostas

  • 201 Session created
  • 400 Validation failed, the body carries a field the DTO does not declare, or `config` is over 16384 bytes serialised as JSON.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 Key lacks the OPERATOR role, is restricted to specific sessions without a sessionQuota, reached its sessionQuota, or set proxyUrl without the ADMIN role. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 Session name already exists
  • 503 On SQLite, another database transaction stayed open for 10 s; nothing was stored, so retry.
GET /api/sessionsList all sessions

Parâmetros

Campo Onde Tipo Descrição
limit query integer Max sessions to return (1-1000, default 1000)
offset query integer Number of sessions to skip (for paging)
name query string Return only the session with exactly this name (case-sensitive); no match returns an empty array. An empty value or a repeated key is rejected with 400.

Respostas

  • 200 List of sessions
  • 400 `name` is empty or repeated.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/sessions/{sessionId}Get session by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Session details
  • 400 The session id has characters other than letters, digits and hyphens, or is longer than 128 characters
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
DELETE /api/sessions/{sessionId}Delete a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 204 Session deleted
  • 400 The session id has characters other than letters, digits and hyphens, or is longer than 128 characters
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 A credential teardown for the same session name is still in flight (retryable: the body carries `code: 'SESSION_NAME_TEARDOWN_PENDING'`; wait for it to settle and retry), OR another node currently holds this session's live engine and deleting it here would strip a session the owner is running, OR ow
  • 503 The session could not be read, checked, claimed or recorded for the delete because the database did not answer (nothing is deleted; a delete whose record the database did not confirm may have been recorded, and repeating it is safe), or, on SQLite, another database transaction stayed open for 10 s b
GET /api/sessions/{sessionId}/configGet the tunable configuration for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Effective session configuration
  • 400 The session id has characters other than letters, digits and hyphens, or is longer than 128 characters
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
PATCH /api/sessions/{sessionId}/configUpdate the tunable configuration for a session

Merges the supplied keys into the session config; omitted keys are left unchanged and an explicit null clears a key back to its default. No restart is required or performed. `autoRejectCalls` is re-read on every incoming call and `linkPreview` on every `send-text` or `send-template`, so both apply immediately; the two reconnect settings are read once per start and therefore apply on the next start.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
autoRejectCalls boolean Auto-reject every incoming call as soon as it rings. Baileys engine only: whatsapp-web.js cannot reject a call. The call.received event is still emitted first, so a webhook consumer sees the call regardless. Takes effect on the next incoming call, and the session is not restarted.
ex.: true
maxReconnectAttempts integer Cap on consecutive reconnect attempts (`0` disables reconnect entirely). Send `null` for unlimited, which is the default. Applies on the next session start, not to a reconnect sequence already in flight. Bounds the gateway's own reconnect, which is every reconnect on whatsapp-web.js and, on Baileys, only the one after a logged-out close: the Baileys engine retries a transient drop itself, with a f
ex.: 5
reconnectBaseDelay integer Base delay of the reconnect backoff in milliseconds. Applies on the next session start, not to a reconnect sequence already in flight. Same engine scope as `maxReconnectAttempts`: the Baileys engine's internal retry uses its own fixed backoff instead.
ex.: 5000
linkPreview boolean Link preview for a send-text or send-template that sets neither `linkPreview` nor `customLinkPreview`; a value in the request always wins. `false` sends without a preview on both engines. `true` asks for one: on whatsapp-web.js that is already the default, on Baileys it makes the gateway fetch the page before every such send. Send `null` to go back to the engine's default. Takes effect from the ne
ex.: false

Respostas

  • 200 Updated session configuration
  • 400 A supplied value is outside its accepted range
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session config kept changing under concurrent requests; retry
POST /api/sessions/{sessionId}/startStart a session and initialize WhatsApp connection

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Session started
  • 400 Session already started or already starting, or this node is at its MAX_CONCURRENT_SESSIONS cap (`Maximum concurrent sessions reached (N)`), answered only after the 404 and the 409 for a session running on another node; a start refused at the cap launches nothing and leaves a stop in place.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 A credential teardown for the same session name is still in flight (e.g. a prior logout that owns destructive cleanup). Retryable — the body carries `code: SESSION_NAME_TEARDOWN_PENDING`; wait for it to settle and retry. No destructive side effect runs before this refusal. Also returned when another
  • 503 The gateway is shutting down, the session could not be checked (the database could not serve the read) or claimed for this node (nothing was launched), or the engine's browser or socket connection died during launch and the one automatic retry failed too (no engine is left running); the start can be
  • 504 The engine did not finish starting within its timeout (WhatsApp Web or the network unreachable, a stalled browser or resource limit, or, on whatsapp-web.js, an unreachable proxyUrl or the auth timeout); the engine is torn down and the start can be retried.
POST /api/sessions/{sessionId}/stopStop a session and disconnect WhatsApp

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Session stopped
  • 400 The session id has characters other than letters, digits and hyphens, or is longer than 128 characters
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 Another node currently holds this session's live engine (multi-node deployments): stopping it here would report the session down while the owner keeps running it, so the request is refused. Retry against the owning node, or once its lease has lapsed.
  • 502 Session was stopped locally, but the engine teardown did not complete (the graceful disconnect and the force-destroy escalation both failed, so the engine process may still be running). Retryable — the body carries `code: 'SESSION_STOP_INCOMPLETE'`; the status is settled to `disconnected` and no suc
  • 503 The database did not answer the read of the session, the check of whether another node holds it or the write that records the stop, so nothing was stopped. A stop whose record the database did not confirm may have been recorded, and repeating it is safe. Retry the stop.
POST /api/sessions/{sessionId}/logoutLog out of WhatsApp (unlinks this device) and stop the session

Attempts an engine-native unlink of this companion device, then tears the session down locally. `200` means the engine-native unlink operation completed AND the required local credential cleanup completed — for Baileys a valid companion identity, an acknowledged `remove-companion-device` IQ response, and removal of the on-disk auth dir; for whatsapp-web.js the native `Client.logout()` promise settled. `200` is NOT an independent observation that the handset UI no longer shows the linked device. Because a completed unlink wipes the stored credentials, reconnecting after a `200` always requires a fresh QR scan or pairing code.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Unlink operation and required local cleanup completed; session is stopped and `phone` is cleared. Recorded in the audit log as `session_logged_out`.
  • 400 Session is not started (no engine to send through); the row is left untouched
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 Baileys: the session has no linked WhatsApp device (it never linked, its pairing code was never entered, or the phone removed the link), so there is nothing to unlink. It was stopped locally and `phone` is cleared; no success audit is written. Start it to link a device, or delete it, instead of retr
  • 502 Session was stopped locally, but the logout operation is incomplete (no send, no acknowledgement, timeout/transport error, or local-cleanup failure). Retryable — the body carries `code: 'SESSION_LOGOUT_INCOMPLETE'`; `phone` is cleared and no success audit is written. Start the session again and retr
  • 503 The database did not answer the read of the session, so nothing was logged out. Retry the logout.
POST /api/sessions/{sessionId}/force-killForce-kill a stuck session (SIGKILL its wedged engine, then tear it down)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Session force-killed
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 502 Session was stopped locally, but the engine force-kill did not complete (the force-destroy threw or timed out, so the engine process may still be running). The body carries `code: 'SESSION_FORCE_KILL_INCOMPLETE'`; the status is settled to `disconnected` and no success audit is written. Restart the n
  • 503 The database did not answer the read of the session, so nothing was killed. Retry the force-kill.
GET /api/sessions/{sessionId}/qrGet QR code for session authentication

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 QR code data
  • 400 QR code not ready or session already authenticated
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
POST /api/sessions/{sessionId}/pairing-codeRequest an 8-char pairing code to link via phone number (alternative to QR)

On the whatsapp-web.js engine, only request a code for a number you are prepared to re-link. A request for a number that already has a linked session has been observed to end with WhatsApp revoking that device: the linked session logs out, its credentials are deleted and it falls back to `qr_ready`. On that engine a number that is the stored phone of another session of this gateway (the Brazilian, Mexican and Argentine mobile spellings of one number count as the same) is refused with `409` and WhatsApp is not asked; the gateway cannot see a link made on another gateway or only on the phone. Baileys was not affected in the same tests and accepts the request: its sessions are companion devices and may share a number. Link by QR when a session of that number must stay up.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
phoneNumber * string Phone number to link, digits only in international format (country code + number).
ex.: "628123456789"

Respostas

  • 201 Pairing code generated
  • 400 Session not started or already authenticated
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not waiting to be linked: the engine is still connecting, or reconnecting after a drop, so the request never reached WhatsApp. Wait for `status` to read `qr_ready` and retry. Once a code has been accepted the session moves through `authenticating` and `initializing` to `ready` and ans
  • 503 The pairing code could not be generated: the gateway stopped waiting after its attempt budget, usually because WhatsApp Web kept reloading its QR page. The condition is transient and the request is worth retrying; the last attempt's reason is carried in the message. An attempt that timed out may sti
GET /api/sessions/{sessionId}/groupsGet all groups for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
limit query integer Max groups to return (1-1000, default 1000)
offset query integer Number of groups to skip (for paging)

Respostas

  • 200 List of groups the session is a member of
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer the group-list query. Deliberately not reported as an empty list — the engine returns the same empty value for "you are in no groups", and a caller cannot tell those apart from the body. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or
GET /api/sessions/{sessionId}/chatsGet active chats for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
limit query integer Max chats to return (1-1000, default 1000)
offset query integer Number of chats to skip (for paging)

Respostas

  • 200 List of active chats (most recent first)
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Deliberately not reported as an empty list: a page that went away says nothing about the chats.
POST /api/sessions/{sessionId}/chats/readMark a chat as read/seen

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890@c.us)
ex.: "1234567890@c.us"
messageIds string[] Specific message IDs to mark read. Baileys acknowledges individual messages, so without this only the newest received message the engine still holds in memory gets a receipt — a burst leaves its earlier messages unread forever, and a restarted session has no message to acknowledge at all. Callers that persist inbound message IDs should send them here. Ignored by whatsapp-web.js, whose own sendSeen
ex.: ["3EB0C767D26B8A3F1A2B","3EB0C767D26B8A3F1A2C"]

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined to act: the Baileys engine sends the read receipt against the newest message the chat received that it holds in memory, else the newest received one the gateway stored, so a chat with neither (one holding only the account's own sends included)
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/presence/subscribeSubscribe to a chat's presence

Asks WhatsApp to start reporting who is online or typing in this chat. Updates arrive as the `presence.update` webhook and socket event — there is no synchronous answer, because presence cannot be queried from either engine, only received. The subscription belongs to the connection: it does **not** survive a restart or an automatic reconnect, and must be re-issued. Subscribe per chat rather than to everything — WhatsApp emits an update on every transition, so a broad subscription is a firehose. whatsapp-web.js cannot do this at all (it exposes no presence subscribe and emits no presence event) and answers `501`.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890@c.us)
ex.: "1234567890@c.us"

Respostas

  • 200 Subscribed; updates now arrive as presence.update events
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot observe presence (whatsapp-web.js)
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure.
PUT /api/sessions/{sessionId}/presenceSet the account's own global presence (appear online or offline)

Publishes whether this account appears online. WhatsApp routes notifications away from the phone while a linked device announces itself online, so a headless bot that never goes offline suppresses the phone's own alerts — set `available: false` to hand them back. A successful call is remembered for the life of the running engine and re-applied once each time that connection opens, including a Baileys transient reconnect: the socket announces itself on connect (`available` unless `BAILEYS_MARK_ONLINE_ON_CONNECT=false`), which would otherwise replace the caller's choice. The preference is dropped whenever the gateway replaces the engine: stop, restart, reconnect recovery, a watchdog recycle, or a takeover by another node. Re-issue it after `session.status` reports `ready` again. On Baileys, typing, recording and outbound sends do not publish global presence. On Baileys the call fails with 409 when the account push name has not synced yet — the library would otherwise accept the request and send nothing. Supported on both engines.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
available * boolean true = appear online; false = appear offline (hands notifications back to the phone — an always-online linked device suppresses the phone's own alerts)
ex.: false

Respostas

  • 200 Presence published
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 The whatsapp-web.js page connection died, or WhatsApp Web did not answer within the protocol timeout. Nothing was confirmed; setting presence converges when repeated, so a retry is safe.
GET /api/sessions/{sessionId}/presence/{chatId}Read a chat's last reported presence

Serves the most recent report received since the chat was subscribed. Returns `null` when nothing has been reported — either the chat was never subscribed, or nothing has changed since. That is a normal state, not a missing resource, so it is `200` with a null body rather than a `404`. Held in memory and never persisted: presence is short-lived, and answering "typing" from before a restart would be worse than answering nothing.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID as subscribed

Respostas

  • 200 Last reported presence, or null
  • 400 The session id has characters other than letters, digits and hyphens, or is longer than 128 characters
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
POST /api/sessions/{sessionId}/chats/unreadMark a chat as unread

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890@c.us)
ex.: "1234567890@c.us"

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined to act. The Baileys engine keys the mark to the chat's newest message in memory, else the newest stored one, else sends it without one for a chat the session knows; an id it knows no chat for answers `false`, and so does an archived chat with
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
DELETE /api/sessions/{sessionId}/chats/{chatId}/messagesDelete every message in a chat, keeping the chat itself

On success the gateway also removes its stored copies of the chat's messages (rows, inline and archived media, search entries) and emits `message:deleted` for each. Changes made on the phone are not mirrored.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat JID, e.g. 1234567890-123@g.us (URL-encode the '@')

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined to act — an unknown chat, or on the Baileys engine a chat with no message in memory or stored, since the clear is keyed to its last message.
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/chats/archiveArchive or unarchive a chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890-123@g.us)
ex.: "1234567890-123@g.us"
archive * boolean true to archive, false to unarchive.

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined to act. The Baileys engine keys the change to the chat's newest message in memory, else the newest stored one, else sends it without one, which WhatsApp applies as well, for a chat the session knows; an id it knows no chat for answers `false`.
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/chats/muteMute or unmute a chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890-123@g.us)
ex.: "1234567890-123@g.us"
muteUntil * integer Absolute epoch-MILLISECONDS timestamp at which the mute expires, or `null` to unmute now. Required — omitting it is rejected rather than guessed, because the two plausible readings (unmute vs mute forever) are opposites. To mute indefinitely, send a far-future timestamp, no later than 9007199254740991 (Number.MAX_SAFE_INTEGER, the largest integer a JSON number carries exactly). Milliseconds, not s
ex.: 1800000000000

Respostas

  • 200 Returns `{ success: true }`. Unlike the archive route there is no declined outcome: the mute change is not keyed to the chat's last message on either engine, so a chat with no known history mutes like any other.
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also an invalid chatId / muteUntil, a channel id on the whatsapp-web.js engine (a channel is muted through its own route), or a chatId that engine cannot resolve. The Baileys
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/chats/pinPin or unpin a chat at the top of the chat list

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890-123@g.us)
ex.: "1234567890-123@g.us"
pin * boolean true to pin the chat to the top of the list, false to unpin it.

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined, and only a pin can: WhatsApp allows at most three pinned chats and the whatsapp-web.js engine reports the refusal. Unpinning always succeeds, and the Baileys engine always reports success because it cannot observe the cap.
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also a chatId the session cannot resolve. An unknown chat is reported here rather than as `success: false`, which on this route means only that the three-pin cap refused a re
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/chats/deleteDelete a chat from the chat list (e.g. a group you have left)

On success the gateway also removes its stored copies of the chat's messages (rows, inline and archived media, search entries) and emits `message:deleted` for each. Changes made on the phone are not mirrored.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890-123@g.us)
ex.: "1234567890-123@g.us"

Respostas

  • 200 Returns `{ success }`. `false` means the engine declined to act: an unknown chat, or on the Baileys engine a chat with no message in memory or stored, since the delete is keyed to its last message.
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/chats/typingSend a typing/recording presence indicator to a chat (or clear it with 'paused')

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID in the neutral form the gateway returns, on either engine (e.g. 1234567890@c.us)
ex.: "1234567890@c.us"
state * "typing" | "recording" | "paused" Presence to send: 'typing' or 'recording' shows the indicator; 'paused' clears it
ex.: "typing"

Respostas

  • 200 Presence sent
  • 400 Session is not started, or validation failed (an empty chatId, a state other than typing, recording or paused, or a body field the DTO does not declare).
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
GET /api/sessions/stats/overviewGet session statistics for multi-session monitoring

Respostas

  • 200 Session statistics including counts, plus process memory usage for unscoped ADMIN keys
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation

Mensagens

GET /api/sessions/{sessionId}/messagesGet message history for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId query string Filter by chat ID. Required for an API key restricted to selected chats.
from query string Filter by sender. A phone also matches group messages via the author field and any lid that resolves to it.
limit query integer Max messages to return (default 50)
offset query integer Offset for pagination
after query string Keyset cursor: the id of the last message of the previous page. Anchors the window to a row rather than a count, so a message arriving mid-walk cannot shift it. Takes precedence over offset.
inlineMedia query boolean Set false to omit inline media payloads, leaving each row's { omitted, sizeBytes } marker and the media endpoint. The inline-media budget is per response, so a paged walk pulls it afresh on every page; default true.
since query number Inclusive message-time lower bound, Unix epoch milliseconds (not ingestion time).
until query number Exclusive message-time upper bound, Unix epoch milliseconds.
direction query "incoming" | "outgoing"
orderBy query "createdAt" | "timestamp" Newest first. Default createdAt preserves existing ordering; timestamp uses message time and excludes rows without a known timestamp.
type query string Exact stored message type token, e.g. text, image, voice.
messageId query string Exact WhatsApp message reference; remains scoped to the session and chat.

Respostas

  • 200 Message history
  • 400 Invalid message filters or an unknown cursor. With time, direction, type or message-reference filters, the cursor must belong to the same selection.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key is restricted to selected chats and either sent no `chatId` or named a chat outside its allowlist. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
POST /api/sessions/{sessionId}/messages/send-textSend a text message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID (phone@c.us for individual, groupId@g.us for groups)
ex.: "628123456789@c.us"
text * string Text message content
ex.: "Hello from OpenWA!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
linkPreview boolean Controls the URL preview, and the engines differ. On whatsapp-web.js WhatsApp Web builds one by default and `false` suppresses it. On Baileys previews are OPT-IN: `true` asks the gateway to fetch the page and attach one, while unset or `false` sends none — generating a preview is a blocking outbound fetch of the first URL in the text, so it is never done unless asked for. A session can set its own
ex.: false
customLinkPreview Attach a preview you supply yourself, instead of one fetched from the URL. The page at `url` is never fetched, so a preview can be attached even for a URL this server cannot reach; only a `thumbnailUrl`, when given, is. **Baileys only** — whatsapp-web.js takes a boolean and answers `501`. Cannot be combined with `linkPreview: false`, which asks for the opposite.
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Message sent
  • 400 Session not active or invalid request
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The `customLinkPreview` image, as decoded `thumbnailBase64` or as downloaded from `thumbnailUrl`, exceeds 5 MiB (or `MEDIA_DOWNLOAD_MAX_BYTES`, if that is lower).
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 A caller-supplied `customLinkPreview` is not supported by the whatsapp-web.js engine — only Baileys can attach one. The send itself is supported on both; omit the field, or use `linkPreview`. whatsapp-web.js also refuses a send with `quotedMessageId` to a channel (`<id>@newsletter`) or a status or b
  • 503 The session routes its URL fetches through an egress proxy, and the `customLinkPreview.thumbnailUrl` fetch failed or timed out before any response arrived, so nothing was sent. The proxy or the target behind it may be at fault; the gateway cannot tell which. Without a session proxy the same failure
POST /api/sessions/{sessionId}/messages/send-templateRender a stored text template and send it as a text message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID (phone@c.us for individual, groupId@g.us for groups)
ex.: "628123456789@c.us"
templateId string Template ID to render. Provide either templateId or templateName.
ex.: "b1c2d3e4-f5a6-7890-bcde-f01234567890"
templateName string Template name to render. Provide either templateId or templateName.
ex.: "order-confirmation"
vars object Variables substituted into {{placeholder}} tokens in the template
ex.: {"customer":"Alice","orderId":"1234"}
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
linkPreview boolean Controls the URL preview on the rendered body, with the same engine split as send-text: whatsapp-web.js builds one by default and `false` suppresses it, while on Baileys previews are opt-in and only `true` attaches one. Unset, the `linkPreview` of the session config applies when one is set.
ex.: false

Respostas

  • 201 Template rendered and sent
  • 400 Session not active or invalid request
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Template not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/send-imageSend an image message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID
ex.: "628123456789@c.us"
url string Media URL (http/https)
ex.: "https://example.com/image.jpg"
base64 string Base64 encoded media data
mimetype string Media MIME type (required when using base64)
ex.: "image/jpeg"
filename string Filename for the media. Only rendered on document sends — defaults to 'file' when omitted (a URL-based document send on whatsapp-web.js first derives the URL basename)
ex.: "image.jpg"
caption string Caption for the media
ex.: "Check out this image!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Image sent
  • 400 Session not active, invalid request, or a url that answers non-2xx, times out or cannot be reached
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 Sending media to a channel (`<id>@newsletter`) is not supported by the whatsapp-web.js engine — the page method it needs was removed by a WhatsApp Web update. Text to a channel still works. whatsapp-web.js also refuses a send with `quotedMessageId` to a channel (`<id>@newsletter`) or a status or bro
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/messages/send-videoSend a video message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID
ex.: "628123456789@c.us"
url string Media URL (http/https)
ex.: "https://example.com/image.jpg"
base64 string Base64 encoded media data
mimetype string Media MIME type (required when using base64)
ex.: "image/jpeg"
filename string Filename for the media. Only rendered on document sends — defaults to 'file' when omitted (a URL-based document send on whatsapp-web.js first derives the URL basename)
ex.: "image.jpg"
caption string Caption for the media
ex.: "Check out this image!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Video sent
  • 400 Session not active, invalid request, or a url that answers non-2xx, times out or cannot be reached
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 Sending media to a channel (`<id>@newsletter`) is not supported by the whatsapp-web.js engine — the page method it needs was removed by a WhatsApp Web update. Text to a channel still works. whatsapp-web.js also refuses a send with `quotedMessageId` to a channel (`<id>@newsletter`) or a status or bro
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/messages/send-audioSend an audio/voice message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID
ex.: "628123456789@c.us"
url string Media URL (http/https)
ex.: "https://example.com/image.jpg"
base64 string Base64 encoded media data
mimetype string Media MIME type (required when using base64)
ex.: "image/jpeg"
filename string Filename for the media. Only rendered on document sends — defaults to 'file' when omitted (a URL-based document send on whatsapp-web.js first derives the URL basename)
ex.: "image.jpg"
caption string Caption for the media
ex.: "Check out this image!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"
ptt boolean Send as a WhatsApp voice note (PTT — mic bubble + waveform). Provide audio/ogg; codecs=opus bytes for reliable playback; when the mimetype is omitted it defaults to that for voice notes. Expects a JSON boolean. Default false = plain audio file. Only valid on send-audio.

Respostas

  • 201 Audio sent
  • 400 Session not active, invalid request, or a url that answers non-2xx, times out or cannot be reached
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 Sending media to a channel (`<id>@newsletter`) is not supported by the whatsapp-web.js engine — the page method it needs was removed by a WhatsApp Web update. Text to a channel still works. whatsapp-web.js also refuses a send with `quotedMessageId` to a channel (`<id>@newsletter`) or a status or bro
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/messages/send-documentSend a document/file

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID
ex.: "628123456789@c.us"
url string Media URL (http/https)
ex.: "https://example.com/image.jpg"
base64 string Base64 encoded media data
mimetype string Media MIME type (required when using base64)
ex.: "image/jpeg"
filename string Filename for the media. Only rendered on document sends — defaults to 'file' when omitted (a URL-based document send on whatsapp-web.js first derives the URL basename)
ex.: "image.jpg"
caption string Caption for the media
ex.: "Check out this image!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Document sent
  • 400 Session not active, invalid request, or a url that answers non-2xx, times out or cannot be reached
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 Sending media to a channel (`<id>@newsletter`) is not supported by the whatsapp-web.js engine — the page method it needs was removed by a WhatsApp Web update. Text to a channel still works. whatsapp-web.js also refuses a send with `quotedMessageId` to a channel (`<id>@newsletter`) or a status or bro
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/messages/send-locationSend a location message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID (e.g. 628123456789@c.us)
latitude * number
ex.: -6.2088
longitude * number
ex.: 106.8456
description string
address string
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Location sent
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 whatsapp-web.js cannot send a location to a channel (`<id>@newsletter`) or a status or broadcast list (`@broadcast`); nothing is sent.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/send-contactSend a contact card message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string
contactName * string
contactNumber * string
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Contact sent
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 whatsapp-web.js cannot send a contact card to a channel (`<id>@newsletter`) or a status or broadcast list (`@broadcast`); nothing is sent.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/send-stickerSend a sticker message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string WhatsApp chat ID
ex.: "628123456789@c.us"
url string Media URL (http/https)
ex.: "https://example.com/image.jpg"
base64 string Base64 encoded media data
mimetype string Media MIME type (required when using base64)
ex.: "image/jpeg"
filename string Filename for the media. Only rendered on document sends — defaults to 'file' when omitted (a URL-based document send on whatsapp-web.js first derives the URL basename)
ex.: "image.jpg"
caption string Caption for the media
ex.: "Check out this image!"
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Sticker sent
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 Sending media to a channel (`<id>@newsletter`) is not supported by the whatsapp-web.js engine — the page method it needs was removed by a WhatsApp Web update. Text to a channel still works. whatsapp-web.js cannot send a sticker to a status or broadcast list (`@broadcast`) either; nothing is sent.
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/messages/send-pollSend a native WhatsApp poll

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat ID (e.g. 628123456789@c.us or 1203630000@g.us)
name * string Poll question / title
ex.: "Where should we meet?"
options * string[] Options to vote on (WhatsApp allows between 2 and 12)
ex.: ["Park","Beach","Downtown"]
allowMultipleAnswers boolean Allow voters to pick several options (default single choice)
quotedMessageId string Quote an earlier message, turning this send into a reply. The id is engine-specific: whatsapp-web.js matches the serialized message id, Baileys matches the raw message key id and can only quote a message it has already stored. An id that cannot be resolved fails the send rather than delivering it unquoted.
ex.: "true_628123456789@c.us_3EB0ABCD"

Respostas

  • 201 Poll sent
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The `quotedMessageId` could not be resolved: the whatsapp-web.js page does not hold it, or the Baileys store does not (it was never received or sent by this session, or it was evicted or deleted). On whatsapp-web.js a message that resolves but cannot be replied to is sent without the quote.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 whatsapp-web.js cannot send a poll to a status or broadcast list (`@broadcast`), nor one with `quotedMessageId` to a channel (`<id>@newsletter`); nothing is sent.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/replyReply to a message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string
quotedMessageId * string
text * string
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]

Respostas

  • 201 Reply sent
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 whatsapp-web.js cannot send a reply to a channel (`<id>@newsletter`) or a status or broadcast list (`@broadcast`); nothing is sent.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/click-buttonClick a button on a WhatsApp Business prompt (Baileys only)

Sends a structured button/list reply quoted to a previously received prompt. Not a native UI tap, so WhatsApp may reject it or treat it differently. Classic button/template/list prompts are supported; native-flow interactiveMessage replies are unverified. whatsapp-web.js returns 501. URL/call CTA buttons cannot be clicked this way. The prompt must still be in the engine store (a reloaded bubble can render choices from persisted metadata and then 404).

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string WhatsApp id of the business prompt message that offered the buttons.
buttonId * string Stable id of the choice to tap (inbound `buttons[].id`). URL/call CTA buttons cannot be clicked this way.
text string Visible label of the choice. When omitted, resolved from the stored prompt; falls back to buttonId.

Respostas

  • 201 Button reply sent
  • 400 Session not active, prompt is not clickable, buttonId is not among its choices, or recipient unreachable
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/forwardForward a message to another chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
Idempotency-Key header string Optional. Makes the send safe to retry: within 24 hours, a retry with the same key and body replays the first response (marked `Idempotent-Replayed: true`) instead of sending again. 1-255 visible ASCII characters, unique per session. While the first request runs a retry gets 409 `IDEMPOTENCY_KEY_IN_

Corpo (application/json)

Campo Tipo Descrição
fromChatId * string
toChatId * string
messageId * string

Respostas

  • 201 Message forwarded. `messageId` is the forwarded copy's id, or an empty string when the engine could not read it back.
  • 400 Baileys rejects a phone number reported as unregistered. The request was rejected before anything was sent. Among the causes: the recipient could not be addressed — WhatsApp reports no deliverable id for that `chatId`, which is how it says the number is not on WhatsApp — as well as body validation a
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 `IDEMPOTENCY_KEY_REUSED`: the Idempotency-Key was already used with a different route or body.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/reactAdd or remove a reaction to a message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string
emoji * string Emoji to react with. Send an empty string to remove the reaction.

Respostas

  • 200 Reaction added or removed. Send empty emoji to remove reaction.
  • 400 Session not active or invalid request
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
GET /api/sessions/{sessionId}/messages/batch/{batchId}Get batch processing status

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
batchId * path string Batch ID

Respostas

  • 200 Batch status and progress
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The calling key is restricted with `allowedChats`. A batch row has no key owner, so the status cannot be checked against the key's allowlist and a chat-restricted key is refused; use the single-send routes instead. Also returned when the API key's role, session or chat scope, or IP allow-list does n
  • 404 Batch not found
POST /api/sessions/{sessionId}/messages/batch/{batchId}/cancelCancel a running batch

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
batchId * path string Batch ID

Respostas

  • 200 Batch cancelled
  • 400 Batch already completed, cancelled, or failed (terminal statuses are exclusive)
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The calling key is restricted with `allowedChats`. A batch row has no key owner, so the cancel cannot be checked against the key's allowlist and a chat-restricted key is refused. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Batch not found
GET /api/sessions/{sessionId}/messages/{chatId}/historyFetch chat history live from WhatsApp

Reads messages directly from the WhatsApp client for the given chat, bypassing the local DB. Useful for retrieving messages that arrived before the gateway was started.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID (e.g. 1234567890@c.us or groupId@g.us)
limit query integer Max messages to return (default 50)
includeMedia query boolean When true, downloads media (base64) for messages that have it. Slower; default false.
deep query boolean When true, raises the limit ceiling from 100 to 2000 for reaching further back in history (whatsapp-web.js only; loads earlier messages on demand). Forces metadata-only (includeMedia is ignored). Large/slow requests may increase WhatsApp rate-limiting risk; default false.

Respostas

  • 200 Chat history (most recent messages, oldest first)
  • 400 Session not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
GET /api/sessions/{sessionId}/messages/{chatId}/{messageId}/reactionsGet reactions for a specific message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID containing the message
messageId * path string Message ID to get reactions for

Respostas

  • 200 List of reactions with senders
  • 400 Session not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
GET /api/sessions/{sessionId}/messages/{chatId}/{messageId}/receiptsGet delivery and read receipts for a specific message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID containing the message
messageId * path string Full serialized ID of a message this account sent, as the send routes return it

Respostas

  • 200 Message delivery and read receipts with timestamps
  • 400 Session not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The message was received, not sent by this account (only its own messages carry receipts), or the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such message in this chat: the id is not a full serialized message id, WhatsApp Web no longer holds the message, or the message belongs to another chat.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
GET /api/sessions/{sessionId}/messages/{chatId}/{messageId}/mediaDownload a message’s stored media

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID containing the message
messageId * path string WhatsApp message ID whose media to download

Respostas

  • 200 The media bytes — the archived file when one exists, else the inline copy stored on the message row (which is how media sent by this account is served) — as an attachment.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No stored media for this message — it carries no media, media download was disabled or the payload was over the cap when it was stored (size-only marker), it was a URL-based API send (the gateway stores none of those bytes, though on whatsapp-web.js the own-send echo may), or the message is not in t
  • 503 On S3 storage, the gateway already has 50 media downloads open across the status and chat media routes. Retry once the Retry-After header (1 second) has passed.
POST /api/sessions/{sessionId}/messages/deleteDelete a message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string
forEveryone boolean Delete for everyone (default true)

Respostas

  • 200 Message deleted
  • 400 Session not active or invalid request
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/vote-pollCast a vote on a poll

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
pollMessageId * string The poll creation message to vote on.
options * string[] The option TEXTS to select, exactly as they appear on the poll. Replaces the current selection; an empty array clears the vote.

Respostas

  • 200 Vote cast
  • 400 Session not active, the target message is not a poll, or `POLL_OPTION_NOT_FOUND`: none of the option texts match the poll (the body lists `validOptions`). Nothing is sent, so the current vote stays.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Poll not found in the chat’s recent history
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported on the Baileys engine
  • 503 The whatsapp-web.js page connection died mid-request, or WhatsApp Web did not answer within the request budget. The change may or may not have been applied; repeating the request is safe, since it converges on the same state.
POST /api/sessions/{sessionId}/messages/pinPin a message in its chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string
durationSeconds 86400 | 604800 | 2592000 Pin duration in seconds: 86400 (24h), 604800 (7d) or 2592000 (30d). Defaults to 24h.

Respostas

  • 200 Message pinned
  • 400 Session not active, or durationSeconds is not one of 86400 / 604800 / 2592000
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The whatsapp-web.js engine refused the pin (in a group only admins may pin, or the chat is with a contact the account blocked). Also answered when WhatsApp Web reports the send as failed, which its sender says no more about, so a rate limit of the send reads the same. The Baileys engine has no accep
  • 404 Message not found in the chat
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no pin sender this gateway can call. Nothing was sent: the message is not pinned.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/unpinRemove a message’s pin

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string

Respostas

  • 200 Message unpinned
  • 400 Session not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The whatsapp-web.js engine refused the unpin (in a group only admins may unpin, or the chat is with a contact the account blocked). Also answered when WhatsApp Web reports the send as failed, which its sender says no more about, so a rate limit of the send reads the same. The Baileys engine has no a
  • 404 Message not found in the chat
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no pin sender this gateway can call. Nothing was sent: the pin is unchanged.
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/starStar or unstar a message

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string
star * boolean true to star, false to remove the star.

Respostas

  • 200 Instruction delivered. On whatsapp-web.js the engine silently ignores a message it will not star, so this does not guarantee the star is set.
  • 400 Session not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Message not found in the chat
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
POST /api/sessions/{sessionId}/messages/editEdit the text of a message sent by this account

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
chatId * string
messageId * string
body * string New text body for the message
mentions string[] WIDs to @mention (e.g. ["62811@c.us"]). The text/caption must also contain the @<number> token.
ex.: ["628123456789@c.us"]

Respostas

  • 200 Message edited. Both fields describe the edited message, not the edit: `messageId` is its id and `timestamp` the time it was originally sent.
  • 400 Session not active, invalid request, or the send was blocked by a plugin
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the edit. Both engines refuse a message the account did not send and one with no text or caption to edit (a location, sticker, poll, contact card or audio); whatsapp-web.js reads the refusal from the page. Past its own guards the Baileys engine has no acceptance signal and answers
  • 404 Message not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. On Baileys, also when WhatsApp rate-limits the request (code 429: nothing was sent, and a keyed send frees its `Idempotency-Key`), times out a query i
POST /api/sessions/{sessionId}/messages/send-bulkSend messages to multiple recipients (async batch processing)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
batchId string Custom batch ID (auto-generated if not provided)
messages * BulkMessageItemDto[] Array of messages (max 100 per request; exact duplicate entries are collapsed — first occurrence wins)
options Batch processing options

Respostas

  • 202 Batch created and processing started
  • 400 Session not active or invalid request, including a media item whose `url` is not an absolute http(s) URL or carries a user name or password
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 413 An item's decoded base64 media exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A `url` item is fetched after the `202`; one over the cap fails that item in the batch results (`GET /messages/batch/{batchId}`) instead. The whole request is separately bounded by `BODY_SIZE_L
  • 429 Too many bulk batches in progress on this node (BULK_MAX_CONCURRENT_BATCHES); retry shortly
  • 503 The server is shutting down; retry the batch shortly

Webhooks

POST /api/sessions/{sessionId}/webhooksCreate a webhook for the session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
url * string Webhook URL to receive events
ex.: "https://your-server.com/webhook"
events "message.received" | "message.sent" | "message.ack" | "message.receipt" | "message.failed" | "message.revoked" | "message.reaction" | "message.edited" | "status.received" | "session.status" | "session.qr" | "session.authenticated" | "session.disconnected" | "session.reconnect_loop" | "session.restriction" | "presence.update" | "event.response" | "poll.vote" | "group.join" | "group.leave" | "group.update" | "group.join_request" | "call.received" | "call.accepted" | "call.rejected" | "call.missed" | "*"[] Event types to subscribe to. '*' subscribes to all events except `message.receipt`, which must be named explicitly.
ex.: ["message.received","session.status"]
secret string Secret key for HMAC signature verification. Never returned by any webhook route; it is used to compute the `X-OpenWA-Signature: sha256=<hex>` header on every delivery.
ex.: "your-webhook-signing-secret"
headers object Custom headers to include in webhook requests. Names must be unique ignoring case. Never returned by any webhook route. At delivery, `content-type`, `user-agent` and `x-openwa-*` names are stripped so a custom header cannot shadow a system one, and so are the connection-level names the HTTP client owns (`connection`, `content-length`, `expect`, `keep-alive`, `te`, `trailer`, `transfer-encoding`, `
ex.: {"X-Custom-Header":"value"}
filters object Optional smart pre-filter. When set, every condition must match (AND) for the webhook to fire. Omit or null to fire on every subscribed event.
ex.: {"conditions":[{"field":"sender","operator":"is","value":["1234567890@c.us"]},{"field":"body","operator":"contains","value":"invoice"}]}
retryCount integer Total delivery attempts per event, including the first (0 and 1 both mean a single attempt with no retry). An event that exhausts them is recorded in GET /api/webhooks/delivery-failures; the webhook stays active.
ex.: 3

Respostas

  • 201 Webhook created
  • 400 Invalid body, the URL embeds credentials or is blocked by the SSRF policy, its host is outside the key's allowedWebhookHosts (the message lists them) or PRIVACY_WEBHOOK_ALLOWED_HOSTS, or the per-session webhook limit is reached
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
GET /api/sessions/{sessionId}/webhooksList all webhooks for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 List of webhooks
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/sessions/{sessionId}/webhooks/{id}Get a webhook by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Webhook ID

Respostas

  • 200 Webhook details
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Webhook not found
PUT /api/sessions/{sessionId}/webhooks/{id}Update a webhook

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Webhook ID

Corpo (application/json)

Campo Tipo Descrição
url string Webhook URL
events "message.received" | "message.sent" | "message.ack" | "message.receipt" | "message.failed" | "message.revoked" | "message.reaction" | "message.edited" | "status.received" | "session.status" | "session.qr" | "session.authenticated" | "session.disconnected" | "session.reconnect_loop" | "session.restriction" | "presence.update" | "event.response" | "poll.vote" | "group.join" | "group.leave" | "group.update" | "group.join_request" | "call.received" | "call.accepted" | "call.rejected" | "call.missed" | "*"[] Event types to subscribe to. '*' subscribes to all events except `message.receipt`, which must be named explicitly.
secret string Secret key for HMAC signature. At least 16 characters, or an empty string or null to clear it. Never returned by any webhook route.
headers object Custom headers. Replaces the stored map wholesale. Never returned by any webhook route.
ex.: {"X-Custom-Header":"value"}
filters object Optional smart pre-filter. When set, every condition must match (AND) for the webhook to fire. Omit to keep the stored filters; send null or { conditions: [] } to clear them, so the webhook fires on every subscribed event.
ex.: {"conditions":[{"field":"sender","operator":"is","value":["1234567890@c.us"]},{"field":"body","operator":"contains","value":"invoice"}]}
active boolean Enable/disable webhook
retryCount integer Total delivery attempts per event, including the first (0 and 1 both mean a single attempt). Same range the create route enforces.
ex.: 3

Respostas

  • 200 Webhook updated
  • 400 Invalid body, a changed URL embeds credentials or is blocked by the SSRF policy, or the webhook would be active on a host outside the key's allowedWebhookHosts (the message lists them)
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Webhook not found
DELETE /api/sessions/{sessionId}/webhooks/{id}Delete a webhook

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Webhook ID

Respostas

  • 204 Webhook deleted
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Webhook not found
POST /api/sessions/{sessionId}/webhooks/{id}/testTest a webhook by sending a test payload

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Webhook ID

Respostas

  • 200 Test result
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Webhook not found
GET /api/webhooks/delivery-failuresList failed or unsent webhook deliveries, most recent first

Parâmetros

Campo Onde Tipo Descrição
sessionId query string Filter to a single session
limit query integer Max records to return (1-1000, default 1000)
offset query integer Number of records to skip (for paging)

Respostas

  • 200 Deliveries that exhausted their retries (attempts > 0) and deliveries not sent (attempts 0: shed, refused at shutdown, oversize or a preflight failure). A direct delivery that shutdown stops in a retry backoff also records attempts 0, although its earlier attempts were sent. The outbox replays shed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
POST /api/webhooks/delivery-failures/redriveReplay recorded webhook deliveries that still hold their event data

Corpo (application/json)

Campo Tipo Descrição
sessionId string Only rows of this session. Narrows within the calling key's allowedSessions, never past it.
ex.: "my-session"
webhookId string Only rows of this webhook.
ex.: "0a941dac-a965-45e7-b318-74ae8be134f0"
ids string[] Only these failure rows (ids from `GET /webhooks/delivery-failures`).
ex.: ["0a941dac-a965-45e7-b318-74ae8be134f0"]
limit integer Max rows replayed by this call (1-500, default 100).
ex.: 100

Respostas

  • 200 One bounded batch of replayable failure rows (terminal rows recorded while WEBHOOK_FAILURE_PAYLOAD_RETENTION_HOURS > 0), least-retried first, then oldest. Each replay reuses the stored idempotency key, so a receiver that already handled the event can dedup it, and runs the webhook:before hooks again
  • 400 The body is malformed, fails validation, or carries a field the DTO does not declare
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/webhooksList webhooks visible to the calling key (scoped to its allowed sessions)

Parâmetros

Campo Onde Tipo Descrição
limit query integer Max webhooks to return (1-1000, default 1000)
offset query integer Number of webhooks to skip (for paging)

Respostas

  • 200 List of webhooks
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation

Contatos

GET /api/sessions/{sessionId}/contactsGet all contacts for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
limit query integer Max contacts to return (1-1000, default 1000)
offset query integer Number of contacts to skip (for paging)

Respostas

  • 200 List of contacts, windowed by limit/offset. A bare array — there is no envelope.
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 The WhatsApp page died while reading contacts, or WhatsApp Web did not answer within the protocol timeout. Retry shortly.
GET /api/sessions/{sessionId}/contacts/profile-picturesBatch-resolve profile picture URLs for up to 50 contacts

Resolve a chat sidebar in one request to avoid bursts of per-contact HTTP calls. Engine lookups run 5 at a time; per-id failures return null. After a lookup times out, later chunks are skipped and their ids are absent from the response.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
ids query string Comma-separated contact ids (max 50 used)

Respostas

  • 200 Picture URL per requested id
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
GET /api/sessions/{sessionId}/contacts/blockedList the contacts this account has blocked

The read half of the block/unblock endpoints. A bare array of neutral contact ids — ids only, because that is the honest common subset: whatsapp-web.js resolves full contact models but Baileys' blocklist query answers bare jids, and inventing the other fields on one engine would make the two engines claim different things about the same account.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Blocked contact ids
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer the blocklist query — retry shortly
GET /api/sessions/{sessionId}/contacts/{contactId}Get a specific contact by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Respostas

  • 200 Contact details
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Contact not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so the lookup could not reach an answer. Distinct from the `404` above, which asserts the contact does not exist: this one asserts nothing about the contact. Retry once the session is ready
PUT /api/sessions/{sessionId}/contacts/{contactId}Save a contact to the account's addressbook, or edit an existing entry

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Corpo (application/json)

Campo Tipo Descrição
firstName * string The contact's first name.
lastName string The contact's last name. Omit for a single-name contact — WhatsApp allows those.

Respostas

  • 200 Contact saved
  • 400 Session is not started, an invalid body, or a contact id that is not a phone-based individual id
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
DELETE /api/sessions/{sessionId}/contacts/{contactId}Remove a contact from the account's addressbook

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Respostas

  • 200 Contact deleted
  • 400 Session is not started, or a contact id that is not a phone-based individual id
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
GET /api/sessions/{sessionId}/contacts/check/{number}Check if a phone number exists on WhatsApp

Returns whether the number is a registered WhatsApp account and its canonical id. Use this to pre-validate a recipient before sending. Only the digits of `number` are queried, so a `+`, spaces or an `@c.us` suffix are tolerated. Baileys also checks unmapped phone destinations before sending: a number reported as unregistered is rejected with 400. A successful check does not confirm message delivery. Requires an OPERATOR key.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
number * path string Phone number to check (e.g., 628123456789)

Respostas

  • 200 Number existence check result
  • 400 Session is not started, or `number` is an id of another kind (a privacy id, a group or a channel) or holds no digits, so it names no phone number
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer the lookup. Deliberately not reported as `exists: false` — that would be a claim about the number rather than about the query, and this route exists to be trusted before a send.
GET /api/sessions/{sessionId}/contacts/{number}/lidLook up the LID of a phone number

Returns the `<lid>@lid` WhatsApp holds for a phone number, the reverse of `GET /contacts/{contactId}/phone`, without sending a message. A number WhatsApp holds no LID for answers `lid: null`, as does an unregistered one; use `check/{number}` to tell them apart. The gateway stores nothing from the lookup. Both engines may send a query to WhatsApp, so bulk lookups put the linked account at risk. Requires an OPERATOR key.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
number * path string Phone number to look up (e.g., 628123456789)

Respostas

  • 200 The number and its LID, or null
  • 400 Session is not started, or `number` is an id of another kind (a privacy id, a group or a channel) rather than a phone number
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer the lookup. Deliberately not reported as `lid: null`, which says WhatsApp holds no LID for the number. Retry once the session is ready again.
GET /api/sessions/{sessionId}/contacts/{contactId}/profile-pictureGet profile picture URL for a contact

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Respostas

  • 200 Profile picture URL
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer the lookup. Deliberately not reported as `url: null` — that is the same answer a contact with no picture gives, and a caller cannot tell them apart. On Baileys, also answered when WhatsApp rate-limits, times out or fails on its side (code 429, 408 or 5xx); retry after a pause
GET /api/sessions/{sessionId}/contacts/{contactId}/phoneResolve a contact id (e.g. an @lid) to a phone number — best-effort

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID / JID to resolve (e.g., an @lid)

Respostas

  • 200 Resolved phone number (MSISDN digits), or null when the engine cannot map it
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
POST /api/sessions/{sessionId}/contacts/{contactId}/blockBlock a contact

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Respostas

  • 200 Contact blocked
  • 400 Session is not started, or the id does not name an individual. On Baileys also an id the session cannot map between phone and privacy-id form (a `@lid` with no known phone to block, a phone-based id with no known `@lid`). On whatsapp-web.js also a number WhatsApp, asked for it, holds no privacy id f
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
DELETE /api/sessions/{sessionId}/contacts/{contactId}/blockUnblock a contact

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
contactId * path string Contact ID (e.g., 628xxx@c.us)

Respostas

  • 200 Contact unblocked
  • 400 Session is not started, or the id does not name an individual. On Baileys also a phone-based id the session cannot map to its privacy id (`@lid`). On whatsapp-web.js also a number WhatsApp, asked for it, holds no privacy id for.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.

Grupos

POST /api/sessions/{sessionId}/groupsCreate a new group

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
name * string Group subject/name
participants * string[] Participant WhatsApp IDs (e.g. 628123456789@c.us)

Respostas

  • 201 Group created
  • 400 A participant does not name an individual. Pass a phone number, `<phone>@c.us` or `<lid>@lid`; a group id or free text is rejected. With send pacing on, also answered (without `retryAfterSeconds`) when the request names more new contacts than the whole day's cold-reachout allowance; split it into sm
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js reaches a WhatsApp Web internal that no longer exists, so group creation is Baileys-only.
  • 503 WhatsApp rate-limited the create (code 429); nothing was created, so retrying after a pause is safe. A timed-out create is not answered 503, because the group may have been created.
GET /api/sessions/{sessionId}/groups/join-infoPreview a group from its invite code, without joining

Read-only: nothing about the account changes, which is what makes it safe to call on a code from an untrusted source. Supported on both engines. There is no participant LIST — the account is not a member — only a count, and only when WhatsApp discloses one. Fields the engine does not report are omitted rather than defaulted, because whatsapp-web.js returns an untyped object with no guaranteed shape.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
code * query string Group invite code (the part after the invite link)

Respostas

  • 200 What the invite discloses about the group
  • 400 Session not started, or no code supplied
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such invite — invalid, expired or revoked
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to preview an invite with. Nothing was asked of WhatsApp: the invite code is not judged.
  • 503 WhatsApp did not answer within the request budget. Deliberately not folded into the 404 above — a query that never came back is not the same claim as a group that does not exist. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On w
GET /api/sessions/{sessionId}/groups/{groupId}Get detailed group info

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID (e.g., 120363xxx@g.us)

Respostas

  • 200 Group details with participants
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key is restricted to selected chats and this group is outside its allowlist. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Group not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. Deliberately not folded into the 404 above — a query that never came back is not the same claim as a group that does not exist. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
POST /api/sessions/{sessionId}/groups/joinJoin a group via invite code

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
inviteCode * string Group invite code (the token from a https://chat.whatsapp.com/<code> link)

Respostas

  • 200 Joined the group
  • 400 Invalid or expired invite code, or session is not started. Also answered when the group has an admin approve new members: the invite is good and a request to join was sent, but the account has not joined.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to join a group with. Nothing was asked of WhatsApp: the invite code is not judged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
GET /api/sessions/{sessionId}/groups/{groupId}/settingsGet group settings (announce / locked / ephemeral timer / member-add mode)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Group settings
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key is restricted to selected chats and this group is outside its allowlist. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Group not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — nothing could be read. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
PUT /api/sessions/{sessionId}/groups/{groupId}/settingsUpdate group settings (announce / locked / ephemeral timer / member-add mode)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
announce boolean Only admins can send messages (announce group)
locked boolean Only admins can edit group info (locked group)
ephemeralSeconds integer Disappearing-messages timer in seconds; 0 disables. Known values: 86400 (24h), 604800 (7d), 7776000 (90d)
memberAddMode "all" | "admins" Who may add participants: 'all' (any member) or 'admins' (admins only)

Respostas

  • 200 Group settings updated
  • 400 No setting provided, an unknown body field, or an invalid value: `announce` and `locked` take a boolean, `ephemeralSeconds` an integer of 0 or more, `memberAddMode` `all` or `admins`, and `null` is refused. Also answered when the session is not started (no engine is running for it), or the group id
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the change (the account is not a group admin). Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Group not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine does not support a requested setting. On whatsapp-web.js, also answered when the WhatsApp Web build the session runs has no job to apply `announce`, `locked` or `memberAddMode` with: nothing was asked of WhatsApp for that setting.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
POST /api/sessions/{sessionId}/groups/{groupId}/participantsAdd participants to a group

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants * string[] Participant WhatsApp IDs (e.g. 628123456789@c.us)

Respostas

  • 200 Participants processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal is an error)
  • 400 A participant does not name an individual. Pass a phone number, `<phone>@c.us` or `<lid>@lid`; a group id or free text is rejected. With send pacing on, also answered (without `retryAfterSeconds`) when the request names more new contacts than the whole day's cold-reachout allowance; split it into sm
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
DELETE /api/sessions/{sessionId}/groups/{groupId}/participantsRemove participants from a group

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants * string[] Participant WhatsApp IDs (e.g. 628123456789@c.us)

Respostas

  • 200 Participants processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal is an error)
  • 400 A participant does not name an individual. Pass a phone number, `<phone>@c.us` or `<lid>@lid`; a group id or free text is rejected. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
POST /api/sessions/{sessionId}/groups/{groupId}/participants/promotePromote participants to admin

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants * string[] Participant WhatsApp IDs (e.g. 628123456789@c.us)

Respostas

  • 200 Participants processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal is an error)
  • 400 A participant does not name an individual. Pass a phone number, `<phone>@c.us` or `<lid>@lid`; a group id or free text is rejected. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
POST /api/sessions/{sessionId}/groups/{groupId}/participants/demoteDemote participants from admin

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants * string[] Participant WhatsApp IDs (e.g. 628123456789@c.us)

Respostas

  • 200 Participants processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal is an error)
  • 400 A participant does not name an individual. Pass a phone number, `<phone>@c.us` or `<lid>@lid`; a group id or free text is rejected. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
GET /api/sessions/{sessionId}/groups/{groupId}/membership-requestsList pending join requests for a group

The join-approval queue of a group the account administers (join-approval mode on). Admin-only on both engines — a non-admin read is refused. Fields the engine does not report are omitted rather than defaulted.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Pending membership requests
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — retry shortly. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
POST /api/sessions/{sessionId}/groups/{groupId}/membership-requests/approveApprove pending join requests

Approves the named requesters, or EVERY pending request when the body names none. Approving an empty queue is a no-op that returns an empty results list. On whatsapp-web.js the engine pauses 250-500ms between requesters (upstream anti-abuse pacing), so acting on a large queue is a proportionally long request.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants string[] Requester WhatsApp IDs (e.g. 628123456789@c.us). Omit to act on every pending request.

Respostas

  • 200 Requests processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal of NAMED requesters is an error)
  • 400 The body failed validation, or the session is not started (no engine is running for it). Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
POST /api/sessions/{sessionId}/groups/{groupId}/membership-requests/rejectReject pending join requests

Rejects the named requesters, or EVERY pending request when the body names none. Rejecting an empty queue is a no-op that returns an empty results list. On whatsapp-web.js the engine pauses 250-500ms between requesters (upstream anti-abuse pacing), so acting on a large queue is a proportionally long request.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
participants string[] Requester WhatsApp IDs (e.g. 628123456789@c.us). Omit to act on every pending request.

Respostas

  • 200 Requests processed — `results` carries the per-participant outcome (a partial refusal does not fail the batch; a total refusal of NAMED requesters is an error)
  • 400 The body failed validation, or the session is not started (no engine is running for it). Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget, so no per-participant outcome was read at all. Deliberately not folded into the 200 above — a participant WhatsApp turned down is reported inside `results` and is an answer; an update that never came back is not. On Baileys, also answered when Whats
PUT /api/sessions/{sessionId}/groups/{groupId}/subjectChange group name/subject

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
subject * string New group subject/name

Respostas

  • 200 Subject updated
  • 400 The body failed validation, or the session is not started (no engine is running for it). Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the change: editing the group info takes an admin, or any member of a group whose info is not restricted to admins. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to send the change with. Nothing was asked of WhatsApp: the group is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
PUT /api/sessions/{sessionId}/groups/{groupId}/descriptionChange group description

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
description * string New group description (may be empty to clear it)

Respostas

  • 200 Description updated
  • 400 The body failed validation, or the session is not started (no engine is running for it). Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the change: editing the group info takes an admin, or any member of a group whose info is not restricted to admins. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to send the change with. Nothing was asked of WhatsApp: the group is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
PUT /api/sessions/{sessionId}/groups/{groupId}/member-labelSet this account's member label in a group

Sets the per-group label WhatsApp shows beside this account's name in the group; an empty string clears it. Baileys only: whatsapp-web.js has no member-label setter and answers 501.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
label * string This account's label in the group, shown beside its name (may be empty to clear it). Counted in UTF-16 code units, so an emoji outside the Basic Multilingual Plane takes two of the 30.
ex.: "Site A Management"

Respostas

  • 200 The label message was handed to WhatsApp. Baileys sends it to the group as a protocol message with no per-request confirmation, and group metadata does not carry the label, so it cannot be read back.
  • 400 The body failed validation (`label` missing, not a string, or longer than 30 UTF-16 code units), the id does not name a group, or the session is not started (no engine is running for it).
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the group lookup the label message depends on, for example because the account is no longer a member of the group. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js has no member-label setter, so this is Baileys-only.
  • 503 WhatsApp did not answer within the request budget. The label may or may not have been sent; the gateway stopped waiting for the send to finish. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
POST /api/sessions/{sessionId}/groups/{groupId}/leaveLeave a group

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Left the group
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
GET /api/sessions/{sessionId}/groups/{groupId}/pictureGet the group's picture URL

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Picture URL, or null when the group has none
  • 400 The id does not name a group, or the session is not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — nothing could be read. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On Baileys, a WhatsApp server error (5xx) on the lookup also answers 503.
PUT /api/sessions/{sessionId}/groups/{groupId}/pictureSet the group's picture

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Corpo (application/json)

Campo Tipo Descrição
url string Image URL (http/https)
ex.: "https://example.com/group.jpg"
base64 string Base64 encoded image data
mimetype string Image MIME type (required when using base64)
ex.: "image/jpeg"

Respostas

  • 200 Group picture updated
  • 400 The id does not name a group, the session is not active, neither url nor base64 was supplied, the url answers non-2xx, times out or cannot be reached, or the image cannot be read (Baileys refuses an SVG)
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the change: editing the group info takes an admin, or any member of a group whose info is not restricted to admins. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to send the change with. Nothing was asked of WhatsApp: the group is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
DELETE /api/sessions/{sessionId}/groups/{groupId}/pictureRemove the group's picture

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Group picture removed
  • 400 The id does not name a group, or the session is not active
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the change: editing the group info takes an admin, or any member of a group whose info is not restricted to admins. A group with no picture is not refused: WhatsApp accepts the delete and the route answers 200. Also returned when the API key's role, session or chat scope, or IP al
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to remove a group picture with. Nothing was asked of WhatsApp: the picture is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, al
GET /api/sessions/{sessionId}/groups/{groupId}/invite-codeGet group invite code/link

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 Group invite code
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the request — admin rights required for this group. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to read an invite code with. Nothing was asked of WhatsApp.
  • 503 WhatsApp did not answer the invite-code query — retry shortly. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, also when WhatsApp answers the read with a rate limit, a timeout or a server error (408, 423, 429 or
POST /api/sessions/{sessionId}/groups/{groupId}/invite-code/revokeRevoke group invite code and generate new one

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
groupId * path string Group ID

Respostas

  • 200 New invite code generated
  • 400 The session is not started: no engine is running for it (never started, stopped, or logged out). Start the session and retry. Also answered when the group id in the path does not name a group.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused the request — admin rights required for this group. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No such group — the id is unknown.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to reset an invite code. Nothing was asked of WhatsApp: the current code is unchanged.
  • 503 On Baileys, WhatsApp did not answer the invite-code revocation in time, or rate-limited or timed it out (code 429 or 408); retry after a pause. On whatsapp-web.js, only when WhatsApp answers the revoke with a rate limit, a timeout or a server error (408, 423, 429 or 5xx): the current code is unchang

Etiquetas

GET /api/sessions/{sessionId}/labelsGet all labels (WhatsApp Business only)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 List of labels (empty on a personal, non-Business account)
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
GET /api/sessions/{sessionId}/labels/{labelId}Get a specific label by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
labelId * path string Label ID

Respostas

  • 200 Label details
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Label not found
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
PUT /api/sessions/{sessionId}/labels/{labelId}Create or update a label

Baileys only. `PUT` rather than `POST` because the label id is chosen by the caller: WhatsApp carries one `label_edit` write keyed on that id, so whether this creates or updates depends purely on whether the id already exists, and there is no server-assigned id to return. **Choose an unused id to create.** Reusing one silently rewrites that label rather than failing, because the protocol has no create-only form. The write replaces the whole label, so send every field it should keep: an omitted name or colour is not preserved. whatsapp-web.js can read and assign labels but cannot edit one, and answers `501`.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
labelId * path string Label ID — caller-chosen

Corpo (application/json)

Campo Tipo Descrição
name string Label name. The write replaces the whole label, so an omitted name is not preserved.
ex.: "VIP customer"
color integer WhatsApp's colour INDEX (0-19), not a hex value — the read path's `hexColor` cannot be translated back, because neither engine exposes the mapping. An omitted colour is not preserved.
ex.: 3

Respostas

  • 200 Label created or updated
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot edit labels (whatsapp-web.js)
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
DELETE /api/sessions/{sessionId}/labels/{labelId}Delete a label

Baileys only. The label disappears from every chat it was on. whatsapp-web.js cannot edit labels and answers `501`.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
labelId * path string Label ID

Respostas

  • 200 Label deleted
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot edit labels (whatsapp-web.js)
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
GET /api/sessions/{sessionId}/labels/{labelId}/chatsGet every chat carrying a label

whatsapp-web.js only. Baileys exposes label writes but no label query of any kind, so it answers `501`.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
labelId * path string Label ID

Respostas

  • 200 Chats carrying the label
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such label — it was never created, or the account is not a WhatsApp Business one and holds no labels at all. Both are the same answer to the caller.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot list chats by label (Baileys)
  • 503 WhatsApp Web did not answer (the page died or the command timed out), so nothing could be read. Deliberately not reported as a missing label: no answer says nothing about whether the label exists. The other engine never answers this: Baileys has no label query at all and answers 501 above.
GET /api/sessions/{sessionId}/labels/chat/{chatId}Get labels for a specific chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID

Respostas

  • 200 List of labels for the chat
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
  • 503 The whatsapp-web.js page connection died mid-read, or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
POST /api/sessions/{sessionId}/labels/chat/{chatId}Add a label to a chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID

Corpo (application/json)

Campo Tipo Descrição
labelId * string Label ID to add

Respostas

  • 200 Label added to chat
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The chat does not exist on this session, or the account has no label with this id, so nothing was written (whatsapp-web.js)
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 Labels require a WhatsApp Business account, or the chat type has no labels
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
DELETE /api/sessions/{sessionId}/labels/chat/{chatId}/{labelId}Remove a label from a chat

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
chatId * path string Chat ID
labelId * path string Label ID to remove

Respostas

  • 200 Label removed from chat
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 The chat does not exist on this session, so nothing was written (whatsapp-web.js)
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 422 Labels require a WhatsApp Business account, or the chat type has no labels
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.

Canais

GET /api/sessions/{sessionId}/channelsGet all subscribed channels/newsletters

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 List of subscribed channels
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: the Baileys adapter cannot list subscribed channels.
  • 503 On whatsapp-web.js, answered when the page died mid-read or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
POST /api/sessions/{sessionId}/channelsCreate a channel

The account becomes the channel owner, which is what makes deleting it possible later — neither engine can delete a channel it does not own.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
name * string Channel name
ex.: "Product updates"
description string Channel description
ex.: "Release notes and downtime notices"

Respostas

  • 201 The created channel
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused — channel creation may be disabled for this account. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp rate-limited the create (code 429, Baileys); nothing was created, so retrying after a pause is safe. A timed-out create is not answered 503, because the channel may have been created.
GET /api/sessions/{sessionId}/channels/{channelId}Get a specific channel by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID

Respostas

  • 200 Channel details. The Baileys engine reads `createdAt` off the newsletter metadata and the whatsapp-web.js engine never fills it. Neither engine fills `picture`: WhatsApp reports only a media path.
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Channel not found. On the whatsapp-web.js engine this also covers a channel that exists but the account does not follow, because the lookup scans the subscribed-channel list; the Baileys engine resolves any channel by id.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — nothing could be read. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
DELETE /api/sessions/{sessionId}/channels/{channelId}Unsubscribe from a channel

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID to unsubscribe from

Respostas

  • 200 Successfully unsubscribed from channel
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The id is not a channel id (it does not end in `@newsletter`). Retrying the same id cannot succeed.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — the operation may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, also when WhatsApp Web reports a timeout, a rate limit or a server e
GET /api/sessions/{sessionId}/channels/{channelId}/messagesGet messages from a channel

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID
limit query integer Max messages to return (default 50, max 100)

Respostas

  • 200 List of channel messages
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such channel — the id is not among the session's subscribed channels, either because it is wrong or because the channel has not synced into the local collection yet.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: the Baileys adapter cannot read channel messages.
  • 503 On whatsapp-web.js, answered when the page died mid-read or WhatsApp Web did not answer within the protocol timeout, so nothing could be read. Retry shortly.
POST /api/sessions/{sessionId}/channels/{channelId}/deleteDelete a channel this account owns

Irreversible, and every subscriber loses the channel. Deliberately NOT `DELETE /channels/:channelId` — that route unsubscribes, and the two must not be reachable by the same request with a slip of the wrist. Only the owner can delete.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID

Respostas

  • 200 Channel deleted
  • 400 Session not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused — not found, or this account does not own it. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The id is not a channel id (it does not end in `@newsletter`). Retrying the same id cannot succeed.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — the operation may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, also when WhatsApp Web reports a timeout, a rate limit or a server e
POST /api/sessions/{sessionId}/channels/{channelId}/muteMute or unmute a channel

Silences the channel's notifications for this account. The subscription is untouched.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID

Corpo (application/json)

Campo Tipo Descrição
mute * boolean True to mute the channel, false to unmute it. Subscription is unaffected either way.
ex.: true

Respostas

  • 200 Channel muted or unmuted
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The id is not a channel id (it does not end in `@newsletter`). Retrying the same id cannot succeed. On whatsapp-web.js, also answered for a channel id that is not among the session's subscribed channels or has not synced into the local collection yet.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget — the operation may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause. On whatsapp-web.js, also when WhatsApp Web reports a timeout, a rate limit or a server e
POST /api/sessions/{sessionId}/channels/{channelId}/admins/demoteDemote a channel admin back to a subscriber

Requires this account to own the channel. There is no promote counterpart: neither engine library exposes one, so an admin is promoted from the WhatsApp app and demoted here.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID

Corpo (application/json)

Campo Tipo Descrição
userId * string WhatsApp ID of the admin to demote back to a subscriber — a phone number, `<phone>@c.us` or `<lid>@lid`; a bare number is qualified for you. Anything that does not name an individual is rejected with 400 rather than handed to WhatsApp.
ex.: "628123456789@c.us"

Respostas

  • 200 Admin demoted
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine refused — not the owner, or the user is not an admin. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The id is not a channel id (it does not end in `@newsletter`). Retrying the same id cannot succeed.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The whatsapp-web.js engine cannot perform this: the WhatsApp Web module its library method targets no longer exports the function. Use the Baileys engine.
  • 503 WhatsApp did not answer within the request budget — the operation may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
POST /api/sessions/{sessionId}/channels/{channelId}/owner/transferTransfer channel ownership to another account

IRREVERSIBLE. Once the transfer lands, this session is no longer the owner and cannot take the channel back through this API. Requires this account to currently own the channel. The upstream option to also dismiss yourself as an admin in the same call is not exposed, because the WhatsApp Web function it depends on no longer exists and the branch swallows its own errors, so it would fail silently.

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
channelId * path string Channel ID

Corpo (application/json)

Campo Tipo Descrição
newOwnerId * string WhatsApp ID of the account that becomes the new owner — a phone number, `<phone>@c.us` or `<lid>@lid`; a bare number is qualified for you. Anything that does not name an individual is rejected with 400 rather than handed to WhatsApp. This is irreversible: once the transfer lands, this session can no longer take the channel back.
ex.: "628123456789@c.us"

Respostas

  • 200 Ownership transferred
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The engine did not transfer the channel. On whatsapp-web.js this is the only outcome a failure can produce: the page swallows every error into a plain false, so the cause is not reported. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The id is not a channel id (it does not end in `@newsletter`). Retrying the same id cannot succeed.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The whatsapp-web.js engine cannot perform this: its page function rejects every call locally against a subscriber list the page cannot repopulate. Use the Baileys engine.
  • 503 WhatsApp did not answer within the request budget — the transfer may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.
POST /api/sessions/{sessionId}/channels/subscribeSubscribe to a channel using invite code

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
inviteCode * string Channel invite code (from channel link)
ex.: "ABC123xyz"

Respostas

  • 201 Successfully subscribed to channel
  • 400 Session not started, or validation failed
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the operation. The request was well formed — the refusal happened WhatsApp-side, most often because the account lacks the admin rights the operation requires. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 The invite code does not resolve to a channel — it is wrong, expired, or revoked. This route takes an invite code rather than a channel id.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js cannot subscribe by invite code.
  • 503 WhatsApp did not answer within the request budget — the operation may or may not have applied. On Baileys, also answered when WhatsApp rate-limits or times out the request (code 429 or 408); retry after a pause.

Catálogo

GET /api/sessions/{sessionId}/catalogGet business catalog info (Baileys engine only)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Respostas

  • 200 Catalog summary, or an empty body when the account has no collection to describe.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the catalog query. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js has no catalog API.
  • 503 WhatsApp did not answer the catalog query within the request budget, or rate-limited it. For some business accounts WhatsApp never answers it, so a retry may not help.
GET /api/sessions/{sessionId}/catalog/productsList catalog products (Baileys engine only)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string
page query integer Result page (1-based).
limit query integer Page size.

Respostas

  • 200 One page of catalog products
  • 400 A query value is invalid, or the query carries a field the DTO does not declare.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the catalog query. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js has no catalog API.
  • 503 WhatsApp did not answer the catalog query within the request budget, or rate-limited it. For some business accounts WhatsApp never answers it, so a retry may not help.
GET /api/sessions/{sessionId}/catalog/products/{productId}Get a specific product (Baileys engine only)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string
productId * path string

Respostas

  • 200 The product, or an empty body when no product in the catalog carries that id.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the catalog query. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js has no catalog API.
  • 503 WhatsApp did not answer the catalog query within the request budget, or rate-limited it. For some business accounts WhatsApp never answers it, so a retry may not help.
POST /api/sessions/{sessionId}/messages/send-productSend a product message (Baileys engine only)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
chatId * string Chat to send the product card to (@c.us or @g.us).
ex.: "628123456789@c.us"
productId * string Catalog product id to send.
ex.: "product-42"
body string Optional body text accompanying the product card.
ex.: "Back in stock!"

Respostas

  • 201 Product message accepted for sending
  • 400 Recipient reported as unregistered, product has no image, a plugin blocked the send, or a plugin returned an invalid productId or body.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 WhatsApp refused the catalog query. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Product id not found in the session catalog. No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 Not supported by the active engine: whatsapp-web.js cannot send product messages.
  • 503 WhatsApp did not answer the catalog query within the request budget, or rate-limited it. For some business accounts WhatsApp never answers it, so a retry may not help. Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for thi

Status (stories)

GET /api/sessions/{sessionId}/statusGet all contact status updates

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Respostas

  • 200 Status updates visible to the session, newest first.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/sessions/{sessionId}/status/{id}Get status updates from a specific contact

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string
id * path string Contact ID

Respostas

  • 200 Status updates from the requested contact.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
DELETE /api/sessions/{sessionId}/status/{id}Delete own status

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string
id * path string Status ID

Respostas

  • 200 Status deleted.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 Key lacks OPERATOR role; on whatsapp-web.js, the id is not one of the account's own statuses; on Baileys, the status was not posted by this session in the last 24 hours (it was posted from the phone or from another node, or before the session's engine was last created by a restart, a stop and start,
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 The whatsapp-web.js page connection died mid-request, or WhatsApp Web did not answer within the request budget, so the revoke may not have completed. Safe to retry: revoking an already-revoked status converges. The status POST routes deliberately do NOT answer this for whatsapp-web.js, because a rep
GET /api/sessions/{sessionId}/status/{statusId}/mediaStream a stored status media file

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string
statusId * path string

Respostas

  • 200 The status image, video or voice note (audio) bytes.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No stored media (text status, omitted, or expired).
  • 503 On S3 storage, the gateway already has 50 media downloads open across the status and chat media routes. Retry once the Retry-After header (1 second) has passed.
POST /api/sessions/{sessionId}/status/send-textPost a text status

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
text * string Status text body. Must contain a non-whitespace character.
ex.: "Out for delivery 📦"
backgroundColor string Background color (hex).
ex.: "#25D366"
font 0 | 1 | 2 | 6 | 7 | 8 | 9 | 10 Font family index from the WhatsApp status font enum: 0 (default), 1, 2, 6 (bold), 7, 8, 9, or 10. whatsapp-web.js honors only 0–7 and clamps anything above to the default.
ex.: 0
recipients string[] Recipient JIDs (0–256). WhatsApp Status is not posted to a group — use @c.us or @lid individuals. Required on the Baileys engine (it posts to exactly this allow-list); ignored by whatsapp-web.js, which broadcasts to the account's status-privacy audience — omit it there.
ex.: ["628123456789@c.us"]

Respostas

  • 201 Text status posted. The recipients allow-list is honored on Baileys only; whatsapp-web.js broadcasts to the account's status-privacy audience.
  • 400 Invalid request, or the post was blocked by a plugin.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the post never reached WhatsApp. Wait for `ready` and retry. On whatsapp-web.js, WhatsApp Web periodically reloads its own page and the engine re-injects into it: a
  • 503 On Baileys, WhatsApp can answer the post with a 503: it rate-limited the request (code 429: nothing was posted) or timed out a query the post awaits (code 408: the outcome is not proven, so the post may have been published). The post also answers 503 when the connection closes before it is written (
POST /api/sessions/{sessionId}/status/send-imagePost an image status

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
image * Image source (URL or base64).
caption string Optional caption.
ex.: "New drop!"
recipients string[] Recipient JIDs (0–256), @c.us or @lid. Required on the Baileys engine (it posts to exactly this allow-list); ignored by whatsapp-web.js, which broadcasts to the account's status-privacy audience — omit it there.
ex.: ["628123456789@c.us"]

Respostas

  • 201 Image status posted. The recipients allow-list is honored on Baileys only; whatsapp-web.js broadcasts to the account's status-privacy audience.
  • 400 Neither url nor base64 provided, the url answers non-2xx, times out or cannot be reached, or the post was blocked by a plugin.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the post never reached WhatsApp. Wait for `ready` and retry. On whatsapp-web.js, WhatsApp Web periodically reloads its own page and the engine re-injects into it: a
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/status/send-videoPost a video status

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
video * Video source (URL or base64).
caption string Optional caption.
ex.: "Demo"
recipients string[] Recipient JIDs (0–256), @c.us or @lid. Required on the Baileys engine (it posts to exactly this allow-list); ignored by whatsapp-web.js, which broadcasts to the account's status-privacy audience — omit it there.
ex.: ["628123456789@c.us"]

Respostas

  • 201 Video status posted. The recipients allow-list is honored on Baileys only; whatsapp-web.js broadcasts to the account's status-privacy audience.
  • 400 Neither url nor base64 provided, the url answers non-2xx, times out or cannot be reached, or the post was blocked by a plugin.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the post never reached WhatsApp. Wait for `ready` and retry. On whatsapp-web.js, WhatsApp Web periodically reloads its own page and the engine re-injects into it: a
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work
POST /api/sessions/{sessionId}/status/send-voicePost an audio status as a voice note

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
audio * Audio source (URL or base64). WhatsApp plays a status voice note only as Ogg/Opus, and neither engine transcodes — use the media conversion endpoint to produce it. The mimetype defaults to 'audio/ogg; codecs=opus'.
backgroundColor string Background colour as `#RRGGBB`, which WhatsApp renders behind the voice-note bubble. Baileys only — whatsapp-web.js exposes no styling for a status and ignores it.
ex.: "#25D366"
recipients string[] Recipient JIDs (0–256), @c.us or @lid. Required on the Baileys engine (it posts to exactly this allow-list); ignored by whatsapp-web.js, which broadcasts to the account's status-privacy audience — omit it there.
ex.: ["628123456789@c.us"]

Respostas

  • 201 Voice status posted. WhatsApp plays a status voice note only as Ogg/Opus and neither engine transcodes, so convert first via POST /media/convert/voice. The recipients allow-list is honored on Baileys only; whatsapp-web.js broadcasts to the account's status-privacy audience.
  • 400 Neither url nor base64 provided, the url answers non-2xx, times out or cannot be reached, or the post was blocked by a plugin.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the post never reached WhatsApp. Wait for `ready` and retry. On whatsapp-web.js, WhatsApp Web periodically reloads its own page and the engine re-injects into it: a
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 503 The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the request was not carried out. The proxy or the target behind it may be at fault; the gateway cannot tell which. Retryable, but a `503` that persists while the proxy work

Chamadas

POST /api/sessions/{sessionId}/calls/{callId}/rejectReject a ringing incoming call

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
callId * path string Call ID from the call.received event

Respostas

  • 200 Call rejected
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Call not found or no longer ringing
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 The active engine cannot reject a call (whatsapp-web.js)
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.

Perfil

PUT /api/sessions/{sessionId}/profile/nameSet the account display name

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
name * string New display name (WhatsApp limit: 25 characters)

Respostas

  • 200 Profile name updated
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The whatsapp-web.js engine refused the name change. The Baileys engine has no acceptance signal and answers 200 for a rename WhatsApp declined. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
PUT /api/sessions/{sessionId}/profile/statusSet the account about/status text

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
status * string New about/status text (may be empty to clear it; WhatsApp limit: 139 characters)

Respostas

  • 200 Profile status updated
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs no longer has the call the library uses to set the About text. Nothing was asked of WhatsApp.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.
PUT /api/sessions/{sessionId}/profile/pictureSet the account profile picture (URL or base64 image)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
url string Image URL (http/https)
ex.: "https://example.com/avatar.jpg"
base64 string Base64 encoded image data
mimetype string Image MIME type (required when using base64)
ex.: "image/jpeg"

Respostas

  • 200 Profile picture updated
  • 400 Neither url nor base64 provided, base64 without mimetype, session is not started, the url answers non-2xx, times out or cannot be reached, or the image cannot be read (Baileys refuses an SVG)
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The whatsapp-web.js engine refused the picture change. The Baileys engine has no acceptance signal and answers 200 for an upload WhatsApp declined. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 413 The decoded base64 media, or the media downloaded from `url`, exceeds the media byte cap (`MEDIA_DOWNLOAD_MAX_BYTES`, 50 MiB by default). A whole request is separately bounded by `BODY_SIZE_LIMIT` (25 mb by default), and base64 inflates by about a third, so a large send usually meets that coarser li
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to send the picture with. Nothing was asked of WhatsApp: the picture is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On whatsapp-web.js, also when WhatsApp answers the change with a rate limit, a timeout or a server error (408, 423, 429 or 5xx): nothing wa
DELETE /api/sessions/{sessionId}/profile/pictureRemove the account's profile picture

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Profile picture removed
  • 400 Session is not started
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The whatsapp-web.js engine refused the picture removal. The Baileys engine has no acceptance signal and answers 200 for a removal WhatsApp declined. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 409 The session is not connected: an engine exists for it but is not `ready`, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A send whose first attempt had already run when the session left `ready` (or WhatsApp Web reloaded i
  • 501 On whatsapp-web.js, answered when the WhatsApp Web build the session runs has no job to remove the picture with. Nothing was asked of WhatsApp: the picture is unchanged.
  • 503 WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came. On whatsapp-web.js, also when WhatsApp answers the removal with a rate limit, a timeout or a server error (408, 423, 429 or 5xx): nothing w

Estatísticas

GET /api/stats/sessions/{sessionId}Get statistics for a specific session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string

Respostas

  • 200 Per-session statistics for the requested session.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found

Modelos de mensagem

POST /api/sessions/{sessionId}/templatesCreate a message template for the session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
name * string Unique template name within the session
ex.: "order-confirmation"
body * string Template body with {{variable}} placeholders
ex.: "Hi {{customer}}, your order {{orderId}} has shipped."
header string Optional header text, prepended to the rendered body
ex.: "OpenWA Store"
footer string Optional footer text, appended to the rendered body
ex.: "Reply STOP to unsubscribe."

Respostas

  • 201 Template created
  • 400 Validation failed, or the body carries a field the DTO does not declare.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Session not found
  • 409 A template with that name already exists for the session
GET /api/sessions/{sessionId}/templatesList all templates for a session

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 List of templates
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/sessions/{sessionId}/templates/{id}Get a template by ID

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Template ID

Respostas

  • 200 Template details
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Template not found
PUT /api/sessions/{sessionId}/templates/{id}Update a template

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Template ID

Corpo (application/json)

Campo Tipo Descrição
name string Template name
body string Template body with {{variable}} placeholders
header string Optional header text
footer string Optional footer text

Respostas

  • 200 Template updated
  • 400 Validation failed, or the body carries a field the DTO does not declare.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Template not found
  • 409 A template with that name already exists for the session
DELETE /api/sessions/{sessionId}/templates/{id}Delete a template

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
id * path string Template ID

Respostas

  • 204 Template deleted
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 Template not found

Chave de API

POST /api/auth/validateValidate an API key

Parâmetros

Campo Onde Tipo Descrição
X-API-Key header string API key to validate

Respostas

  • 200 API key is valid
  • 401 Invalid or missing API key
  • 403 The key is valid but refused here: its allowedIps exclude this client, or it is restricted to selected chats. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
GET /api/auth/meThe calling API key: role, sessions, session quota, receiver hosts, expiry and usage

Never returns the secret. Works with the key header or the dashboard session cookie.

Respostas

  • 200 The calling key
  • 401 Missing, invalid, revoked or expired key
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
POST /api/auth/me/rotateGive the calling API key a new secret

Proves possession of the current secret (key header only, never the dashboard cookie). The key keeps its id, role, sessions and webhooks; the old secret stops working at once, and every dashboard session and WebSocket opened with it is closed. The new secret is returned only in this response. At most once a minute.

Parâmetros

Campo Onde Tipo Descrição
X-API-Key header string The current secret of the key to rotate

Respostas

  • 200 The key with its new secret in `apiKey`
  • 401 Missing, invalid, revoked or expired key header
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 409 The key is the one set by API_MASTER_KEY, or it changed during the rotation
  • 429 The key was rotated less than a minute ago

Saúde do serviço

GET /api/healthBasic health check

Respostas

  • 200 Application is healthy

Automações

POST /api/sessions/{sessionId}/automation-rulesCreate an autoreply rule

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Corpo (application/json)

Campo Tipo Descrição
name * string Display name for the rule
ex.: "Greet new enquiries"
replyText * string Text sent back into the chat when the rule matches
ex.: "Thanks for reaching out — we reply within the hour."
conditions object Match conditions in the webhook filter format (message family: sender, recipient, chatId, body, type, isGroup, kind, fromMe, hasMedia, mentions). All conditions must match (AND). Omitted or empty means the rule matches every inbound message except channel, broadcast-list and status messages, which a rule answers only when it has a `kind` condition that matches them. On Baileys a message received t
cooldownSeconds integer Quiet period per chat, in seconds: after the rule replies in a chat it stays silent there for this long (default 60, 0 disables). This is the guard against two auto-repliers answering each other forever, so disable it knowingly.
enabled boolean Whether the rule is active

Respostas

  • 201 Rule created.
  • 400 Invalid rule (bad conditions, over-limit text, out-of-range cooldown), or the per-session rule limit is reached.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No session with this id.
GET /api/sessions/{sessionId}/automation-rulesList the session’s autoreply rules

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID

Respostas

  • 200 Rules in evaluation order: creation time, id as the same-second tiebreak.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
GET /api/sessions/{sessionId}/automation-rules/{ruleId}Get one autoreply rule

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
ruleId * path string Rule ID

Respostas

  • 200 The rule.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such rule in this session.
PUT /api/sessions/{sessionId}/automation-rules/{ruleId}Update an autoreply rule

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
ruleId * path string Rule ID

Corpo (application/json)

Campo Tipo Descrição
name string Display name for the rule
replyText string Text sent back into the chat when the rule matches
conditions object Match conditions in the webhook filter format (message family: sender, recipient, chatId, body, type, isGroup, kind, fromMe, hasMedia, mentions). All conditions must match (AND). Omitted or empty means the rule matches every inbound message except channel, broadcast-list and status messages, which a rule answers only when it has a `kind` condition that matches them. On Baileys a message received t
cooldownSeconds integer Quiet period per chat, in seconds: after the rule replies in a chat it stays silent there for this long (default 60, 0 disables). This is the guard against two auto-repliers answering each other forever, so disable it knowingly.
enabled boolean Whether the rule is active

Respostas

  • 200 Updated rule.
  • 400 Invalid rule (bad conditions, over-limit text, out-of-range cooldown).
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such rule in this session.
DELETE /api/sessions/{sessionId}/automation-rules/{ruleId}Delete an autoreply rule

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID
ruleId * path string Rule ID

Respostas

  • 204 Rule deleted.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 404 No such rule in this session.

Conversão de mídia

GET /api/sessions/{sessionId}/media/convertWhether server-side media conversion is available

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID the API key must be authorized for

Respostas

  • 200 Reports whether conversion is switched on AND the ffmpeg binary can be run, so a client can decide between converting here and converting before it sends.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
POST /api/sessions/{sessionId}/media/convert/voiceConvert audio into a WhatsApp voice note (Ogg/Opus)

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID the API key must be authorized for

Corpo (application/json)

Campo Tipo Descrição
url string Public http(s) URL of the media to convert (server-fetched, SSRF-guarded).
ex.: "https://example.com/note.m4a"
base64 string Base64-encoded media to convert. Takes precedence when both are supplied.
ex.: "SUQzBAAAAAAA..."

Respostas

  • 200 Converted bytes, ready to post to send-audio with ptt=true. WhatsApp only renders a playable mic bubble for Ogg/Opus; other formats arrive as an audio file that will not play.
  • 400 Neither url nor base64 given, the url is not an absolute http(s) URL or answers non-2xx, times out or cannot be reached, or ffmpeg refused the input.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 413 The supplied media is above the media size cap.
  • 503 Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly. It also answers 503 once the gateway is shutting down. The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the
POST /api/sessions/{sessionId}/media/convert/videoConvert video into a WhatsApp-compatible MP4

Parâmetros

Campo Onde Tipo Descrição
sessionId * path string Session ID the API key must be authorized for

Corpo (application/json)

Campo Tipo Descrição
url string Public http(s) URL of the media to convert (server-fetched, SSRF-guarded).
ex.: "https://example.com/note.m4a"
base64 string Base64-encoded media to convert. Takes precedence when both are supplied.
ex.: "SUQzBAAAAAAA..."

Respostas

  • 200 Converted bytes: baseline H.264 with AAC audio, fitted inside 1280x720 (720x1280 portrait), index moved to the front so the recipient can start playing before the whole file arrives.
  • 400 Neither url nor base64 given, the url is not an absolute http(s) URL or answers non-2xx, times out or cannot be reached, or ffmpeg refused the input.
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The API key's role, session or chat scope, or IP allow-list does not allow this operation
  • 413 The supplied media is above the media size cap.
  • 503 Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly. It also answers 503 once the gateway is shutting down. The session routes its `url` fetches through an egress proxy, and the fetch failed or timed out before any response arrived, so the

account

GET /api/account/pluginsList the plugins released to this key, with its own settings

Respostas

  • 200 Released plugins
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
PUT /api/account/plugins/{id}/configSave this key's configuration of a plugin

Parâmetros

Campo Onde Tipo Descrição
id * path string

Corpo (application/json)

Campo Tipo Descrição
config * object Plugin configuration object

Respostas

  • 200 Saved
  • 400 A setting does not fit the schema, or names a host the key may not use
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
POST /api/account/plugins/{id}/enableSwitch a plugin on for this key's sessions

Parâmetros

Campo Onde Tipo Descrição
id * path string

Respostas

  • 200 Switched on
  • 400 The saved settings name a host the key may not use
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
  • 409 Another account already runs the plugin on one of the sessions
POST /api/account/plugins/{id}/disableSwitch a plugin off for this key's sessions

Parâmetros

Campo Onde Tipo Descrição
id * path string

Respostas

  • 200 Switched off
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
DELETE /api/account/plugins/{id}Erase this key's settings of a plugin and what the plugin stored for its sessions

Parâmetros

Campo Onde Tipo Descrição
id * path string

Respostas

  • 200 Erased; the plugin stays released
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
PUT /api/account/plugins/{id}/sessionsChoose the sessions the plugin acts on (['*'] = every session of the key)

Parâmetros

Campo Onde Tipo Descrição
id * path string

Corpo (application/json)

Campo Tipo Descrição
sessions * string[] Sessions to activate the plugin for; ['*'] = all numbers, [] = none
ex.: ["*"]

Respostas

  • 200 Saved
  • 400 The body failed validation
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
  • 409 Another account already runs the plugin on one of the sessions
PUT /api/account/plugins/{id}/config/{sessionId}Override this key's configuration for one session (empty = clear it)

Parâmetros

Campo Onde Tipo Descrição
id * path string
sessionId * path string

Corpo (application/json)

Campo Tipo Descrição
config * object Plugin configuration object

Respostas

  • 200 Saved
  • 400 A setting does not fit the schema, or names a host the key may not use
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
GET /api/account/plugins/{id}/healthCheck a plugin with this key's configuration

Parâmetros

Campo Onde Tipo Descrição
id * path string
sessionId query Check with the settings of one session

Respostas

  • 200 Plugin health status
  • 400 sessionId was sent more than once
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, or not released to this key
GET /api/account/plugins/{id}/config-uiServe a released plugin's sandboxed config-UI entry HTML

Parâmetros

Campo Onde Tipo Descrição
id * path string

Respostas

  • 200 Config UI HTML
  • 401 The API key is missing, unknown, revoked, or expired
  • 403 The key is not restricted to its own sessions, or the session is not one of them. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
  • 404 Plugin not found, not released to this key, or has no config UI