Troubleshooting & FAQ
Find the symptom, read the cause, apply the fix. This page covers the failures operators hit most — container, session connect, QR timeout, disconnects, send failures, webhooks, auth, media, memory, and SQLite locks — then lists every error status the REST routes return and every stable application error code.
For first-time setup, see Installation and Configuration. Terms used here are defined in the Glossary.
Quick diagnostics
Run these first — they isolate which layer is failing (process, database, engine, or a single session).
# 1. Is the API process up? (no auth required)
curl http://localhost:2785/api/health
# 2. Are the database and adapters ready? (no auth required)
curl http://localhost:2785/api/health/ready
# 3. Inspect one session's status
curl -H "X-API-Key: YOUR_API_KEY" \
http://localhost:2785/api/sessions/SESSION_ID
# 4. Container status and recent logs
docker compose ps
docker compose logs openwa-api --tail=100
YOUR_API_KEY is the key you set in your environment; see
Authentication for how it is issued. SESSION_ID is the
session id returned when you create a session — a generated UUID, not the name
you chose. API lookups use this UUID, so paste the id from the create response,
not your session name. Since v0.23.5 the auth folders on disk are keyed by that same
id, so one value serves both the API calls and the corrupted-auth-folder fix below.
A healthy session returns "status": "ready". Any other value points you at a
section below.
Every docker compose command on this page names the API service as the full
docker-compose.yml stack defines it, openwa-api. On the quick-start stack
that service is called openwa, so pass -f docker-compose.dev.yml and that
name there instead. If you started OpenWA with docker run, there is no Compose project:
the container is openwa-api, so use docker logs openwa-api --tail=100 and
docker restart openwa-api in place of the docker compose logs and
docker compose restart commands.
Session states
Most connection problems are a session stuck in a non-ready state. A session
moves through these eight values (lowercase, as returned by the API):
| Status | Meaning | What to do |
|---|---|---|
created | The session record exists but the engine has not started | Start the session |
initializing | The engine is starting up | Wait; if it never advances, read lastError, then the logs |
qr_ready | A QR code is waiting to be scanned | Fetch and scan the QR within ~60 s |
authenticating | QR scanned, linking the device | Wait; if stuck, see the section below |
ready | Connected and able to send/receive | None — this is the goal state |
disconnected | The link dropped, or the gateway restarted while AUTO_START_SESSIONS was not true | Reconnect; check the phone's linked devices. After a restart, start each linked session with POST /api/sessions/:id/start: since v0.30.3 the boot log counts them (action=auto_start_disabled) |
action_required | The engine is running and still connected, but something outside the gateway has to change first | Read lastError for what to do; sends answer 409 until it returns to ready, and a session or gateway restart clears it |
failed | A terminal engine error occurred | Read lastError (it is null after a gateway restart) and remove the cause, then start the session again with POST /api/sessions/:id/start. Delete it only when lastError says to pair again or bind another number: a delete also removes its history, webhooks, templates and credentials |
When status is failed or action_required, the session response includes a
human-readable lastError until the gateway restarts. Since v0.23.5 an initializing session carries one too:
from the fifth consecutive attempt of a Baileys engine retrying a dropped connection on
its own (whatsapp-web.js hands every drop back to the gateway instead of retrying), and,
on either engine, while a reconnect backs off after a failed engine relaunch. Read it
before reaching for the logs. See Sessions for the full lifecycle.
Connection issues
Container won't start
Problem: docker compose up fails, the container exits immediately, or you see
"port already in use."
Cause: Another process is bound to port 2785, or a previous run left a broken
container or volume state.
Fix:
# Read why the container exited, before anything removes it
docker compose logs openwa-api
# Find what listens on the port (listeners only, not clients connected to it)
lsof -nP -iTCP:2785 -sTCP:LISTEN
# Is a container publishing it? A running stack holds the port through Docker, so
# stop the stack rather than killing the listener
docker ps --filter publish=2785
docker compose down
# Restart cleanly. The bundled compose files build openwa-api from source, so
# `docker compose pull` does not refresh it; with a compose file that names an
# `image:` for it, run `docker compose pull` first
docker compose up -d
If a program that is not OpenWA holds the port, stop that program, or publish OpenWA on
another host port with API_PORT in .env. Do not kill -9 a process you have not
identified: SIGKILL runs no cleanup.
If it still exits, run docker compose logs openwa-api and match the first error to a
section below. Configuration shapes that boot validation used to accept now
fail boot with a validation error — if the log names one of these, fix the value
and restart:
| Logged failure | Cause | Fix |
|---|---|---|
REDIS_ENABLED rejected | A non-canonical value (a typo like ture, or 1/yes) — previously the rate-limit store and cache silently downgraded to in-memory | Set it to exactly true or false (blank reads as unset) |
| A numeric variable rejected | A numeric env var spelled as exponent or hex (1e6, 0x100) — it validated as one number while the app configured another | Use plain decimal digits |
WEBHOOK_MAX_PAYLOAD_BYTES rejected | A 0 cap would reject every webhook dispatch | Set a positive byte count, or unset for the 1 MiB default |
PORT rejected (v0.25.0+) | A value with surrounding whitespace or whitespace only | Use an unpadded decimal port from 1 to 65535 |
WEBHOOK_SHUTDOWN_DRAIN_MS rejected (v0.25.0+) | A negative or non-integer value such as 30s | Use milliseconds as a non-negative integer, or unset for 5000 |
| A boolean flag rejected | A value such as True, yes, or a padded true | Use exact true or false, or leave it blank for the default |
POSTGRES_SCHEMA rejected (v0.23.6+) | A mixed-case schema name, which used to boot and split the tables across two schemas, or one with surrounding whitespace, which used to pass validation and then fail the database connection at boot | Use a lower-case identifier with no surrounding spaces |
Refusing to start in production: insecure or default value for METRICS_TOKEN (v0.26.0+) | METRICS_TOKEN is the .env.example placeholder or a known weak value such as test, change-me or password (trimmed, case-insensitive); the scrape endpoint is public | Set a long random token, or unset it to keep /api/metrics disabled |
REDIS_TLS or REDIS_USERNAME rejected (v0.26.0+) | REDIS_TLS=true, or a REDIS_USERNAME other than default, with REDIS_BUILTIN=true and the bundled host while Redis, the queue or the cache is on: the built-in container serves plain TCP and only its default user, so every connection failed | Set REDIS_TLS=false and clear the username, or use an external Redis (REDIS_BUILTIN=false with its REDIS_HOST) |
DATABASE_SSL rejected (v0.26.0+) | DATABASE_SSL=true with DATABASE_TYPE=postgres, POSTGRES_BUILTIN=true and the bundled host: the built-in PostgreSQL container runs without TLS | Set DATABASE_SSL=false where it is set (data/.env.generated, the project .env or the environment), or use an external PostgreSQL |
QUEUE_PREFIX rejected (v0.26.0+) | A value that is not 1 to 64 letters, digits, dots, underscores or hyphens starting with a letter or digit | Use such a value, or unset it for BullMQ's default bull |
Cannot read <path>: <reason> (v0.28.0+) | .env or data/.env.generated exists on disk as a directory (for example a single-file Docker bind mount where the host file did not exist) or cannot be read by the runtime user (EACCES, EISDIR), on both gateway boot and the migration CLI (npm run migration:run / migration:run:prod) | Make the file readable by the app user (uid 997 in the container), replace the directory with a regular file or mount the data directory instead, or run the migration CLI as the file's owner or inside the image |
A boot with STORAGE_TYPE=s3 and an S3_ENDPOINT that is not an absolute http:// or https:// URL (for example minio:9000) does not fail (v0.26.0+). It logs an error at start, and media goes to the local directory, because every S3 call would fail on that value. Add the scheme. The Infrastructure page refuses a save that changes the endpoint to such a value or newly selects S3 beside one.
With the built-in PostgreSQL (DATABASE_TYPE=postgres and POSTGRES_BUILTIN=true), a
stopped openwa-postgres container used to leave the gateway crash-looping at boot: the
data connection dialled the database before the gateway got the chance to start it. Since
v0.23.6 the gateway starts that container first, allowing the start up to 15 seconds, and
continues booting whether or not it succeeded. If the log shows Docker not available, Failed to start service: database, Could not start built-in PostgreSQL or Built-in PostgreSQL start did not finish within 15000ms, start the container yourself with docker start openwa-postgres
and restart the gateway. On an older release, do the same, or move to v0.23.6.
A main-database migration guard stops startup
Since v0.24.0 the main SQLite database runs migrations at boot and adopts existing data in place. Boot refuses a ledger written by a newer release or a missing column that a recorded migration should have created. Stop the instance and restore the main database from the matching pre-upgrade backup, and do not revert main migrations to get past the guard (the oldest drops api_keys and audit_logs). Keep API keys and audit logs together; deleting ledger entries does not repair the schema. See schema migrations.
A source install on Linux fails to start with GLIBC_2.xx not found or ERR_DLOPEN_FAILED
Problem: A source install on an older Linux distribution fails during npm ci or at startup with ERR_DLOPEN_FAILED naming GLIBC_2.32, GLIBC_2.33, or GLIBC_2.34 not found when loading better_sqlite3.node or sharp.
Cause: The prebuilt native binaries for better-sqlite3 and sharp on Linux require glibc 2.34 or newer (Ubuntu 22.04+, Debian 12+, RHEL 9+ and derivatives).
Fix: Run OpenWA via the official Docker image (which bundles Debian 12 and glibc 2.36), upgrade the host OS to a distribution with glibc 2.34+, or build better-sqlite3 from source on the host with a C++20 toolchain (python3, make, g++).
Plugin changes answer 409 just after a restart
Problem: After a boot whose plugin restore outlasts 60 s, from the moment the HTTP port opens
until that plugin is back, enabling, disabling, updating, uninstalling or reinstalling it answers 409 with Plugin <id> is still being restored after startup. Retry in a moment. An ingress route that declares a response contract answers 503 with Retry-After: 5 and
the body plugin restoring. A hook the plugin owns, such as a send moderation veto, does not run.
Cause: Since v0.26.0 the gateway restores the plugins you had enabled before it opens the HTTP
port, but waits at most 60 s. A plugin whose backend is slow or down keeps restoring in the
background after the port opens (the log carries plugin_restore_deferred), and until it is up its
hooks are inactive and changes to it are refused. Before v0.26.0 the port stayed closed for the whole
restore, which could outlast a health check and restart the container in a loop. Other ingress
deliveries for that plugin are accepted and held, not dead-lettered: queued jobs wait without
spending a retry attempt and wake together, and with the queue off the reconciler replays them after
INGRESS_RECONCILE_GRACE_MS (60000 ms by default).
Fix: Retry shortly. Do not rely on a plugin veto while a plugin is still restoring after a boot
with slow plugins (the log carries plugin_restore_deferred when the port opened before the restore
finished). A plugin that cannot come back is logged and left in the error state.
A plugin with a malformed ingress declaration is refused or ends in error
Problem: Since v0.31.0, installing or updating a plugin answers 400 with a message that names the plugin and the field, and the route where the field belongs to one, such as Plugin <id>: ingress must be a list of routes, Plugin <id>: route '<route>' signature.contentTemplate must be a string or Plugin <id>: route '<route>' signature.header must be a string. An installed plugin whose manifest has one of these fields malformed is not loaded after the upgrade: its status is error, and the log carries Failed to load plugin <name> (action=plugin_load_failed) with the same message.
Cause: The manifest's ingress is not a list, an hmac-sha256 signature.contentTemplate is not a string, or signature.header or signature.timestampHeader (on hmac-sha256 and shared-secret routes), signature.dedupHeader, dedupHeader or conversationId.header is not a string. Before v0.31.0 such a manifest was not checked: it could fail while loading, fail later (an update stopped the running plugin first, and every delivery on that route failed once the plugin loaded), or be read as if the field were absent. Install and update now refuse it before anything changes, and refuse an ingress declaration the host would refuse at load for the same reason (an unsigned route while ALLOW_UNSIGNED_INGRESS is off, an unsupported sdkVersion major, a missing webhook:ingress permission): an update ran onDisable, unloaded the running plugin and rolled back before, and an install wrote the files first. A refused install writes nothing, and a refused update leaves the running plugin as it was.
Fix: Correct the field the message names in the plugin's manifest, and send the corrected package. For a plugin that already ended in error, the registry entry (its config and whether the operator enabled it) is kept: once the manifest is valid, the next boot loads and re-enables it.
A plugin storage call is refused with Unsafe plugin storage key
Problem: A plugin's ctx.storage.set or ctx.storage.delete rejects with Unsafe plugin storage key: <key> since v0.31.0, and ctx.storage.get answers null while the gateway logs Refusing to read plugin data with an unsafe key.
Cause: The key holds a lone UTF-16 surrogate, the half of an emoji that slice leaves when it cuts inside one. A surrogate has no UTF-8 form, so a key that held one was written under the file name of the same key with U+FFFD in its place, and two keys that differed only there shared one record. The key is now refused like any other unsafe key.
Fix: Cut the key at a character boundary, not inside an emoji. A record an earlier version wrote under such a key stays reachable through the key spelled with U+FFFD.
The gateway exits at boot naming AUDIT_RETENTION_DAYS
Problem: After upgrading to v0.17.0, startup fails with Invalid environment configuration: and a line reading AUDIT_RETENTION_DAYS must be an integer (got "30d"). The same value booted before the upgrade.
Cause: Since v0.17.0 AUDIT_RETENTION_DAYS is checked at boot and must be a plain
decimal integer of any sign. It used to be parsed only where it was read, which
silently coerced anything else: 30d and 90.5 became 30 and 90, +90 became 90,
and a word such as ninety fell back to the 90-day default without reporting
anything. The check permits a sign because 0 and any negative value are documented
switches that disable audit-log pruning entirely. Since v0.24.0 a value above 36500
is refused too, with AUDIT_RETENTION_DAYS must be at most 36500 (got "<value>"), so
a "keep forever" row of nines does not boot: use 0 for that.
Fix: Set a plain integer — AUDIT_RETENTION_DAYS=90 — or 0 to keep audit logs
forever, or remove the variable to take the 90-day default. An empty or
whitespace-only value reads as unset, so a ${AUDIT_RETENTION_DAYS:-} forward in a
compose file is legal and means "default". Boot validation collects every environment
error into one message, so fix each line the log lists before restarting.
The gateway exits at boot: PostgreSQL data connection is not on UTC
Problem: After upgrading to v0.23.6, a PostgreSQL deployment fails to start with
PostgreSQL data connection is not on UTC: TimeZone is "<zone>".
Cause: Since v0.23.6 every pooled data connection runs SET TIME ZONE 'UTC', and boot
reads the effective offset back at two instants six months apart, so a zone that only sits
at +00 in winter does not pass. Boot fails when the setting does not hold, usually
because a connection pooler drops session state. Since v0.26.0 the statement carries the
DATABASE_CONNECTION_TIMEOUT_MS budget (10000 ms by default), so a database that accepts the connection and
then stalls fails the connection instead of hanging the boot.
Fix: Stop every OpenWA node, convert the existing rows (below), then make UTC the database default and start the nodes:
ALTER DATABASE "<database>" SET TimeZone='UTC';
Alternatively, configure the pooler to pass the connection's own SET TIME ZONE 'UTC'
through. Since v0.27.0 the PostgreSQL pool applies statement_timeout, TimeZone='UTC' and
search_path as SQL statements on each new connection instead of startup packet options, so
PgBouncer in session pooling mode works without ignore_startup_parameters; transaction
pooling remains unsupported because boot migrations and background trigram index builds use
session-level advisory locks. SQLite deployments are unaffected.
Either way, convert the existing rows once, with every node stopped, before the first start
that passes the check. Once UTC holds, the gateway writes UTC rows, and a conversion run after
that start shifts those too. This error means the zone a connection falls back to is not UTC, so the
createdAt/updatedAt columns PostgreSQL filled itself (DEFAULT now()) hold that zone's wall
time: convert them with that old zone, except messages.createdAt, whose treatment depends on
which writers filled it (the guide linked below says when it takes a bulk update). If the gateway process also ran outside UTC, the columns the gateway writes itself hold
its wall time instead. They include lid_mappings.updatedAt, chat_states.updatedAt
and baileys_stored_messages.createdAt, whose DEFAULT now() never fires because the gateway
always passes the value. Convert those with the gateway's old zone, except
sessions.claimedAt and sessions.leaseExpiresAt: clear that lease with every node stopped
rather than converting it. See
PostgreSQL deployments that ran outside UTC.
Sessions do not start after upgrading to v0.23.6 (PostgreSQL)
Problem: After a PostgreSQL deployment is upgraded to v0.23.6, sessions that
AUTO_START_SESSIONS would bring back stay down, and POST /api/sessions/{sessionId}/start
(like stop and delete) answers 409 with Session <id> is running on another node, although no
other node runs them. Timestamps the gateway wrote before the upgrade, such as a session's
lastActive or a webhook's lastTriggeredAt, may read hours off as well.
Cause: Up to v0.23.5 the gateway wrote the timestamp columns it fills itself, the session
lease among them, in its own local time (its TZ, or the host's zone without one); since v0.23.6
it reads them as UTC. A lease that a
gateway east of UTC wrote and did not release on shutdown therefore reads hours into the future.
Every node whose id differs from the holder's treats the session as held elsewhere until that
time passes.
That covers every peer in a cluster, and a container recreated during the upgrade with NODE_ID
unset, since the id then defaults to the container hostname, which changes on every recreate. A
node that kept its id reclaims its own lease as usual.
Fix: With every node stopped, clear the lease rather than converting it, then start the gateway:
UPDATE sessions SET "nodeId" = NULL, "claimedAt" = NULL, "leaseExpiresAt" = NULL, "nodeUrl" = NULL;
The other columns the gateway writes itself still hold the gateway's old wall time, except where
v0.23.6 has written since its first start: the connectedAt and lastActiveAt of the sessions
it started and the lid_mappings, chat_states and baileys_stored_messages rows it wrote for
them, and what webhook and ingress deliveries and bulk sends stamped. Those values are already
UTC. The script in
PostgreSQL deployments that ran outside UTC
assumes no node has started on v0.23.6 and converts every row, so it would shift them back by the
old offset, and east of UTC no cutoff separates them from the older values. Convert only values you
know predate the upgrade, or leave the columns as they are: connectedAt, lastActiveAt and
lastTriggeredAt correct themselves on the next write. Set a stable NODE_ID so the next
recreate keeps the node's identity. A gateway that ran in UTC throughout is unaffected, as is
every SQLite deployment.
Session won't connect (stuck at initializing or qr_ready)
Problem: A QR code is generated but the session never reaches ready, or it
falls back to disconnected after you scan.
Cause: An expired QR, a corrupted auth folder, a browser crash, or an outbound
network/firewall block. Since v0.23.3 a session that had linked before and comes back
asking for a QR logs a relink_required warning naming the likely causes, so check the
server log first: it means the stored credentials are gone or no longer accepted, which
usually happened while the engine was down.
Fix: Match the cause, then re-scan.
| Cause | Fix |
|---|---|
| Expired QR | Fetch a fresh one — a QR is valid for about 60 seconds |
| Corrupted auth folder | Delete the session's auth data and re-scan |
| Browser crash (whatsapp-web.js) | Restart the container |
| Network / firewall block | Verify outbound connectivity and any proxy |
Credentials on a SOCKS proxy that cannot use them (the start log warns has credentials on a SOCKS4 proxy on Baileys, v0.23.6+, or has credentials on a SOCKS proxy on whatsapp-web.js, and since v0.28.0 a whatsapp-web.js start that fails in auth timeout or net::ERR_* includes the SOCKS auth explanation in lastError) | SOCKS4 has no authentication step: the user name goes out as the connect request's user id and the password is dropped. Chromium cannot authenticate to any SOCKS proxy. Either way, a proxy that requires a password refuses the connection. Use an http:// or https:// proxy (since v0.29.0 a credentialed http:// or https:// session proxy on whatsapp-web.js also bypasses WhatsApp Web's service worker so fetch() media downloads authenticate through the proxy instead of failing with 407), a socks5:// one on Baileys, or a proxy that authorizes by IP |
Proxy credentials with a bare % (every start fails with an opaque URI malformed) | Write a literal % in the proxy user name or password as %25, and set the proxy again with PATCH /api/sessions/{sessionId}/proxy. Since v0.23.6 such a URL is refused with 400 when it is set, but a value stored by an earlier release is not re-checked |
A Baileys session behind a socks4:// or socks5:// proxy at an IPv6 literal, such as socks5://[2001:db8::10]:1080, fails every connect with ENOTFOUND and never shows a QR | Upgrade to v0.23.6 or later; earlier releases sent the address's brackets as part of the hostname. See also the note on proxy passwords in older Baileys logs below |
# Both paths are keyed by the session's UUID id since v0.23.5, the same id the API
# uses. Read it from GET /api/sessions. (Up to v0.23.4 they were keyed by the session
# name; v0.23.5 renames an existing directory onto the id at first boot.)
# The paths are inside the container, so they reach the named volume of the default
# docker-compose.yml and a bind-mounted ./data alike (write openwa for openwa-api under
# docker-compose.dev.yml)
# whatsapp-web.js engine (default): auth lives under SESSION_DATA_PATH
# (default /app/data/sessions), in a session-<id> subfolder
docker compose exec openwa-api rm -rf /app/data/sessions/session-SESSION_ID
# Baileys engine: auth lives under BAILEYS_AUTH_DIR (default /app/data/baileys)
docker compose exec openwa-api rm -rf /app/data/baileys/SESSION_ID
docker compose restart openwa-api
Deleting an auth folder unlinks that session from WhatsApp. You must scan a new QR
to reconnect. Deleting the session itself (DELETE /api/sessions/:id) purges both
engines' auth directories, not just the active engine's — a link left behind under
the other engine cannot silently re-link after an engine switchback, so you do not
need to clear the inactive engine's folder by hand.
Since v0.23.6 the Baileys wire log redacts credential fields, the proxy password among them, and
since v0.26.0 at any depth of a record (before, only its first five levels).
Before v0.23.6, a failed SOCKS connect on a Baileys session could write the whole proxy configuration,
password included, to stdout when BAILEYS_LOG_LEVEL was debug or trace, whatever the
proxy's address. If logs from such a run were kept, rotate the proxy password.
Linking asks for a passkey and never completes
Problem: During linking, by QR or by pairing code, the phone shows "Create a passkey to
log in" or "Continue on your other device", and the session never leaves qr_ready. It
happens on both engines. On Baileys (since v0.30.0), the session reports this directly without changing status: restriction on GET /api/sessions/{sessionId} and GET /api/sessions is { "kind": "passkey_required", "code": "passkey_prologue_request", "expiresAt": null }, a session.restriction webhook and WebSocket event announces it, the dashboard session card shows a "Passkey required" badge (even while waiting at the pairing placeholder) and the Connect Session modal displays a warning banner on both tabs, and the log records a warning once per connection (action=baileys_passkey_required). Reaching ready on a later link lifts the restriction (stop, start, or logout does not clear it; deleting the session or restarting the gateway drops it).
Cause: WhatsApp has added a passkey (WebAuthn) step to the linking handshake for some accounts. The step is enforced server-side inside the linking frames, which the engine libraries handle, and neither whatsapp-web.js nor Baileys implements it. OpenWA passes the QR string and the pairing-code request straight through to them.
Fix: There is no OpenWA-side fix, and no client-side change gets past the step:
switching engine, using a pairing code instead of a QR, or presenting a different device
name (BAILEYS_BROWSER_NAME or otherwise) all end at the same gate. Re-registering the
number as a different account type has been tried and did not hold. The only durable
change will come from the engine libraries implementing the step; it is tracked in
#560 and upstream in WhiskeySockets/Baileys#2672.
Linking succeeds but the session never becomes ready (Baileys)
Problem: After scanning the QR or entering the pairing code on a Baileys session, the log shows Baileys link accepted; restarting the connection as WhatsApp asked (action=baileys_link_restart, v0.30.0+), but Session ready never follows. Instead, Baileys connection dropped; reconnecting (action=baileys_connection_dropped) repeats with stage=login_unconfirmed or stage=login_confirmed and aliveMs reporting how long each attempt lasted, and from the fifth consecutive attempt lastError on GET /api/sessions/{sessionId} ends with a sentence naming that stage (The last connection closed after WhatsApp confirmed the login, before the session opened. or The last connection closed before WhatsApp confirmed the login.). (stage=connecting is a different problem: the connection never reached WhatsApp, so check the network, DNS, and any session proxy.)
Cause: Once the link is accepted, the device logs in on a new connection. WhatsApp confirms the login, and Baileys then generates its initial pre-keys (812 files with Baileys 7.0.0-rc14), writes each one to the session's auth directory with a disk flush (fsync), uploads them in a single request of about 40 KB within a 30-second deadline, and activates the connection before the session becomes ready:
stage=login_confirmed: WhatsApp accepted the login, and the pre-key flush or upload after it did not finish in time. Every attempt that reaches this stage leaves another 812pre-key-*files in/app/data/baileys/<sessionId>(where a linked session holds about 800 or fewer). Either the volume storage is too slow at flushing 812 small files (network storage, SD card, throttled cloud disk) or the network path drops large outbound packets (typically a path MTU below the Docker network's 1500 on a VPN, tunnel, or cloud network).stage=login_unconfirmed: WhatsApp closed the connection before confirming the login. Test whether a different number links on the same host and whether the same number links from a different network to separate an account-side refusal from the host network.
Fix: For stage=login_confirmed, test both disk flush speed and a 100 KB outbound POST from inside the container:
# 1. Measure 812 small file writes with fsync in the data volume
docker compose exec openwa-api node -e "const fs=require('fs'),d='/app/data/.flush-probe';fs.mkdirSync(d,{recursive:true});const t=Date.now();Promise.all(Array.from({length:812},async(_,i)=>{const h=await fs.promises.open(d+'/'+i,'w');await h.writeFile('x'.repeat(150));await h.sync();await h.close()})).then(()=>{console.log('812 flushed files in',Date.now()-t,'ms');fs.rmSync(d,{recursive:true})})"
# 2. Test a 100 KB outbound POST to web.whatsapp.com (any HTTP status means the packet size got through)
docker compose exec openwa-api node -e "fetch('https://web.whatsapp.com/',{method:'POST',body:Buffer.alloc(100000),signal:AbortSignal.timeout(20000)}).then(r=>console.log('answered with HTTP',r.status),e=>console.log('no answer:',e.name))"
Move /app/data to local SSD storage if the disk probe takes tens of seconds, or lower the Docker network / tunnel MTU if the 100 KB POST times out while small requests succeed. To inspect the wire frames themselves, set BAILEYS_LOG_LEVEL=trace, recreate the container, and read the baileys-wire lines between logging in... and the drop (note that they contain the phone number).
A pairing code is answered with "Couldn't link device" (Baileys)
Problem: POST /api/sessions/{sessionId}/pairing-code returns a code, but once it is
entered the phone answers "Couldn't link device". The session is then logged out and its
auth directory cleared. Linking the same account by QR works.
Cause: The pairing request carries the linked-device name, and some accounts reject a
non-standard one. Since v0.25.0 the default is Ubuntu; older releases used OpenWA. Check whether your environment still pins the old value.
Fix: Set BAILEYS_BROWSER_NAME to a standard OS name such as Ubuntu, restart OpenWA
itself, and request a fresh code. The name is read once at boot, so stopping and starting
the session is not enough. It applies to new pairings only: a session that is already
linked keeps the name it was paired with until it is linked again.
A pairing code request unlinks a session of the same number (whatsapp-web.js)
Problem: Within about a minute of POST /api/sessions/{sessionId}/pairing-code being
called for a number that already has a linked device, that device's session logs
WhatsApp unlinked this device (LOGOUT), its stored credentials are deleted, and it comes
back at qr_ready with no phone.
Cause: On whatsapp-web.js, a pairing-code request for a number that is already linked,
to another session on this gateway or to a device elsewhere, can end with WhatsApp revoking
that device. Since v0.26.0 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 (That number is linked to another session. Delete that session, or log it out while it runs, before pairing this one.) and WhatsApp is not asked. The gateway cannot see a device linked
on another gateway or only on the phone, so a request for such a number still goes through; before
v0.26.0 nothing refused any request, because the checks looked at the requesting session's state,
never at the number. Baileys was not affected and accepts the request, since its sessions are
companion devices that may share a number.
Fix: Request a code only for a number you are prepared to re-link, and link by QR when
a session of that number must stay up. On the 409, delete the other session, or log it out while
it runs, before pairing this one. The same applies to retrying a pairing-code 503 (v0.23.6+; a 500 before):
an attempt that timed out may still have reached WhatsApp, and a retry starts the linking
flow again.
Session stuck at authenticating, never reaches ready
This stall affects the whatsapp-web.js engine only. Baileys also reports
authenticating (since v0.23.3), but only for the seconds between WhatsApp accepting
the link and the restart it asks for, so it cannot park there. With
ENGINE_TYPE=baileys, skip this section.
Problem: After scanning, the phone links the device but the session does not reach
ready. It sits in authenticating for about 90 seconds. A fresh pairing then falls back to
a new QR, once per reconnect episode, and a repeat ends in failed; a session restored from
saved credentials goes straight to failed with those credentials kept. Common on ARM64
hosts (for example a Raspberry Pi).
Cause: The WhatsApp Web build in use is incompatible and stalls the post-link
sync. With WWEBJS_WEB_VERSION unset, auto, or latest, OpenWA resolves a settled
build from the third-party
wppconnect-team/wa-version registry
and pins its HTML — a bad pin produces this failure.
Fix: Pin a known-good WhatsApp Web version, then restart the container:
WWEBJS_WEB_VERSION=<a version listed in the registry today>
Take the value from the html/ folder of
wppconnect-team/wa-version at the time
you pin it, rather than copying a version from documentation: the registry withdraws
builds, and a pin naming one it no longer carries is ignored, so the workaround appears
to do nothing. Unset the
variable (or set auto/latest) to return to the registry-pinned default; set it to
off to use the first-party build served by WhatsApp. Since v0.29.0 OpenWA also checks the fetched HTML before pinning it: a registry entry whose HTML is WhatsApp's logged-out landing page (<html id="whatsapp-web-logged-out">, quoted or unquoted since v0.29.1) is rejected (web_version_html_rejected), stepping back up to 3 older settled builds on auto/latest (from the same registry read without a second fetch since v0.29.1) or falling back to WhatsApp's live page (web_version_html_unavailable) when an explicit version is pinned.
A pin is not guaranteed to hold even when the registry serves it: WhatsApp Web's service
worker can answer the page load from its own cached build without the request reaching
whatsapp-web.js, and the startup line Pinning WhatsApp Web version … names only the build
you asked for. Since v0.23.6 a session that reaches ready logs the build its page actually
runs (web_version_running). When a pin was requested and the page runs a different build,
it logs a warning naming both builds (web_version_pin_not_applied) instead of that line. The
warning changes nothing about the session; include both builds when you report a problem.
Before v0.23.6 an unpinned session (WWEBJS_WEB_VERSION=off, or an auto-resolve that could
not reach the registry) also stalled here under the Docker image, Compose and Helm, for a
different reason: whatsapp-web.js wrote its local HTML cache to ./.wwebjs_cache/ after the
link, and the read-only app directory refused the write. Since v0.23.6 an unpinned session
caches nothing and loads WhatsApp's live build.
The registry-pinned HTML executes inside the authenticated web.whatsapp.com origin
without an integrity check — the pin exists to avoid the
scan→stuck→disconnect-loop class of failures, not as a verified artifact. To control
the supply chain yourself, serve an operator-controlled copy via
WWEBJS_WEB_VERSION_REMOTE_PATH, or set WWEBJS_WEB_VERSION=off for WhatsApp's own
build. At pin time OpenWA logs a one-time WARN naming the resolved version, its
source URL, and these opt-outs.
QR generation times out on slow first boot (WSL2 / low-resource)
whatsapp-web.js only.
Problem: On the first launch, no QR appears and the session fails after about 30 seconds — often inside WSL2 or a resource-constrained container.
Cause: whatsapp-web.js waits a fixed 30000 ms for WhatsApp Web to finish loading
before it generates the QR. A slow first boot can exceed that window. Since v0.31.0
(whatsapp-web.js 1.34.8) it also waits up to the same time again for the page's connection
to WhatsApp to open, which had no limit of its own before, so a host where that connection
takes longer now fails the start too. Either wait running out answers 504 and leaves the
session failed with the reason auth timeout. The start deadline is 30 seconds more than
WWEBJS_AUTH_TIMEOUT_MS (60 seconds at least) and runs over the browser launch and both waits together, not over each, so a start that uses both waits can pass it first;
a start still progressing when it passes also answers 504, but the engine is stopped and the
session is disconnected, not failed.
Fix: Raise the boot/inject wait (in milliseconds) and restart:
WWEBJS_AUTH_TIMEOUT_MS=120000 # allow up to 2 minutes
Leave it unset to keep the 30000 ms default. The start deadline grows with the value. A session
that ends failed is not started again at boot by AUTO_START_SESSIONS: after raising the
value, start it with POST /api/sessions/{sessionId}/start.
Session fails to launch — chrome_crashpad_handler: --database is required
whatsapp-web.js (Chromium/Puppeteer) only.
Problem: The session never starts. The log shows Failed to launch the browser process with chrome_crashpad_handler: --database is required. Seen on hardened,
read_only containers.
Cause: Chromium resolves its home directory from the system passwd entry and
ignores $HOME. The non-root runtime user has no home directory, so on a
read-only rootfs Chromium aborts at launch.
Fix: Give Chromium writable config and cache directories. The bundled image and
docker-compose.yml already do this on a tmpfs /tmp. For a custom container, set
both paths to a writable, existing location and mount a writable /tmp:
XDG_CONFIG_HOME=/tmp/.config
XDG_CACHE_HOME=/tmp/.cache
# Pre-create both as the runtime user, and mount a writable tmpfs at /tmp:
# compose: tmpfs: ["/tmp"]
# k8s: an emptyDir volume mounted at /tmp
Do not work around this by relaxing the container hardening, for example with
seccomp:unconfined. It does not help and it widens the attack surface. Chromium already
runs with --no-sandbox inside the container, which is the confinement boundary.
Session fails with Execution context was destroyed
whatsapp-web.js (Chromium/Puppeteer) only.
Problem: A whatsapp-web.js session fails with a bare Puppeteer
Execution context was destroyed error and no next step. The failure is
usually preceded by a long uptime or a memory-tight host.
Cause: A stale or corrupted browser profile — the Chromium instance can no longer evaluate JavaScript in WhatsApp Web's page context, often after a crash or an OOM kill that left the profile half-written.
Fix: The session card (and the server log) carries a short advisory naming the
stale browser profile. Clear the session's Chromium profile and let the engine
relaunch it — the profile lives under SESSION_DATA_PATH (default
./data/sessions) in the session's LocalAuth-adjacent Chromium directories, so
the simplest recovery is to delete the session's auth folder and re-scan, exactly
as for a corrupted auth folder above. Since v0.14.2 the advisory is surfaced on
the session card too, so you do not need to dig through server logs to learn what
the error means. Note that rolling back across a Chrome for Testing major upgrade on linux/amd64 (v0.31.0's Chrome 158 to v0.30.3's 157, v0.29.0 through v0.30.3's Chrome 157 to v0.28.0's Chrome 156, v0.26.0's 156 to v0.25.0's 153, or v0.23.5's 153 to 146) also causes the older Chrome to clear the newer profile's IndexedDB and start at a QR code unless sessions/ is restored from a backup taken before the first start on the newer image. A source install without PUPPETEER_EXECUTABLE_PATH runs the Chrome that Puppeteer downloads, which moved from 156 to 157 with Puppeteer 25.17.0 in v0.31.0, so a rollback to v0.30.3 or earlier crosses a major there too. The arm64 image runs the chromium package Debian shipped when it was built, whose major can differ between releases. Baileys sessions are unaffected.
A read on a large account fails with Runtime.callFunctionOn timed out
whatsapp-web.js (Chromium/Puppeteer) only.
Problem: One route fails with Runtime.callFunctionOn timed out on an account
with thousands of chats, while everything smaller works and the session stays
ready.
Cause: Every browser command runs against Puppeteer's own budget (180000 ms today). The renderer has not died and the page has not gone away; the single command just did not finish inside that budget, which is why the session does not drop and the next request often succeeds.
Fix: Raise the per-command budget with PUPPETEER_PROTOCOL_TIMEOUT_MS
(v0.23.4+), in milliseconds:
PUPPETEER_PROTOCOL_TIMEOUT_MS=300000
Leave it unset to keep Puppeteer's default. Two values refuse the boot rather than
being clamped, both because they are worse than the default: 0 arms no timer at
all, so a wedged browser would hold the request forever, and anything above
2147483647 overflows Node's timer and fires after 1 ms, so the browser never
finishes launching.
A protocol timeout is deliberately not classified as a dead page, so this
failure never tears the session down. That guard was pinned explicitly in v0.23.4;
behaviour on the current Puppeteer is unchanged. Since v0.23.6 the operations whose
failure would otherwise read as a verdict answer the timeout with a retryable 503: the
group read, the invite-code preview and join, the chats-by-label read, the single-contact
read, and the chat actions (read, unread, archive, clear, delete, and the chat lookup that mute
and pin run first), with a message that starts with WhatsApp Web did not answer. Before
v0.23.6 they reported a false 404, 400 or success: false for a command that never
came back. Since v0.24.0 the chat, group and contact list reads, the mute, unmute, pin and
unpin writes themselves, and the account's own presence change
(PUT /api/sessions/:sessionId/presence) answer the same 503 instead of a 500.
Since v0.31.0 the writes that are safe to repeat (contact, profile, channel, group setting and
label writes, message reaction, edit, delete, star, pin and vote, and deleting a status) and the
reads of channels, labels, message reactions, receipts and history, a group's invite code and join
requests, and a chat's labels answer it too, where they answered a 500. Sends, status posts and
the other writes keep their answer, except that a timeout in the group lookup, or in the check for
the invitation sender made before a group write, answers 503, because nothing has been applied.
Startup logs say install-time engine patches are missing
Problem: Startup logs carry a line like The installed whatsapp-web.js is missing N of OpenWA's install-time patches: …, or the same line naming
@whiskeysockets/baileys. Usually one capability fails while everything around it
works: an unnamed 500 from a single route, a status media send that never
arrives, or an app-state resync that never settles. Two whatsapp-web.js patches added in v0.23.6 fail
more visibly: without patch-wwebjs-media-id, every media send fails with Data passed to getter must include an id property on whatsapp-web.js 1.34.7 (1.34.8, pinned since v0.31.0, ships
upstream's own fix), and without patch-wwebjs-send-error, a send that
WhatsApp Web refuses is reported only as t: t. On Baileys, without patch-baileys-media-stream (added in v0.30.0, bringing the total to 14 install-time patches: 10 whatsapp-web.js and 4 baileys), an inbound media download abandoned at MEDIA_DOWNLOAD_TIMEOUT_MS or MEDIA_DOWNLOAD_MAX_BYTES (or cut off mid-stream) leaves the underlying HTTP response stream without an error listener and can crash the gateway process with TypeError: terminated when the HTTP/2 stream later resets. Since then v0.30.1 added patch-baileys-status-ack and v0.31.0 added patch-baileys-event-buffer and retired patch-wwebjs-block, so v0.31.0 carries 15 patches: 9 whatsapp-web.js and 6 baileys. Without patch-baileys-status-ack (v0.30.2 made it decode the stanza as well as acknowledge it), a Baileys account that WhatsApp sends contact statuses to as top-level <status> stanzas drops its connection about every 50 minutes (Baileys connection dropped; reconnecting with statusCode=500 and reason=Stream Errored (ack)) and stores none of those statuses. Without patch-baileys-event-buffer, a group's later setting changes inside one event-buffer window, the lid to phone pairs of a history sync emitted while the buffer is on, and all but the last RSVP to one event invitation are lost; no route fails.
Cause: OpenWA applies exact source transforms to its engine libraries at
install time. The Docker image applies them strictly, so a shape a patcher cannot
recognise fails the image build. A source install runs them in best-effort mode,
where a patcher that cannot apply prints one line into a long npm install
transcript and the install still succeeds. Since v0.26.0 the Puppeteer compatibility transform, which browser teardown depends on, is the exception: a source install runs it without best-effort, so a source shape it does not recognise aborts npm install. The usual causes are
npm install --ignore-scripts and an upstream engine release whose source shape a
patcher no longer recognises.
Fix: After an --ignore-scripts install, reinstall the engine libraries so the
postinstall patches run, without --ignore-scripts, or run the node scripts/<name>.js
command the startup line gives for each missing patch. Since v0.31.0 the startup line gives
a command for every missing patch (it named the first only) and offers the reinstall for that
cause only: a patcher that refused a source shape it did not recognise fails again the same way,
because the library has moved and the transform needs re-evaluating, so report the message it
printed. Since v0.23.4 each engine checks its own patches as it starts
and names the ones that did not land, so the report reaches the machine that is
actually affected instead of an install log nobody kept. Since v0.28.0 patch-wwebjs-201832.js checks every target site (missingSites()), and if patch-baileys-pairing.js reports a partially applied backport after an interrupted install, run rm -rf node_modules/@whiskeysockets/baileys && npm ci to restore a clean package and re-apply the patch. The report is diagnostic
only: startup continues either way.
A new session links, then drops to disconnected minutes later
whatsapp-web.js only.
Problem: A newly linked session reaches ready, then drops to disconnected a few
minutes later and the device disappears from the phone's Linked devices list. Or it
moves to action_required.
Cause: WhatsApp Web shows a new account a "What's new" onboarding modal that has to be
acknowledged before the linked device may stay linked. OpenWA dismisses it by clicking its
confirm button, but by default it matches only the English label Continue under the
English heading. OpenWA appends --lang=en-US to the browser flags unless
PUPPETEER_ARGS already carries a --lang, but that sets the browser's language only:
WhatsApp Web can still render the modal in the account's own language, and then nothing
is clicked. When the watcher finds a visible dialog it cannot match, it logs a warning
(onboarding_dialog_unrecognized) carrying the dialog's heading and button labels,
minutes before the unlink. On the click
that follows five clicks that left the modal in place, the session moves to action_required
instead. Since v0.31.0 the count restarts whenever a check finds no modal to click, so a flow
of five screens that each dismissed does not trip it (the fifth click did before).
Fix: Add the modal's confirm-button label from that warning to
WWEBJS_ONBOARDING_CONTINUE_LABELS (comma-separated, for example Continuar), then
restart OpenWA itself: the value is read at boot, so stopping and starting the session is
not enough. A configured label is clicked without the English heading check. Since
v0.23.6 it is clicked only on a button inside a visible dialog ([role="dialog"] or
[aria-modal="true"]); before, any visible button with that exact text anywhere on the
page matched, and every such click counted toward the limit above. If the session was
already unlinked, acknowledge the modal once in a browser signed in as that account, then
link the session again.
Frequent disconnections
Problem: A session drops to disconnected every few hours and needs frequent
re-scans.
Cause: A logout from the phone's linked devices, memory pressure, an unstable network, or a blocked IP address.
Fix:
-
Open WhatsApp on the phone → Linked devices and confirm the device is still linked.
-
Give the container more RAM (see High memory usage).
-
Check outbound connectivity from the host.
-
If your hosting IP is being blocked by WhatsApp, route through a residential proxy.
-
Remember the session retries forever by default. The per-session
maxReconnectAttemptsandreconnectBaseDelaybound only the gateway's own reconnect; on Baileys that is only the reconnect after a logged-out close, and every other drop that is not terminal is retried inside the engine with a 1 s to 60 s backoff and no attempt cap, whatever those keys say (see Auto-reconnect mechanics). On either engine, watch forsession.reconnect_loopwebhook events or theopenwa_session_reconnect_loop_alerts_totalmetric to spot a session stuck in a loop. On Baileys (v0.30.0+), each drop logsBaileys connection dropped; reconnecting(action=baileys_connection_dropped) withstageandaliveMs(how long the connection existed), and from the fifth consecutive attemptlastErroronGET /api/sessions/{sessionId}ends with a sentence naming thatstage:stageThe connection closed Sentence appended to lastError(attempt 5+)connectingbefore the connection to WhatsApp opened (network, DNS, proxy, refused upgrade, or connecting deadline) The last connection closed before it reached WhatsApp.registrationwhile the session waited for a QR scan or a pairing code The last connection closed while the session waited to be linked.linkedright after the link was accepted The last connection closed right after the link was accepted.login_unconfirmedbefore WhatsApp confirmed a linked device's login The last connection closed before WhatsApp confirmed the login.login_confirmedafter WhatsApp confirmed the login and before the session opened (while storing and uploading pre-keys) The last connection closed after WhatsApp confirmed the login, before the session opened.openafter the session had opened The last connection had opened before it closed. -
A Baileys session dying with connection replaced (440) means a second instance holds the account — stop the other instance, then restart this one.
-
Account rejected (403) means the number is likely banned — reconnecting won't help.
A Socket.IO client is refused or disconnected
Problem: A client that connects to the Socket.IO root namespace / is refused with
Invalid namespace, or a /events connection closes right after the client sends a large frame.
Cause: Since v0.26.0 only /events accepts clients. Socket.IO always creates the root namespace
and used to accept a connection to it with no checks, so an unauthenticated client could stay
connected outside the handshake limit and the per-key socket limits. A /events connection also
closes when the client sends a frame over 8 KiB, where Socket.IO's default allowed 1 MB; the
subscribe frames of the dashboard and the SDKs are under 1 KB.
Fix: Connect to the /events namespace and keep client frames small. See
WebSockets.
Messaging issues
Messages not sending
Problem: The send call returns 2xx but the message isn't delivered, or it
returns an error.
Cause: Most often a bad recipient format, a disconnected session, rate limiting, or oversized media.
Fix: Match the status code:
| Cause | Status | Fix |
|---|---|---|
Invalid recipient format, including a chatId without a domain such as a bare phone number, or a JSON number (v0.26.0+; on Baileys these answered 500 before) | 400 | Use the JID format 628123456789@c.us |
| Session not connected | 409 | Wait for ready or reconnect the session. A 409 with code: "ENGINE_PAGE_RELOADING" is a whatsapp-web.js page reload: ask again every retryAfterSeconds (see Engine operations return 409 during a WhatsApp Web page reload) |
A send cut short while it ran: on whatsapp-web.js by a WhatsApp Web page reload (v0.31.0+; a bare 500 before), on Baileys by a connection replaced or stopped while the message was being written (the 409 said the session was not connected before v0.31.0) | 409 with no code | The message may or may not have been sent: check the chat before sending again (GET /api/sessions/SESSION_ID/messages?chatId=CHAT_ID serves both engines). A keyed send keeps its Idempotency-Key, so a retry with that key answers IDEMPOTENCY_OUTCOME_UNKNOWN; use a new key only after you checked |
| Rate limited | 429 | Slow your send rate (see Rate limiting) |
| Media too large | 413 | Reduce the file or raise the media cap |
Media url cannot be fetched | 400 (503 when the session proxy fails before any response arrives) | See Media upload fails |
| Baileys: WhatsApp answered a send, reaction, edit, delete, pin or status post with a throttle (code 429) or a timeout (code 408) | 503 (v0.26.0+; 500 before) | Retry after a pause. On 429 nothing was sent, and a keyed send frees its Idempotency-Key (since v0.27.0 the key is also freed on failures before anything is handed to WhatsApp: the session or connection is not ready before the write, a media, sticker or link-preview thumbnail fetch or decode fails, or on Baileys the recipient is not on WhatsApp or the quoted or forwarded message is not stored in that chat; since v0.31.0 also a Baileys media upload that the media host refused, a media url that carries a user name or password, and a whatsapp-web.js video sticker that ffmpeg could not convert). On 408 the outcome is not proven and a keyed send keeps its key taken, so check the chat before sending again with a new key |
| Number not on WhatsApp | Baileys: 400 when WhatsApp confirms unregistered, 503 when its lookup gets no answer (v0.25.0+). whatsapp-web.js: 400 "WhatsApp could not resolve the recipient" when WhatsApp Web cannot resolve an individual recipient | Baileys looks up a phone recipient without a known LID before sending. Retry an unknown lookup; correct a confirmed unregistered number. On whatsapp-web.js the 400 means the number is not on WhatsApp, or the session has no existing chat with it: message it once from the phone, then retry. Other engine or WhatsApp policy failures can still prevent delivery; see Ban risk and safe sending |
A send through the API that fails inside the engine logs a warning,
Send failed in the engine (<type>), carrying the session, chat, message id and the engine's
error (v0.23.6+); before, only Nest's generic [ExceptionsHandler] line recorded it. It is
logged for a failure the gateway cannot classify, a WhatsApp rate limit or a WhatsApp refusal. A
validation refusal, a not-ready 409, a 501, a 503 other than a WhatsApp rate limit, and any
failure raised before the message was handed to WhatsApp (a media url that cannot be fetched, and,
on Baileys since v0.31.0, a media upload the media host refused) log nothing and do not count toward
the send breaker.
POST .../messages/send-product logs no such warning, and a failed bulk item logs
Batch <batchId>: Failed message <n> to <chatId>: <error> instead, as it did before v0.23.6.
On whatsapp-web.js that error now reports what the WhatsApp Web page threw and the build it was
running, where it used to read as a minified t: t, and the same text reaches the bulk batch
result and the message:failed plugin hook. Quote it when you report a send failure. That detail comes from
the patch-wwebjs-send-error install-time patch: on a source install whose startup log names it
among the missing patches, the error still reads t: t until you reinstall; see
Startup logs say install-time engine patches are missing.
Verify a number is on WhatsApp before sending:
curl -H "X-API-Key: YOUR_API_KEY" \
"http://localhost:2785/api/sessions/SESSION_ID/contacts/check/628123456789"
{
"number": "628123456789",
"exists": true,
"whatsappId": "628123456789@c.us"
}
Since v0.14.5 this route answers 503 when WhatsApp did not reply to the lookup,
instead of reporting exists: false. Treat the 503 as "unknown" and retry — a
false here is now always a real answer about the number. Since v0.24.0 this check requires an OPERATOR or ADMIN key.
Recipient JIDs follow a fixed shape:
| Recipient | JID format | Example |
|---|---|---|
| Individual | <number>@c.us | 628123456789@c.us |
| Group | <groupId>@g.us | 120363123456789@g.us |
See Sending messages for the full message API and Groups for group sends.
A send carrying quotedMessageId returns 404
Problem: A send-* call that carries quotedMessageId returns 404 Not Found
with Message <id> not found, while the same call without the field succeeds. On
whatsapp-web.js this case returned 500 before v0.17.0.
Cause: The id does not resolve to a message the engine can quote — it is mistyped,
belongs to a different chat or session, or has fallen outside the engine's lookup
window. Baileys has answered 404 here all along, from its local message store. That store is
cleared when the session's account is unlinked (POST /api/sessions/{sessionId}/logout, or WhatsApp
unlinking the device): every message from before the unlink then answers 404 for a quoted send, a
reply, forward, reaction, edit, delete, star, pin, unpin or button click, and the engine logs Cleared the stored messages of an unlinked account (since v0.30.1). Since
v0.17.0 whatsapp-web.js answers 404 too, instead of surfacing the raw page error as
an opaque 500; the gateway also stops the library from quietly sending the message
unquoted and reporting success.
Fix: Quote an id exactly as the send response or the webhook reported it, from the
same chat and session. If the message is too old to resolve, drop quotedMessageId
and send unquoted — the field is optional on all nine send-* bodies that accept it.
Because the failure is now a typed 4xx, it no longer counts toward the per-session send
breaker, so retrying a stale quote id can no longer latch the cooldown that would 429
unrelated sends. One upstream gap remains on whatsapp-web.js and cannot be switched
off: if the quoted message resolves but the page decides it is not replyable, the
message is sent without the quote and the call still returns 201.
Media sends fail with Data passed to getter must include an id property
whatsapp-web.js only.
Problem: Every image, video, audio, document and status media send fails with Data passed to getter must include an id property (it's how we memoize) but got undefined,
while text sends keep working. It started with the WhatsApp Web builds rolled out on
2026-09-17.
Cause: whatsapp-web.js 1.34.7 builds the outgoing message and then copies the media
model into it, and on those builds the model carries a private __x_id that overwrites
the message id.
Fix: Move to v0.23.6 or later, which carries upstream's one-line fix as an install-time
patch until a whatsapp-web.js release ships it. whatsapp-web.js 1.34.8, which v0.31.0 pins,
ships it with a guard of its own, and the patch still applies beside it. On a source install,
check that the patch landed: if the startup log names patch-wwebjs-media-id among the missing patches,
reinstall as described in
Startup logs say install-time engine patches are missing.
Baileys sessions are not affected.
Video sends fail after 20 seconds with TimeoutError (whatsapp-web.js)
Problem: POST /api/sessions/{sessionId}/messages/send-video (or POST .../status/send-video) on whatsapp-web.js fails after about 20 seconds with 500 (code: "ENGINE_PAGE_ERROR", pageError: { name: "TimeoutError", message: "TimeoutError" }), while image, audio, and document sends succeed.
Cause: Before sending a video, WhatsApp Web loads the bytes into a hidden <video> element in Chromium to read its duration and render a thumbnail, and rejects with TimeoutError when loadeddata does not fire within 20 seconds. Two things commonly prevent loadeddata:
- Non-H.264 video stream (for example HEVC/H.265 from an iPhone or AV1), or a container whose
moovatom sits at the end of the file, which Chromium's bundled codecs cannot decode in time. - Chromium tab occlusion / background throttling when running with
PUPPETEER_HEADLESS=falseand the browser window is minimized, covered, or on an inactive workspace. Since v0.28.0 OpenWA passes--disable-backgrounding-occluded-windows,--disable-renderer-backgrounding, and--disable-background-timer-throttlingonwhatsapp-web.jslaunches and spoofsdocument.visibilityStateas'visible'before each video send, and logs a structuredvideo_load_timeoutwarning withpageVisibility,h264Aac(truewhen the payload is an MP4 withavc1video andmp4aaudio), andbrowser(User-Agent, which begins withHeadlessChrome/in headless mode).
Fix: Check the video_load_timeout warning in the logs:
- If
h264Aacisfalse, transcode the video to H.264 + AAC MP4 (-movflags +faststart) before sending, or pass it throughPOST /api/sessions/{sessionId}/media/convert/videofirst. - If
pageVisibility.visibilityStateis'hidden'(for example when customPUPPETEER_ARGSor a plugin config overrode the launch flags), keep--disable-backgrounding-occluded-windows,--disable-renderer-backgrounding, and--disable-background-timer-throttlinginPUPPETEER_ARGS, or run withPUPPETEER_HEADLESS=true.
First outbound message to an unsaved contact shows as an unnamed @lid chat on the linked phone
Problem: When a session sends its first message to a phone number that is not saved in the account's contacts and has never messaged the account before, the message is delivered to the recipient, but on the sender's linked phone it appears under a separate, unnamed @lid thread until the recipient replies.
Cause: WhatsApp's multi-device protocol assigns a privacy-preserving Linked Identity (@lid) to the conversation. Until the recipient's device sends a message or receipt carrying the phone-to-LID mapping, or the gateway resolves and pairs them, the phone UI may display the @lid thread separately from the phone number. Since v0.28.0 OpenWA seeds the lid_mappings pair before the send on whatsapp-web.js (getContactLidAndPhone) and records the pair from Baileys onWhatsApp results during recipient resolution, reducing how often this occurs.
Fix: You can also pre-check and seed the mapping before sending by calling GET /api/sessions/{sessionId}/contacts/{number}/lid (v0.27.1+), or save the contact on the linked phone. Once the recipient replies, WhatsApp merges the thread automatically.
Messages sent while the gateway was down never arrive (Baileys)
Problem: On a Baileys session, messages that contacts sent while OpenWA was stopped or
disconnected are missing: no message.received, and nothing stored for them, so neither
GET /api/sessions/{sessionId}/messages nor the dashboard's Chats thread shows them. Messages the
account typed on its phone during that window never produce message.sent either.
Cause: When the linked device reconnects, WhatsApp replays what it queued for it, and
Baileys tags that replay append, the same tag as its echo of an API send. Before v0.23.6
the gateway treated such a batch as history: it skipped every message in it older than the
reconnect, and every message the account sent itself, so the whole outage window was
dropped without being stored or dispatched.
Fix: Move to v0.23.6 or later. The replay is now stored and dispatched like live
traffic, and a message the account sent from its phone during the outage is recorded and
dispatched as message.sent, along with the phone's reactions, edits and revokes from that
window. Messages dropped on an earlier release are not replayed again, because WhatsApp does
not re-deliver what the device already acknowledged.
Webhook not firing
Problem: Messages arrive in WhatsApp but your webhook endpoint is never called.
Cause: No webhook is configured for the session, a filter is suppressing the
event, the URL is unreachable from the container, or your endpoint returns a
non-2xx and exhausts the retries.
Fix:
# 1. Confirm a webhook is registered for the session — note its id. `active` must be
# true, `events` must list the event (or "*", which does not cover `message.receipt` since
# v0.26.0), and `filters` must not exclude it.
curl -H "X-API-Key: YOUR_API_KEY" \
http://localhost:2785/api/sessions/SESSION_ID/webhooks
# 2. Force a delivery with the built-in test endpoint (WEBHOOK_ID from step 1).
# It POSTs a test payload to your URL and returns the delivery result.
curl -X POST -H "X-API-Key: YOUR_API_KEY" \
http://localhost:2785/api/sessions/SESSION_ID/webhooks/WEBHOOK_ID/test
# 3. Read the delivery-failure list, most recent first: deliveries that exhausted
# every retry, and deliveries never sent (attempts 0). Requires an ADMIN key — an operator key gets a 403.
curl -H "X-API-Key: YOUR_ADMIN_API_KEY" \
"http://localhost:2785/api/webhooks/delivery-failures?sessionId=SESSION_ID&limit=20"
# 4. Attempts still inside their retry window appear only in the server logs
docker compose logs openwa-api --tail=200 | grep -i webhook
# 5. Confirm your endpoint accepts an unauthenticated POST quickly
curl -X POST https://your-app.example.com/webhook \
-H "Content-Type: application/json" \
-d '{"test": true}'
Read steps 1 and 3 together. A delivery-failure row carrying an HTTP lastStatusCode
means OpenWA delivered and your receiver rejected it — fix the receiver. A row with
attempts: 0 and no lastStatusCode was recorded before OpenWA sent anything (an
overflow, an oversize payload, a shutdown refusal or a preflight failure), or when a
shutdown stopped a direct delivery in a retry backoff: read its lastError. An empty
list with lastTriggeredAt still null means nothing was ever delivered and
nothing failed or was refused: the event either never matched this webhook, or was
never emitted for the session at all. lastTriggeredAt stays null until a real
2xx delivery — the Test button never sets it, so a green test proves the
endpoint is reachable and nothing more.
A lastError (or a Test result) that reads URL must not contain credentials (userinfo) means the webhook's URL carries a user name or password and the gateway will not deliver to it: update the webhook with a URL without them, and send the credential in a header instead. Since v0.31.0 that text no longer repeats the URL, credentials included, as a stored failure did before.
message.receipt (Baileys, v0.26.0+) is opt-in and bounded per receiving webhook, so a burst of
per-recipient receipts can be dropped without a row in the delivery-failure list. A quarter of
WEBHOOK_DISPATCH_CONCURRENCY deliveries run at once, shared by the session's webhooks that name
the event, and three quarters of WEBHOOK_DISPATCH_MAX_QUEUED events wait; further receipts are
dropped before any outbox or failure row is opened, are not replayed, and are counted in
openwa_webhook_delivery_failures_total, with a webhook_opt_in_dropped warning in the log. One
session's receipt deliveries together never take more than a quarter of the shared slots.
With QUEUE_ENABLED=true, a delivery waiting in the queue is checked against the webhook as it
stands when each attempt runs (v0.23.6+), and with the queue off, which is the default, so is
every retry (v0.24.0+). If the webhook was deleted, disabled or unsubscribed from the event in
the meantime, the delivery is dropped with a webhook_skipped_stale warning in the server log:
no further attempt, no retries and no delivery-failure row. After a URL, header or secret
change, such a delivery goes to the new URL with the new headers, and is signed with the new
secret when the webhook has one. Before v0.23.6 a queued delivery kept the URL, headers and
signature it was queued with.
A filter runs before dispatch, so an event it dropped leaves no row in the
delivery-failure list. An is condition (on a boolean field, one compared with true),
or a contains or equals condition with a non-empty value, on a field the event's payload
does not carry cannot match, and so suppresses that event entirely — a
sender condition, for example, drops every message.ack, message.failed, and
message.reaction. An isNot condition, or a boolean compared with false, passes such
an event instead. Since v0.25.0 message.ack and message.failed carry the chatId when
the engine's update names the chat, so a chatId exclusion (v0.23.6+) drops the receipts
of the excluded chat, while a receipt whose chat is unknown, such as an older retained
payload, passes an exclusion and fails an inclusion. Write a group as its full <id>@g.us id: bare
digits read as a phone (<digits>@c.us) and never match a group, so a chatId is
condition holding digits alone suppresses every event of that group. Before v0.23.6 a
condition whose value was an @lid id stopped matching once the gateway learned that
identity's phone number, so an inclusion went quiet and an exclusion began delivering while
the rule still read correctly; v0.23.6 resolves both sides through the same mapping. Set
LOG_LEVEL=debug and look for webhook_filter_suppressed, which names the event and
the payload fields that were actually available. See
Filter events before delivery.
Your endpoint must return a 2xx quickly. OpenWA retries failed deliveries with a
backoff that grows from a base delay, controlled by these environment variables:
| Variable | Default | Controls |
|---|---|---|
WEBHOOK_TIMEOUT | 10000 | Per-attempt timeout, in milliseconds |
WEBHOOK_RETRY_DELAY | 5000 | Base delay between attempts, in milliseconds |
How many attempts a delivery gets is not an environment variable: retryCount is a
field on each webhook record, defaulting to 3 and settable when you create or
update the webhook, so two webhooks on one instance can retry a different number of
times. It counts total attempts, including the first, so 0 and 1 both mean a single
attempt with no retry.
If the container can reach the public internet but not your endpoint, the URL is
probably resolving to a host-only address. Use host.docker.internal (Docker
Desktop) or the service name on a shared Docker network rather than localhost.
See Webhooks for the event list and payload shapes.
Media upload fails
Problem: A send returns 413 Payload Too Large, or media won't upload.
Cause: OpenWA enforces two separate limits. A media file may not exceed
MEDIA_DOWNLOAD_MAX_BYTES (default 50 MiB), whether it is decoded from base64 or
downloaded from a url, and the whole HTTP request body is bounded by
BODY_SIZE_LIMIT. A base64 payload counts against both; a url counts only against the
media cap.
Fix:
- Prefer sending media by URL for large files: the gateway downloads it server-side
instead of inflating your request body. The download is still held to
MEDIA_DOWNLOAD_MAX_BYTES, and the gateway holds the whole body in memory while the send runs: at least twice its size at the peak, and on whatsapp-web.js more while the page call that carries it is in flight. Size the container memory for the large sends you run in parallel. - If you must send large base64 media, raise both limits and restart:
MEDIA_DOWNLOAD_MAX_BYTES=104857600 # 100 MiB media cap
BODY_SIZE_LIMIT=120mb # whole-request body limit
BODY_SIZE_LIMIT reaches the container only on v0.10.2+Under the bundled Compose files, a BODY_SIZE_LIMIT set in .env is passed through to
the container only on v0.10.2 and later. On earlier versions the value stayed on the
host and the app's 25 MB default applied — upgrade before tuning this limit.
A request that exceeds the media cap returns 413 Payload Too Large with the
standard error envelope — a statusCode, a message, and an error string. There
is no code field on this response; branch on the status, not on a payload code.
A media url is fetched by the gateway, and since v0.23.6 a fetch that fails is reported
as your request's fault rather than as a server error: 400 when the URL answers a
non-2xx status other than a redirect, times out or fails to connect, and 413 when the
download passes MEDIA_DOWNLOAD_MAX_BYTES. Before, both answered 500 and counted toward
the send breaker. A URL whose host does not resolve, that points at or resolves to a blocked
internal address, or that answers with a redirect is refused with 400 Destination address is not allowed (on a status post or a profile or group picture change since v0.31.0, which answered
500 before); point it at a public host that serves the file directly. SSRF_ALLOWED_HOSTS does
not lift the refusal of a redirect: send the address the redirect leads to. On a send, a status
post, a profile or group picture change, a media conversion and a bulk item the server log names
the reason as Outbound media fetch blocked by SSRF guard: ..., which reads Refusing to follow redirect from <url> for a redirect (before v0.31.0 only a send wrote it). A url that carries a user name or password is refused with 400 Media URL must not contain credentials (userinfo) before any connection, on every route that fetches a media url
(it answered 500 before v0.31.0, and on a send, a bulk item or a status post it counted toward the send breaker), and send-bulk refuses a
batch whose literal item url carries them when the batch is created (a url built from variables is checked per item once rendered, and that item fails). A download that runs past MEDIA_DOWNLOAD_TIMEOUT_MS (default 30000) answers
400 Media fetch timed out after <n> ms; raise that variable for a slow media host. Since v0.23.6 a url that is not an absolute http(s) URL is refused with 400 up front
instead of being sent as garbled base64.
Since v0.23.6 the fetch also leaves through the session's egress proxy when the session has
one, and a failure there before any response arrives answers 503: the proxy and the target
behind it cannot be told apart, and nothing was sent, so the call is safe to retry. If the
session proxy is a WhatsApp-only route that cannot reach arbitrary media hosts, set
SESSION_PROXY_URL_FETCH=false so those fetches leave from the gateway's own address again.
A Baileys contact list is missing contacts
Problem: On a Baileys session, GET /api/sessions/{sessionId}/contacts lists fewer
contacts than the phone's address book, most visibly after OpenWA restarts.
Cause: The Baileys contact store lives in memory, and WhatsApp sends neither history nor an address-book snapshot to a device that has synced once. Before v0.23.6 a restarted gateway therefore listed only the peers it had seen since the restart, the initial sync often left the address book partial, and on a busy session peers seen once in a group or a broadcast evicted saved contacts from the capped store.
Fix: Move to v0.23.6 or later. Each session now re-pulls the saved address book once
per engine start (a fresh link pulls it once its initial sync goes quiet), and
BAILEYS_SESSION_STORE_MAX_ENTRIES now bounds only the peers, never the saved contacts.
The list is the saved address book only: a peer known by its pushname alone is no longer
listed, although GET /api/sessions/{sessionId}/contacts/{contactId} still resolves it
with isMyContact: false. whatsapp-web.js still lists unsaved chat partners.
Incoming calls are never reported (whatsapp-web.js)
Problem: A whatsapp-web.js session delivers messages normally but never emits
call.received.
Cause: whatsapp-web.js detects a call through a hook it installs in the WhatsApp Web
page, and installs it only when the page's call module exposes the method it expects. A
WhatsApp Web build without that method leaves calls undetected while everything else keeps
working. Since v0.23.6 a session that reaches ready without the hook logs a warning
(call_hook_missing). The check stays quiet when it cannot tell, and is skipped when the
patch-wwebjs-ready-sync install-time patch is missing.
Fix: A restart helps only if the page was in a transient state; if the warning
repeats, the library needs an update. Incoming-call handling is a Baileys feature in any case:
only Baileys emits the call outcome events (call.accepted, call.rejected, call.missed),
call rejection and autoRejectCalls work only there, and call.received is not reliable on
whatsapp-web.js. Creating a call link (POST /api/sessions/{sessionId}/calls/link) works on
both engines. Since v0.23.6 POST /api/sessions/{sessionId}/calls/{callId}/reject
answers 501 on whatsapp-web.js instead of a 200 that did not stop the call ringing.
Run the gateway with ENGINE_TYPE=baileys to keep call events. The setting applies to every
session on the instance. Baileys keeps its own auth directory, so a session must be linked
again unless it still holds a Baileys link from an earlier run.
Engine query failures
Unanswered WhatsApp query (503)
Problem: A call that used to return 200 — with an empty list, exists: false,
url: null, or a plain "done" — now returns 503 Service Unavailable. Or one that
used to fail with an opaque 500 now returns 503 instead.
Cause: The socket is up, the query went out, and WhatsApp never replied within the
30-second request budget the gateway owns. Since v0.14.5 that outcome has a status of
its own instead of being folded into a normal-looking answer. A 503 here is a
statement about the query, not about the resource:
| Route | Used to answer | Answers now |
|---|---|---|
GET /api/sessions/{sessionId}/groups | 200 [] — identical to "you are in no groups" | 503 |
GET /api/sessions/{sessionId}/groups/{groupId} and /groups/join-info | A bare 500 | 503 |
GET /api/sessions/{sessionId}/contacts/{contactId}/profile-picture | 200 { "url": null } — identical to "no picture set" | 503 |
GET /api/sessions/{sessionId}/contacts/check/{number} | 200 { "exists": false } | 503 |
POST /api/sessions/{sessionId}/chats/read | A bare 500 | 503 |
| Channel lookup, subscribe, unsubscribe, delete, mute | A bare 500 | 503 |
| Channel owner transfer and admin demote — Baileys only | Nothing; both routes are new in v0.16.0 | 503 |
Group and profile writes, chat actions, label writes, call rejection on Baileys (on whatsapp-web.js a rejection answered 200 through v0.23.5 and answers 501 since v0.23.6) | 200 — success for a change nothing confirmed | 503 |
| Group participant writes — add, remove, promote, demote | 200 with a results array, identical to a batch nothing confirmed | 503 |
Other routes answer 503 because the whatsapp-web.js page connection died mid-request,
so there was no deadline to expire, only a connection that stopped answering. Listing a
session's chats and listing the chats that carry a label
(GET /api/sessions/{sessionId}/labels/{labelId}/chats) have declared it since v0.15.0,
and the label-chats behaviour predates the declaration. v0.23.4 declared it on thirteen
more routes: seven message operations (react, edit, pin, unpin, vote on a poll, read
history, read reactions), the contact list and the single-contact read, the three label
reads, and deleting a status. All but two of those used to surface a dead page as a bare
500; the single-contact read and the status delete already answered 503, and v0.23.4
only declared it. The fix below still applies.
On Baileys, a send, reaction, edit, delete, pin or status post that WhatsApp answers with a throttle
(code 429) or a timeout (code 408) answers 503 since v0.26.0, where it answered 500. On 429
nothing was sent, and a keyed send frees its Idempotency-Key. On 408 the outcome is not proven (a
status post may have been published) and a keyed send keeps its key taken.
Fix: Retry the call. Reads are safe to repeat, and every write bounded this way is
safe to repeat too — the change may or may not have landed, which is exactly what the
status says. If 503 persists on a session, the connection is the real problem: check
status and engineLoaded on the session (whether the gateway holds a live engine for it;
on a multi-node deployment it is also true when another node runs the session, so reconnect
it on that node) and reconnect it. Note that a genuinely slow
write that lands just after the deadline is reported as unconfirmed; that is the
deliberate trade for never reporting an unacknowledged change as done.
On whatsapp-web.js, a 503 whose message starts with WhatsApp Web did not answer
(v0.23.6+) is a different case: one browser command outran Puppeteer's protocol timeout on the
group read, an invite preview or join, the chats-by-label read, the single-contact read or a chat
action. Since v0.24.0 the chat, group and contact list reads, the mute, unmute, pin and unpin
writes themselves, and PUT /api/sessions/{sessionId}/presence answer it too. The session stays
ready, so reconnecting it does not help. If it recurs on a large
account, raise PUPPETEER_PROTOCOL_TIMEOUT_MS; see
A read on a large account fails with Runtime.callFunctionOn timed out.
Since v0.31.0 the repeatable writes and the reads listed there answer the protocol timeout the same way.
Since v0.31.0 a whatsapp-web.js route that sends its change in the page also answers by the status
WhatsApp itself gives, where every status of the group writes answered 403 naming missing admin
rights: a rate limit, a timeout or a server error (408, 423, 429 or 5xx) is a retryable 503, and any
other refusal a 403. That covers the group subject, description, picture, announce, locked and
member add mode writes, deleting a group picture, setting or deleting the account's profile picture,
and reading or revoking a group invite code. A refused announce or locked write now answers 403,
where it answered 200 (and a bare 500 for an account that may not set them), and deleting the
picture of a group that has none answers 200, so a repeat converges. A group join and an invite preview answer the 503 too
(a good invite code answered 400 or 404 before), and so does a pin or unpin when WhatsApp fails the
read of the group in front of the send (a bare 500 before). On these 503s nothing was changed or
sent, so retry after a pause, except that the message of a member add mode change says it may have been
applied in part. A channel delete, mute or unsubscribe that WhatsApp Web reports in the same way answers a 503
that says the operation may or may not have been applied: check the channel before repeating it (an
unsubscription from a suspended channel stays 403).
Creating a group, creating a channel, the media send path, the four status posts and
creating a call link are deliberately left unbounded and, once WhatsApp has been asked, never
answer 503 for an unconfirmed or timed-out write, so a client that retries on 503 cannot leave a duplicate group, channel,
message, status or call link behind. The channel create, the status posts and the call-link create joined that
set in v0.23.4, where a dead page there began answering 500 instead of 503 because a
replayed POST would publish twice; POST /calls/link also dropped the 503 it used to
declare. Deleting a status is the deliberate exception and keeps its 503, since
revoking an already-revoked status converges. That absence is the guarantee; the status a
failure on the unbounded set carries is not contractual, so verify the outcome rather
than branching on a specific code. The one 503 the media sends and status media posts
declare, since v0.23.6, comes before the send: a media url fetched through the
session's proxy that failed before any response, so nothing reached WhatsApp. The group and
channel creates declare one 503 of their own since v0.24.0: on Baileys, a create that
WhatsApp rate-limited (code 429) was turned away before it ran, so nothing was created and
retrying after a pause is safe. A timed-out create is still not answered 503.
A group or channel call returns 5xx where it returned 4xx
Problem: After upgrading to v0.14.5 or later, code that branched on 403, 400,
or 404 from the Baileys group and channel routes sees a 5xx instead.
Cause: The helper that decided whether a Baileys failure was a refusal by WhatsApp
or a death of the transport matched every failure, so a closed socket was reported as a
client error: the group and channel writes answered 403 admin rights or permissions may be missing, POST /api/sessions/{sessionId}/groups/join answered 400 with the
same "invite code may be invalid" message as a genuinely bad code, and
GET /api/sessions/{sessionId}/groups/join-info answered 404. A transport failure
now propagates as a 5xx.
Fix: Keep the existing 4xx handling for genuine refusals and treat 5xx as a
retryable transport failure. If your client retried on 403 to work around this,
stop — the retry now belongs on the 5xx. If it surfaced "invalid invite code" to end
users, it will now correctly report an outage instead. The three profile writes were
never affected; they do not go through that helper.
Engine operations return 409 during a WhatsApp Web page reload
Problem: After upgrading to v0.15.0, engine routes that used to return 500 (or
the five chat write endpoints that returned 200 {success:false}) during a WhatsApp
Web page reload now return 409 Conflict.
Cause: WhatsApp Web periodically reloads its own page (measured ~5 minutes after
a fresh pairing, among others). While whatsapp-web.js re-injects into the reloaded
page, every engine route now answers the documented retryable 409 naming the reload.
Before v0.15.0, the same window surfaced raw TypeError 500s on most routes, and the
five chat write endpoints — read, unread, archive (unarchive is the same
endpoint with archive: false), typing and clear — answered 200 {success:false}.
Fix: Retry on a timer. Since v0.31.0 the 409 body carries code: "ENGINE_PAGE_RELOADING"
and retryAfterSeconds (5), the interval to ask again at, so match on the code: the message
changed in the same release from Retry in a few seconds. to Retry every few seconds: this can last a few minutes. Do not wait for a session.status → ready event:
the session never leaves ready across a reload, so that event is never emitted and a
listener waiting for one waits forever. The window is bounded at 60 seconds after the last
navigation (NAVIGATION_REINJECT_GRACE_MS, a build-time constant with no environment
override) and at 180 seconds after the first navigation of the reload (NAVIGATION_EPISODE_CAP_MS, three of those windows, shared by a page that keeps navigating). Ask again every
retryAfterSeconds for up to about 5 minutes, and treat a 409 that outlasts that as a page
that is not healing: past the cap the liveness watchdog stops being suppressed and
handles the session as disconnected after two failed probes a minute apart, about two more
minutes, and that transition does emit session.status. A retry is safe: the request was
refused before it reached the page, or is a read or a write that converges when repeated. The
exceptions are a repeat of a channel delete that the first attempt had already applied (it
may meet a channel that is gone, which answers 403) and a repeat of an unsubscription (it may meet a
channel that is no longer followed).
A send, reply, forward or status post that a reload cuts once the message was handed to the page (a reload that cuts the chat read in front of a reply or forward gets the coded 409 above, and nothing was sent) answers a different
409 since v0.31.0 (a bare 500 before, which counted toward the send breaker). It has no
code and says the message may or may not have been sent: WhatsApp Web reloaded its page while the message was being sent, and it may or may not have been sent. Check the chat before sending it again. A status post says the same of the post. Check the chat or your status
before sending again. A keyed send keeps its Idempotency-Key, so a retry with that key
answers 409 IDEMPOTENCY_OUTCOME_UNKNOWN. A send or forward that meets a reload after its
first attempt had already run answers this 409 too, where it was told to retry before.
The send breaker counts only failures that reached WhatsApp, so a typed 4xx such as
this 409 does not add to it. That exemption is not new in v0.15.0 — it has held
since the breaker shipped in v0.14.0; what v0.15.0 changed is that the reload failure
became a typed 409 instead of a raw 500, which the exemption then covers. The
breaker only runs at all when you set SEND_PACING_ENABLED=true; it is off by
default, and its cooldown is 15 minutes.
Since v0.26.0 the same retryable 409 covers more. A group, contact, label or invite lookup that a
reload cut short no longer reports the group, contact or label as not found (404), and a send,
status post, profile, group, label, mute or pin request that races a session teardown answers 409
instead of 500 or 503. Accepting a group invite that a reload cut short answers 503, because
the join may have landed: check the group before retrying.
Since v0.31.0 the retryable 409 also answers a read, a write that is safe to repeat, the invite-code
revoke, the check made before adding participants, the group subject, description, picture,
announce, locked and member add mode writes, the account's profile picture change, and deleting
or unsubscribing from a channel when they reach a page that has not finished loading, where they
answered a bare 500 (or 404 for a group, contact or label lookup). A reply or forward whose chat
read a reload cut answers it too once the page has kept reloading past the grace window, where it
answered a 500 that counted toward the send breaker and kept the Idempotency-Key. A session promoted to ready after its ready event was missed (the log
says WhatsApp Web ready event was missed; reconciling from connected runtime state) no longer answers
this 409 for up to a minute when WhatsApp Web had navigated while it authenticated, unless
another navigation landed meanwhile.
A session whose WhatsApp Web page shows the "What's new" screen in a language the gateway does not
recognise logs an onboarding_dialog_unrecognized warning: see
A new session links, then drops to disconnected minutes later.
Creating a group returns 501
Problem: After upgrading to v0.16.0, POST /api/sessions/{sessionId}/groups
returns 501 Not Implemented with Operation not supported by the active engine: createGroup on a whatsapp-web.js session.
Cause: whatsapp-web.js still declares createGroup, but its page code reaches a
WhatsApp Web internal that no longer exists, so every call already failed — as an
opaque 500 rather than a stated refusal. Since v0.16.0 the adapter refuses up front
instead of attempting the creation. whatsapp-web.js is the default engine, the one you
get with ENGINE_TYPE unset, so a default deployment sees this. Bare and
@c.us-qualified participant ids fail identically, and the gap cannot be patched
around — the missing function belongs to the WhatsApp Web page, not to the library.
Fix: Create groups on the Baileys engine: set ENGINE_TYPE=baileys on the
instance that creates them (the setting applies to every session on it). The route, its
body, and its Baileys behaviour are unchanged. Every other group route works on both engines,
with these exceptions: PUT .../groups/{groupId}/settings answers 501 on
whatsapp-web.js when the patch carries ephemeralSeconds, PUT .../groups/{groupId}/member-label
(v0.27.0+) answers it there too, and, since v0.31.0, a route answers it when the WhatsApp Web build the session
runs lacks the job it sends with (see
A whatsapp-web.js route answers 501 on a WhatsApp Web build without its job). Note that a
whatsapp-web.js session which is not yet ready answers 409, not 501 — the
readiness check runs first, so wait for ready and retry before concluding the engine
refused.
A whatsapp-web.js route answers 501 on a WhatsApp Web build without its job
whatsapp-web.js only.
Problem: Since v0.31.0 a group, profile or pin route answers 501 on a whatsapp-web.js session
with a message that ends on this build), such as Operation not supported by the active engine: setGroupSubject(no write job on this build).
Cause: These routes send their request through a job inside the WhatsApp Web page, and the
build the session runs has none the gateway can call. Nothing was asked of WhatsApp, so the group,
picture, invite code or pin is unchanged. The routes are the group subject, description and picture
writes, PUT .../groups/{groupId}/settings for announce, locked or memberAddMode,
DELETE .../groups/{groupId}/picture, GET .../groups/{groupId}/invite-code,
POST .../groups/{groupId}/invite-code/revoke, POST .../groups/join, GET .../groups/join-info,
PUT and DELETE .../profile/picture, PUT .../profile/status, and POST .../messages/pin and
/messages/unpin. The 501 follows the build, not the engine: Baileys serves all of them. A call
that a page reload lands on answers the retryable 409 of
Engine operations return 409 during a WhatsApp Web page reload
instead, because a document that has just reloaded has not defined its jobs yet.
Fix: A 501 does not change on repeat while the session runs that build. Use the route on the
Baileys engine, or wait for a WhatsApp Web build that carries the job; WWEBJS_WEB_VERSION requests the
build the session runs (a pin is not guaranteed to hold: a ready session logs the build its page runs as web_version_running, or, when it is not the pinned one, warns with web_version_pin_not_applied instead).
Authentication issues
Every request returns 401
Problem: All authenticated endpoints return 401 Unauthorized, even ones that
worked before.
Cause: The X-API-Key header is missing, misspelled, or carries the wrong key.
Fix: Send the header on every request to an authenticated route. The name must be
spelled X-API-Key, but its casing does not matter: HTTP header names are
case-insensitive and the guard reads the lowercased form, so x-api-key authenticates
just as well. The value is compared exactly.
# Wrong — no key, returns 401
curl http://localhost:2785/api/sessions
# Right
curl -H "X-API-Key: YOUR_API_KEY" http://localhost:2785/api/sessions
The health endpoints (/api/health, /api/health/live, /api/health/ready) are
unauthenticated by design — use them to confirm the server is up without a key. See
Authentication for how keys are issued and rotated.
A valid key gets 403
Since v0.24.0 a valid key refused by allowedIps or allowedSessions gets 403, including on Bull Board. A missing, unknown, revoked, or expired key gets 401. Check the caller's address through TRUSTED_PROXIES and the key's session list before replacing a working key.
Recover a lost admin key
Read the bootstrap file (data/.api-key, or BOOTSTRAP_KEY_FILE) or your configured API_MASTER_KEY first. On Compose use docker compose exec openwa-api cat /app/data/.api-key; on Helm use kubectl exec openwa-0 -- cat /app/data/.api-key. The file can outlive a demotion or scope change, so a key read there still needs an active ADMIN role and permission to manage keys.
If another unrestricted ADMIN key works, use it to create a replacement and revoke the lost key. Otherwise stop the instance, back up main.sqlite, and replace only the lost key's row with a hash generated by the gateway under the same API_KEY_PEPPER. This preserves every other key; resetting the key table does not. Follow the complete recovery procedure, including the Helm helper pod steps. Changing API_MASTER_KEY alone does not replace an existing database row.
A chat-scoped key gets 403
A key carrying allowedChats reaches only routes explicitly open to chat scopes. GET /api/sessions, deployment-global administration, webhooks, bulk status/cancel, and Bull Board remain closed. A quoted message must be sent through POST /api/sessions/{sessionId}/messages/reply. A closed route returns API key is restricted to selected chats; an open route naming an outside chat returns API key not authorized for this chat.
Since v0.24.0 the group, contact, and label-chat lists filter to allowed chats. Stored messages require an allowed chatId. Since v0.25.0 built-in search, group detail/settings, chat WebSocket events, and chat-scoped MCP reads/sends also accept these keys. Plugin search remains refused. Session-level WebSocket events remain closed and subscriptions must name an explicit session; /events also enforces room and chat-list limits.
POST /api/auth/validate remains closed, so these keys cannot sign in to the dashboard and an SDK's auth() check fails. Test with an allowed session/chat route instead. See Scope a key to chats for the route and event boundaries.
Search returns 400 or 501
Since v0.25.0 GET /api/search accepts at most 1000 characters and 32 words (and since v0.27.0 rejects NUL characters). Punctuation separates words under match=word, standalone symbols and emoji count, and a repeated whitespace-separated word counts once. Shorten q; raising SEARCH_LIMIT_MAX changes result count, not query limits. The offset ceiling remains 100000. SQLite match=word results for a session- or chat-restricted key omit score but remain in relevance order (match=contains includes score for every key). Since v0.26.0 a dateFrom or dateTo outside the safe integer range (plus or minus 9007199254740991) also answers 400, and the OpenAPI schema publishes that range; on PostgreSQL a value past about 9.2e21 answered 500 before. Since v0.27.0 GET /api/search?match=contains requires SEARCH_CONTAINS_ENABLED=true and a completed background trigram index build (idx_messages_body_trgm with pg_trgm and unaccent on PostgreSQL, or messages_trgm FTS5 on SQLite 3.45+), and answers 400 when q has no term of 3 or more characters after folding (on PostgreSQL, 3 or more letters or digits in a row) or when all deduplicated terms exceed 64 characters combined, or 501 while SEARCH_CONTAINS_ENABLED=false (the default), while the trigram index is still building in the background after startup, or when PostgreSQL lacks pg_trgm/unaccent or SQLite is older than 3.45.
Performance issues
High memory usage
Problem: The container uses a large amount of RAM, or the host OOM-kills it.
Cause: With the default whatsapp-web.js engine, each session runs its own Chromium instance (roughly 300–500 MB RAM). Total memory scales with session count.
Fix: Size the memory cap to your session count, trim Chromium flags, or switch to the lighter engine.
The bundled Compose files cap the container at 2 GB. Raise or lower the cap with
OPENWA_MEM_LIMIT and recreate the container, which restarts the gateway:
OPENWA_MEM_LIMIT=4g docker compose up -d
On the whatsapp-web.js engine, PUPPETEER_ARGS sets the Chromium launch flags. It replaces
the default list (--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu),
so repeat the flags you want to keep.
Switching to ENGINE_TYPE=baileys removes Chromium entirely and dramatically lowers
per-session memory. See Scaling for capacity planning.
Database locked (SQLite)
Problem: Writes fail intermittently with SQLITE_BUSY or "database is locked,"
and response times spike.
Cause: SQLite serializes writes. Under concurrent sessions or a write-heavy workload, writers contend for the single database lock.
Fix: A writer already waits up to 30 seconds for the lock before it fails, so a
SQLITE_BUSY that still reaches the log means the lock was held longer than that, by write
load or by a backup copy in progress. If it recurs outside a backup, plan a move to
PostgreSQL. SQLite keeps no list of running queries, so name the process that holds the file
instead: lsof ./data/openwa.sqlite on a host (the default data database; DATABASE_NAME
overrides the path), and in the container, which has ps but neither lsof nor fuser,
docker compose exec openwa-api ps aux to look for a second sqlite3 session or a running
scripts/backup.sh.
Since v0.26.0, POST /api/sessions, DELETE /api/sessions/{sessionId} and
DELETE /api/integration/plugins/{pluginId}/instances/{instanceId} also wait up to 10 s on SQLite
for another open database transaction, because every query shares one connection. When it stays
open they answer 503: the create stored nothing and the instance delete deleted nothing, while a
session delete may already have committed earlier batches. Retry after the transaction ends.
Past roughly 5 concurrent sessions, or for any write-heavy deployment, switch the
Database adapter to PostgreSQL. See the Migration guide.
Docker issues
Volume permission denied
Problem: "Permission denied" when writing to the data directory; auth files don't persist across restarts.
Cause: The container was started as a non-root user (docker run --user, or user: in
Compose) that cannot write the bind-mounted host directory. A default start runs as root and
re-owns /app/data to uid 997 itself, so it does not hit this.
Fix: On a Docker daemon that runs as root, with --user 997:997 (the image's openwa user),
give that user the directory:
sudo chown -R 997:997 ./data
docker compose restart openwa-api
A save from the Infrastructure page (PUT /api/infra/config) that cannot write the configuration overlay is not an HTTP error: it answers 200 with saved: false and a message such as Failed to save configuration: data/.env.generated could not be written (EROFS). The server log has the cause. Since v0.31.0 the message names the overlay relative to the working directory and the error code, and the full error, with the host path it carries, is in the server log only; a failure before the write answers Failed to save configuration. The server log has the cause. For a permission cause, apply the fix above.
A stop ends with exit 137 or takes the full grace period
Use at least 75 s termination grace, plus any increase in SHUTDOWN_DELAY_MS over 3 s and WEBHOOK_SHUTDOWN_DRAIN_MS over 5 s. v0.25.0 gives teardown 67 s after the default shutdown delay, then exits 1 if it stalls. A custom spec starting as root after dropping all capabilities needs KILL alongside the ownership and privilege-drop capabilities so the init process forwards the signal.
On Helm, plain --reuse-values retains the earlier 45 s grace and capability list without KILL. Upgrade with --reset-then-reuse-values (Helm 3.14+) or a reviewed -f values.yaml, updating any explicit old overrides. A blocked synchronous SQLite write can still delay shutdown timers until the orchestrator kills the process. Use /api/health/live for liveness: /api/infra/health returns 503 during teardown. See shutdown settings.
A large database makes the pod restart during boot
v0.25.0 builds three message-window indexes without concurrent builds, adding about 240 MB per million messages. PostgreSQL writes wait for the migration transaction to commit. The Helm startup probe defaults to 5 s and 60 failures, about 295 s; raise startupProbe.failureThreshold or run migrations before starting the app. The first boot on v0.26.0 adds to that. It converts the legacy messages.type values in one statement inside the same transaction (about a minute per million legacy rows on PostgreSQL, with the port closed), builds an index on webhook_outbox_events, and on SQLite checks the message search index against all stored text and rebuilds it when they differ. Plugin restore can also hold the port closed for up to 60 s.
Image build fails with NO_PUBKEY 7FCC7D46ACCC4CF8
Problem: On Windows, docker compose up -d fails during the image build. The
apt-get update step reports NO_PUBKEY 7FCC7D46ACCC4CF8, or that the PostgreSQL
repository is not signed.
Cause: Git's default core.autocrlf=true rewrites the committed PostgreSQL (PGDG)
signing key with CRLF endings on checkout, and apt cannot read a CRLF armored key.
Fix: Move to v0.23.2 or later and rebuild. The key is pinned to LF and the build strips stray carriage returns, so a clone already on disk needs no re-clone:
# <release> is any release from v0.23.2 on
git fetch --tags && git checkout v<release> && docker compose up -d --build
Podman: Docker socket missing or container stays unhealthy
Problem: On Podman you see FileNotFoundError for the Docker socket, or the
container starts but stays unhealthy.
Cause: Podman's rootless socket is inactive by default, and a few Docker
conventions (unqualified image names, node -e healthchecks) behave differently
under Podman.
Fix: Start the Podman socket and export DOCKER_HOST:
systemctl --user start podman.socket
systemctl --user enable podman.socket
export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
When building a custom image under Podman, use fully-qualified image names (for
example docker.io/node:22-slim) and a curl-based healthcheck rather than
node -e.
Rate limiting
OpenWA applies a global rate limit to every client, enforced in three tiers and counted per
client IP (resolved through TRUSTED_PROXIES) and per route: each endpoint keeps its own
buckets, so the limits are not a total across the API. Exceeding any tier returns 429 Too Many Requests.
| Tier | Default limit | Window |
|---|---|---|
| Short | 10 requests | 1 second |
| Medium | 100 requests | 60 seconds |
| Long | 1000 requests | 1 hour |
There is no per-session rate-limit endpoint. To raise the limits, set the
corresponding configuration values and restart. On a 429, wait the number of seconds in
Retry-After and retry. Since v0.23.6 a 429 from these tiers, and from the ingress
route's instance and ingress-ip throttlers, carries that plain header next to the
tier-suffixed Retry-After-<tier>, which no HTTP client reads, so a client that honours
Retry-After now waits for it; when the long tier shed the request, the wait can be up to
an hour. The MCP and Bull Board pre-auth limits (MCP_IP_RATE_LIMIT_MAX) answer 429
without it, and a send-pacing refusal reports its wait only as retryAfterSeconds in the
body. Since v0.23.6 the MCP limit counts each JSON-RPC message rather than each HTTP request,
so a batch of 20 messages spends 20 of the budget (default 120 per 60 seconds;
MCP_IP_RATE_LIMIT_MAX sets the count and MCP_IP_RATE_LIMIT_WINDOW_MS the window); Bull
Board still counts one per request.
With REDIS_ENABLED=true the counters live in Redis and fail open: while Redis is unreachable or
silent, requests pass uncounted. Since v0.26.0 a Redis that is connected but not answering costs only
the first request a timeout (each command is bounded at 2 s and a socket silent for 1.5 s after a
write is destroyed); the requests behind it pass at once while the client reconnects.
Since v0.23.6 an IPv6 client is keyed on its /64, so every client in one /64 shares each
bucket. Where several clients reach the gateway from one IPv6 network, raise the
RATE_LIMIT_* limits, and INGRESS_IP_LIMIT, WS_RATE_LIMIT_HANDSHAKE_MAX,
MCP_IP_RATE_LIMIT_MAX and, for requests without an API key, INFLIGHT_BODY_BUDGET_BYTES
where those apply, since they key the same way. A request with an active API key is charged to
the key against that budget, not to its address (v0.24.0+).
Error code reference
HTTP status codes
The API uses the standard NestJS error envelope. Error responses are JSON with
statusCode, message and, on most of them, error. A body built from a bare message
omits error, for example an unexpected 500, a 413 for a body over BODY_SIZE_LIMIT
that the parser refuses, the throttler's 429, a production validation 400 and the
session-start 504. A typical body:
{
"statusCode": 404,
"message": "Session with id '8f3c2b1a-9d4e-4c7a-8b2f-1e6d5a4c3b2a' not found",
"error": "Not Found"
}
| Code | Meaning | Common cause | Fix |
|---|---|---|---|
400 | Bad Request | Invalid body, params, or JID format; a media-conversion input URL that is blocked by the SSRF guard, answers non-2xx, times out or cannot be reached (an oversized one answered 400 too before v0.23.6, and answers 413 since); since v0.23.6, a media-conversion input that is not a single-file media container (a playlist, manifest or concatenation script, for example), which earlier releases accepted; since v0.23.6, a media url on a send, status or picture route that is not an absolute http(s) URL, or whose download answers a non-2xx status other than a redirect, times out or fails to connect; a media url whose host does not resolve, that points at or resolves to a blocked internal address, or that answers with a redirect (3xx), which a status post or picture change answered with 500 instead before v0.31.0 (Destination address is not allowed); since v0.31.0, a media url that carries a user name or password, on every route that fetches one (Media URL must not contain credentials (userinfo); 500 before), and a send-bulk batch whose literal item url carries them, which was accepted and failed the item; a send whose Idempotency-Key header is not one value of 1 to 255 visible ASCII characters (IDEMPOTENCY_KEY_INVALID, v0.25.0+); on whatsapp-web.js, a vote-poll whose option text matches none of the poll's options (POLL_OPTION_NOT_FOUND, v0.25.0+, with the poll's validOptions in the body) | Check the request payload; for media conversion, point the url at a reachable, public host, and convert a single media file, such as MP4/MOV, WebM, Ogg, MP3, WAV, AAC, FLAC, AMR or GIF. MEDIA_CONVERSION_MAX_OUTPUT_BYTES bounds the converted result, and an oversized output is rejected after the conversion runs. For a media send, see Media upload fails. For an idempotency key, send one value of 1 to 255 visible ASCII characters; for a poll vote, pass one of the validOptions exactly |
400 | Bad Request | Since v0.26.0 request validation also refuses: a JSON boolean or object in a string field ({"text":{"a":1}} used to send [object Object]; a JSON number is still converted); an array in a nested object field (for example bulk options, a bulk item's content and media, customLinkPreview, the sections of the infrastructure config, a status media source), or an object in a list field (for example a webhook's events); a body nested more than 100 levels (a few thousand levels answered 500); a chatId, fromChatId or toChatId without a domain or given as a JSON number (500 on Baileys before); a muteUntil above 9007199254740991; a template or bulk variable that has no text form (500 before); a boolean startTime on calls/link; an allowedChats, allowedSessions or allowedIps sent as an object when an API key is created or updated (it was stored as an empty list, which means no restriction); a membership-requests/approve or /reject body that is a JSON list or sent in a content type other than JSON or form encoding (both acted on every pending request); a GET /api/search dateFrom or dateTo outside the safe integer range (500 on PostgreSQL past about 9.2e21 before); a media-conversion url that is not an absolute http(s) address (the message names url outside production or with VALIDATION_ERROR_DETAIL=true). With the bundled dashboard served, a body over BODY_SIZE_LIMIT, malformed JSON, an over-nested body or an undecodable path parameter under /api and /mcp answered 404 Cannot POST before v0.26.0; they now answer 413 or 400. Since v0.28.0 request validation also refuses: a JSON body with more than 10,000 items in one array, more than 1,000 keys on one object, or more than 250,000 array items and object keys in total; a POST /api/sessions config over 16,384 bytes serialized; a group route (GET/PUT/POST/DELETE /api/sessions/{sessionId}/groups/{groupId}...) whose {groupId} does not name a group; GET /api/sessions/{sessionId}/contacts/check/{number} with a non-phone @ id or no digits; POST /api/sessions/{sessionId}/messages/send-sticker on whatsapp-web.js with non-image/non-video media, or, since v0.31.0, a video the host's ffmpeg refuses (The video could not be converted to a sticker: ...; 500 before); POST /api/sessions/{sessionId}/chats/pin or .../chats/mute on Baileys for a 1:1 chat whose phone and @lid are not paired in lid_mappings; and a webhook write with more than 27 events or a webhook or automation rule filter value over 128 characters (while a :sessionId of 1 to 128 ASCII letters, digits, and hyphens reaches session lookup and answers 404 when no session has that id). Since v0.31.0 request validation also refuses an object with its own toString in a string or number field of a body ({"toString":"x"}, or a form key such as name[toString]=x), which answered 500 and logged a stack; and the gateway answers 400 for POST /api/sessions/{sessionId}/chats/mute on whatsapp-web.js with a channel id, which is muted through its own route (500 before), for POST and DELETE /api/sessions/{sessionId}/contacts/{contactId}/block on whatsapp-web.js with a number WhatsApp, asked for it, holds no privacy id for, for POST /api/sessions/{sessionId}/groups/join on whatsapp-web.js with the invite of a group whose admin approves new members (could not join the group: it needs an admin to approve new members, and a request to join was sent: the invite is good and the account has not joined, where it said the invite was invalid), and for a database.poolSize above 9007199254740991 on PUT /api/infra/config | Fix the field the message names. To approve or reject every pending join request, send {} or no body |
401 | Unauthorized | Missing or invalid API key | Send a valid X-API-Key header |
403 | Forbidden | The key's role is below the route's requirement, or a session-scoped key reached a deployment-global surface such as key management; since v0.24.0 also a valid key refused by its allowedIps or allowedSessions, which answered 401 before; since v0.23.6 also a key carrying allowedChats on a route not open to it or with a quotedMessageId outside POST .../messages/reply (API key is restricted to selected chats), or naming a chat outside its allowlist (API key not authorized for this chat); or WhatsApp refused a well-formed request, usually a group or channel write the account has no admin rights for (on Baileys a group the account left still answers 403, but since v0.23.6 a group that no longer exists answers 404, where it answered 403 before, and since v0.28.0 Baileys POST /api/sessions/{sessionId}/messages/edit answers 403 when the target message has no text or caption, matching whatsapp-web.js); or, since v0.23.6 on whatsapp-web.js, deleting a status that is not one of the account's own (Only the account's own statuses can be deleted), which answered 500 before. Since v0.31.0 also, on whatsapp-web.js, POST .../messages/pin and /messages/unpin in a chat with a contact the account blocked (500 before). Editing a group's subject, description or picture takes an admin only when the group restricts its info to admins. A rate limit, a timeout or a server error from WhatsApp on a group, channel or profile change no longer answers 403 on whatsapp-web.js since v0.31.0: see Unanswered WhatsApp query (503) | Use a key with a sufficient role, and no session scope on deployment-global surfaces; for a scope refusal, call from an allowed address and session, see A valid key gets 403; for a chat-scoped key, see A chat-scoped key gets 403. A WhatsApp refusal does not go away on retry |
404 | Not Found | Unknown session, chat, message, group, channel or invite code, label, or route; since v0.28.0 also POST /api/sessions/{sessionId}/channels/{channelId}/owner/transfer and .../admins/demote when {channelId} does not end in @newsletter, and any /api/sessions/{sessionId}... route when {sessionId} is 1 to 128 ASCII letters, digits, and hyphens naming no session | Verify the id exists |
409 | Conflict | A session with that name already exists, or the session is not connected; on a session start, stop or delete, another node holds a live lease on the session (Session <id> is running on another node; since v0.31.0 only when another node holds the session, where overlapping requests for it on one node answered it before); since v0.25.0, a send whose Idempotency-Key is still running (IDEMPOTENCY_KEY_IN_PROGRESS) or whose outcome is unknown (IDEMPOTENCY_OUTCOME_UNKNOWN); a data import or export that overlaps another one or would orphan a running engine (IMPORT_ALREADY_RUNNING, EXPORT_IN_PROGRESS, IMPORT_WOULD_ORPHAN_ENGINES, IMPORT_NESTED_TRANSACTION) | Pick a different name, or wait for ready. For a lease conflict, act on the node that runs the session; when none does, wait out the lease (SESSION_LEASE_TTL_MS, 60 s by default), or after a PostgreSQL upgrade to v0.23.6 see Sessions do not start after upgrading to v0.23.6 (PostgreSQL). For an idempotency conflict or a data import or export, see Other stable error codes |
409 | Conflict | Since v0.26.0 also: enable, disable, update, uninstall, install or install-url of a plugin that is still being restored after startup; POST /api/sessions/{sessionId}/start after a logout that found a running engine (a stop, a force-kill, a stopOrphans import or a running delete already made the start yield; the retry answers 404 once a delete or an import has removed the session); POST /api/sessions/{sessionId}/pairing-code on whatsapp-web.js for a number that is the stored phone of another session; GET /api/infra/storage/files/count and GET /api/infra/storage/export when the local storage directory holds a symbolic link, a directory the app cannot read or one nested 20 levels deep (message names the path); a DELETE of a session whose ownership changed while it ran (since v0.31.0 a second DELETE that finds the session already removed answers 404 instead, and while no other node holds the session a DELETE or a start that overlaps a stop, logout, force-kill or failed start of it, or two other requests for it, no longer answers this 409 or is refused as stopped); a PATCH of an instance config whose plugin is not loaded; a whatsapp-web.js request that races a session teardown or a WhatsApp Web page reload. Since v0.27.0 also: POST /api/sessions/{sessionId}/logout on Baileys when WhatsApp already unlinked the device (Session is already unlinked; on GET /api/sessions/{sessionId}/qr, Baileys answers 400 60 s after a pairing code was requested while no fresh QR has replaced the cached one). Since v0.31.0 the whatsapp-web.js page reload 409 carries code ENGINE_PAGE_RELOADING and retryAfterSeconds, and a send, reply, forward or status post cut short while it ran (by a reload on whatsapp-web.js once the message was handed to the page; on Baileys by a connection replaced or stopped while it was written, which also cuts a reaction, edit, delete for everyone, pin or status delete) answers a 409 with no code that says the message may or may not have been sent, published, removed or applied | Retry shortly: Plugin changes answer 409 just after a restart, Engine operations return 409 during a WhatsApp Web page reload. For a cut-short send, check the chat before sending again. For the pairing-code case see the unlink risk. For a storage walk, replace the link with a bind mount or fix the permissions; nothing was written |
413 | Payload Too Large | Media or body exceeds the cap; since v0.23.6 this includes media downloaded from a url, which answered 500 on a send, status or picture route and 400 on a media conversion before | Reduce size or raise the limit: MEDIA_DOWNLOAD_MAX_BYTES for media, including a fetched conversion input, and BODY_SIZE_LIMIT for the request body. Since v0.24.0 a declared body that INFLIGHT_BODY_BUDGET_BYTES, the caller's share of it or the unkeyed pool could never admit also answers 413, without Retry-After; raise INFLIGHT_BODY_BUDGET_BYTES (keep it at least 2 × BODY_SIZE_LIMIT) |
415 | Unsupported Media Type | The request body carries a Content-Encoding other than identity. Middleware refuses it before routing and never reads the body | Send the body uncompressed; the in-flight body budget counts wire bytes, so a compressed body cannot be admitted safely |
415 | Unsupported Media Type | A request to /api/ingress/{pluginId}/{instanceId}/{route} carries a body whose Content-Type is neither application/json nor application/x-www-form-urlencoded (v0.24.0+); it is refused before the signature check | Configure the provider to send a JSON or form-encoded body; see Integration Fabric |
422 | Unprocessable Entity | IDEMPOTENCY_KEY_REUSED (v0.25.0+): the Idempotency-Key already names a different route or body within its 24-hour window. Also a chat-label write (POST /api/sessions/:sessionId/labels/chat/:chatId or DELETE .../labels/chat/:chatId/:labelId) that names a channel, which carries no labels, or, on whatsapp-web.js, an account that is not a WhatsApp Business account | Use a new key for a different request, and reuse a key only to repeat the same one. For labels, do not label a channel, and use a WhatsApp Business account on whatsapp-web.js |
429 | Too Many Requests | Rate limit exceeded, or send pacing (opt-in, SEND_PACING_ENABLED) refused the send — the pacing refusal carries code: 'SEND_PACING_LIMITED' and a retryAfterSeconds body field; send-bulk while BULK_MAX_CONCURRENT_BATCHES batches (default 50) are already running on the node; GET /api/metrics after 10 failed bearer tokens within a minute (v0.23.7+) | Back off and retry after the Retry-After header, which the global and ingress throttlers send since v0.23.6 (the MCP and Bull Board limits send none); for a pacing refusal, which carries no Retry-After, wait out retryAfterSeconds; for the bulk cap, wait for a running batch to finish |
500 | Internal Server Error | Unhandled server error; or, on whatsapp-web.js, a send or status post that WhatsApp Web rejected inside the page (ENGINE_PAGE_ERROR, v0.24.0+) | Check the logs and report it; for ENGINE_PAGE_ERROR, keep the pageError and build diagnostics and check the chat before retrying, since they do not establish that nothing was sent |
501 | Not Implemented | Operation unsupported by the active engine. Since v0.13.0, catalog reads and send-product work on the Baileys engine; whatsapp-web.js has no catalog API (send-catalog never worked on either engine and was removed in v0.19.0). Three more are documented since v0.14.5: listing channels and reading channel messages refuse on Baileys, and subscribing to a channel by invite code refuses on whatsapp-web.js. The contract also declares the 501 for routes that already answered it — every label READ refuses on Baileys, which has no label query of any kind, and every media send to an <id>@newsletter recipient refuses on whatsapp-web.js, whose page method for it was removed by a WhatsApp Web update (a text to a channel without quotedMessageId still works). Three more refuse on whatsapp-web.js since v0.16.0: creating a group, transferring channel ownership, and demoting a channel admin — each reaches a WhatsApp Web internal that no longer exists. Since v0.23.6 whatsapp-web.js also refuses rejecting a call, which used to answer 200 without stopping the ring, and replying to a business-prompt button (POST /api/sessions/:sessionId/messages/click-button), which only Baileys implements. Since v0.27.0 whatsapp-web.js also answers 501 on PUT /api/sessions/{sessionId}/groups/{groupId}/member-label (Baileys only), and GET /api/search?match=contains answers 501 when SEARCH_CONTAINS_ENABLED=false (the default) or while the background trigram index build is still running. Since v0.28.0 Baileys also answers 501 on GET /api/sessions/{sessionId}/messages/{chatId}/{messageId}/receipts (whatsapp-web.js only). These are not the only cases: API conventions lists every engine-limited route by engine, including vote-poll, the history and reactions reads, presence subscription, a group's disappearing-messages setting and the sends whatsapp-web.js cannot make, and a customLinkPreview on send-text answers 501 on whatsapp-web.js only. Since v0.31.0 whatsapp-web.js also answers 501 for a group, profile or pin route when the WhatsApp Web build the session runs has no job to carry it out (the message ends on this build) and nothing was asked of WhatsApp). That 501 depends on the build and not on the engine, and a call that a page reload lands on answers the retryable 409 instead; the routes are listed in A whatsapp-web.js route answers 501 on a WhatsApp Web build without its job | Use the Baileys engine for catalog operations, call rejection, prompt-button replies and group member labels; use whatsapp-web.js to read labels, to list and read channels, to vote in a poll and to read chat history and reactions, and Baileys to subscribe by invite or to edit labels; send text without quotedMessageId rather than media to a channel; use Baileys to create a group, transfer channel ownership, or demote a channel admin; for match=contains search, set SEARCH_CONTAINS_ENABLED=true and wait for the trigram index build to finish; otherwise use a supported engine or operation |
502 | Bad Gateway | A session lifecycle teardown could not complete on both sides — SESSION_STOP_INCOMPLETE on stop (v0.19.0+, both the graceful disconnect and the forced teardown failed; session left disconnected), SESSION_LOGOUT_INCOMPLETE on logout (v0.12.0+) or SESSION_FORCE_KILL_INCOMPLETE on force-kill (v0.24.0+, the force-destroy did not complete; session left disconnected); or, on GET /api/search, the active plugin search provider returned a result shape that failed the host's validation, which the built-in provider never does | Retry a stop or logout; after a logout failure, start the session again first. After a stop or force-kill failure the engine process may still be running, so restart the gateway node to reap it. force-kill is no remedy for a failed stop: the stop has already released the engine, so it answers 400. See Session lifecycle error codes |
503 | Service Unavailable | Dependency or session temporarily down; server-side media conversion (POST /api/sessions/:sessionId/media/convert/{voice,video}) is disabled, the ffmpeg binary cannot be run, or its conversion queue is saturated; or WhatsApp did not answer an engine query within its 30-second request budget (see Unanswered WhatsApp query); or, on GET /api/search, the active plugin search provider did not answer, because its worker is not running, the query passed the 10-second search timeout, or the handler reported a failure. Since v0.23.6 also: a pairing-code request (whatsapp-web.js only) whose retry budget ran out while WhatsApp Web kept reloading its QR page; a media url fetched through the session's proxy that failed before any response, on a send, a status post, a profile or group picture change, or a media conversion (nothing was sent, set or converted); and, on whatsapp-web.js, a browser command that outran the Puppeteer protocol timeout on the group read, the invite preview or join, the chats-by-label read, the single-contact read, or a chat action, and since v0.24.0 also the chat, group and contact list reads, the mute, unmute, pin and unpin writes, and PUT /api/sessions/:sessionId/presence, and since v0.31.0 also the writes that are safe to repeat and the reads listed in A read on a large account fails with Runtime.callFunctionOn timed out | Retry after the dependency recovers; for media conversion, retry shortly or convert client-side and post the result; for an unanswered query, retry the call; for a search provider that did not answer, retry, and check that the plugin is still enabled and healthy if it persists; for a pairing-code 503, a retry starts the linking flow again, so the unlink risk applies |
503 | Service Unavailable | Since v0.26.0 also: on SQLite, POST /api/sessions, DELETE /api/sessions/{sessionId} or DELETE /api/integration/plugins/{pluginId}/instances/{instanceId} while another database transaction stays open for 10 s (the create stored nothing, the instance delete deleted nothing); an ingress route with a response contract while its plugin is still being restored after startup (Retry-After: 5); on Baileys, a send, reaction, edit, delete, pin or status post that WhatsApp answered with a throttle (429) or a timeout (408), where it answered 500; on whatsapp-web.js, accepting a group invite that a page reload cut short (the join may have landed); media conversion once the gateway is shutting down. Since v0.27.0 also: GET /api/sessions/{sessionId}/messages/{messageId}/media on S3 when 50 downloads are already in flight (Retry-After: 1). Since v0.28.0 also: POST /api/sessions/{sessionId}/start, stop, and DELETE /api/sessions/{sessionId} when the database cannot check or claim session ownership (nothing was started, stopped, or deleted). Since v0.31.0 also: stop when the database does not answer the read of the session or the write that records the stop, DELETE /api/sessions/{sessionId} when it does not answer a read it makes once it holds its claim or the write that records the delete, and logout and force-kill when it does not answer the read of the session (a raw 500 before; nothing was stopped, deleted, logged out or killed, and a stop or delete whose record the database did not confirm may have been recorded, so repeating it is safe). On whatsapp-web.js since v0.31.0: send-sticker of a video when the host's ffmpeg is missing or cannot run (nothing was sent; the reason is in the log), and a status WhatsApp gave a group, channel or profile change, a group join, an invite preview or a pin (see Unanswered WhatsApp query (503)) | Retry. Check the group before retrying an invite, and the chat before repeating a send that timed out; see Database locked (SQLite), Plugin changes answer 409 just after a restart and Unanswered WhatsApp query |
504 | Gateway Timeout | POST /api/sessions/:sessionId/start: the engine did not finish starting within its timeout, because WhatsApp Web or the network is unreachable, a browser stalled or hit a resource limit, or, on whatsapp-web.js, a hung data volume stalled the orphaned-browser sweep (ps) or the removal of stale profile locks before the launch (each is bounded at 5 seconds since v0.31.0, where the start waited for this timeout before), the session proxyUrl is unreachable, or WhatsApp Web's authentication wait ran out (since v0.31.0 that wait covers the page's connection to WhatsApp as well as the page's boot). The engine is torn down. This body carries message but no error field. On a deployment that routes requests between nodes (NODE_URL), any session-scoped request forwarded to the owning node also answers 504, with error: "Gateway Timeout", when the owner does not answer within SESSION_PROXY_TIMEOUT_MS; the owner may already have carried the request out. A forward that fails after it was sent answers 502, and one that never reached the owner 503 | Retry the start. Check that the host, and the session proxy if one is set, can reach WhatsApp; for a slow first boot, raise WWEBJS_AUTH_TIMEOUT_MS (see QR generation times out on slow first boot). For a forwarded request that timed out, check the owner node before repeating a non-idempotent call, and see Horizontal scaling |
Bulk-send result codes
These codes are not HTTP statuses. They appear only on per-message results
inside a bulk batch, retrieved from
GET /api/sessions/{sessionId}/messages/batch/{batchId}. Each failed entry carries
a { code, message } object so you can branch on why one message in the batch
failed. An ordinary POST .../messages send does not return these codes — it
returns a normal HTTP status (see the table above).
| Code | Meaning | Fix |
|---|---|---|
SEND_BLOCKED | The item's media url was refused by the SSRF guard: its host does not resolve (a lookup past SSRF_DNS_TIMEOUT_MS included), it points at or resolves to a blocked internal address, or it answered with a redirect (3xx). The message is always Destination address is not allowed | Point the url at a public host that serves the file directly (SSRF_ALLOWED_HOSTS does not lift the refusal of a redirect); add a trusted internal host to SSRF_ALLOWED_HOSTS, as a bare host name or an IP written the way the URL parser prints it (127.0.0.1, not 127.1). An entry that can never match, one with a scheme, credentials, port, path or wildcard for example, is named by position and reason in a start warning (v0.26.0+) |
SEND_FAILED | The item could not be sent: the engine rejected it, or the item itself was unusable, for example its media url answered a non-2xx status other than a redirect, timed out, could not be reached or passed MEDIA_DOWNLOAD_MAX_BYTES, or (v0.23.6+) is not an absolute http(s) URL once its variables are filled in | Read the accompanying message for the cause |
SEND_PACING_LIMITED | The opt-in send-pacing governor (SEND_PACING_ENABLED) refused this message — a warm-up ramp, daily cap, failure breaker, or cold-reachout budget said no. Surfaced as SEND_PACING_LIMITED rather than SEND_FAILED since v0.14.0 so you can branch on a refusal that is intentional and time-bounded, not an engine fault | Wait out the refusal window (the per-send HTTP 429 carries retryAfterSeconds); slow the batch, or — for a cold-reachout cap — send to recipients who have messaged in first |
Engine-not-ready errors surface as 409 Conflict ("Session is not connected"), and
referencing a message outside the engine's lookup window surfaces as 404 Not Found. Both follow the standard HTTP envelope above.
Session lifecycle error codes
These codes ride in a top-level code field of the standard HTTP error envelope,
alongside statusCode, message and error, on the session lifecycle routes.
Branch on code for deterministic handling rather than matching the message text.
| Code | HTTP status | When | Fix |
|---|---|---|---|
SESSION_NAME_TEARDOWN_PENDING | 409 | POST /sessions/:id/start or DELETE /sessions/:id while a name-keyed credential teardown is still in flight (v0.12.0+) | Retryable — wait a short delay and retry; no destructive side effect ran before the refusal |
SESSION_LOGOUT_INCOMPLETE | 502 | POST /sessions/:id/logout: the session was stopped locally and phone cleared, but the unlink did not complete (no send, no acknowledgement, timeout/transport error, or local-cleanup failure). No success audit row is written (v0.12.0+) | Start the session again and retry the logout |
SESSION_STOP_INCOMPLETE | 502 | POST /sessions/:id/stop: since v0.19.0 a failed graceful disconnect escalates to a force-destroy, so this fires only when both the graceful disconnect and the forced teardown failed. The session is left disconnected and no success audit row is written | Retry the stop, and restart the gateway node to reap a leaked engine process. POST /sessions/:id/force-kill does not help here: the failed stop has already released the engine, so it answers 400 |
SESSION_FORCE_KILL_INCOMPLETE | 502 | POST /sessions/:id/force-kill (v0.24.0+): the force-destroy threw or timed out, so the engine process may still be running. The session is left disconnected and no success audit row is written | Restart the gateway node to reap the leaked engine process |
Other stable error codes
These codes also ride in a top-level code field of the error body, on the routes named in the table. Branch on code rather than on the message text. SEND_PACING_LIMITED is described with the bulk-send result codes.
| Code | HTTP status | When | Fix |
|---|---|---|---|
IDEMPOTENCY_KEY_INVALID | 400 | v0.25.0+: a send route got an Idempotency-Key header that is not one value of 1 to 255 visible ASCII characters | Send one key of 1 to 255 visible ASCII characters |
IDEMPOTENCY_KEY_REUSED | 422 | v0.25.0+: the key already names a different route or body within its 24-hour window | Use a new key for the different request, and reuse a key only to repeat the same one |
IDEMPOTENCY_KEY_IN_PROGRESS | 409 | v0.25.0+: the first request with this key is still running | Retry with the same key once the first request finishes |
IDEMPOTENCY_OUTCOME_UNKNOWN | 409 | v0.25.0+: an earlier request with this key failed after the message may have been sent, or its claim stayed pending for over ten minutes | Check the chat. Send again only with a new key: the same key keeps answering this 409 until its 24-hour window ends |
ENGINE_PAGE_ERROR | 500 | v0.24.0+, whatsapp-web.js: WhatsApp Web threw inside the page during a send or status post. The body carries pageError (name and message) and, when known, the WhatsApp Web build | Keep the diagnostics and check the chat before retrying: they do not establish that nothing was sent |
ENGINE_PAGE_RELOADING | 409 | v0.31.0+, whatsapp-web.js: WhatsApp Web is reloading its page, while the session still reads ready. The body carries retryAfterSeconds (5), the interval to ask again at. Sent for a request refused before it reached the page, and for a read or a write that converges when repeated. A send cut short by a reload answers a 409 with no code instead | Ask again every retryAfterSeconds, for up to about 5 minutes: Engine operations return 409 during a WhatsApp Web page reload. A repeat of a channel delete that the first attempt had already applied may meet a channel that is gone, which answers 403, and a repeat of an unsubscription may meet a channel that is no longer followed |
POLL_OPTION_NOT_FOUND | 400 | v0.25.0+, whatsapp-web.js: the option text of a vote-poll matches none of the poll's options. The body lists them as validOptions | Pass one of the validOptions exactly. An empty options list still clears the vote |
IMPORT_ALREADY_RUNNING | 409 | POST /api/infra/import-data while another import runs, or GET /api/infra/export-data while an import runs | Wait for the import to finish, then retry |
EXPORT_IN_PROGRESS | 409 | v0.24.0+: POST /api/infra/import-data while an export runs | Wait for the export to finish, then retry |
IMPORT_WOULD_ORPHAN_ENGINES | 409 | POST /api/infra/import-data would leave engines running for sessions the backup does not contain | Stop those sessions first, or retry with stopOrphans=true to stop them inside the request. force=true proceeds and leaves them running until a server restart |
IMPORT_NESTED_TRANSACTION | 409 | POST /api/infra/import-data on SQLite found another database transaction in progress on its connection (a session create or delete, for example), so the restore could not be made durable | Retry with no other data operation in flight |
RESTART_DATABASE_NOT_STARTED | 409 | v0.27.1+: POST /api/infra/restart while DATABASE_TYPE=postgres and POSTGRES_BUILTIN=true (pointing at the bundled host) and the built-in openwa-postgres container is stopped or failed to start | Start the built-in PostgreSQL container first (POST /api/infra/services/database/start or docker start openwa-postgres), then retry the restart |
RESTART_ALREADY_RUNNING | 409 | v0.27.1+: POST /api/infra/restart while another restart request is already checking dependencies or scheduling the process exit | Wait for the in-progress restart to complete |
Frequently asked questions
How many sessions can I run on one instance?
It depends on host resources and the engine. With the default whatsapp-web.js engine
(~300–500 MB RAM per session): roughly 3–5 sessions on 2 GB, 8–10 on 4 GB, 15–20 on
8 GB. ENGINE_TYPE=baileys is browser-free and fits many more on the same hardware.
See Scaling.
How do I keep my number from getting banned? OpenWA uses the unofficial WhatsApp Web protocol, so there is inherent risk — use a dedicated number, avoid unsolicited bulk messaging, and ramp volume gradually. See Ban risk & safe sending for the full guidance.
Can I use a WhatsApp Business account? Yes — both personal and WhatsApp Business app accounts work. The official WhatsApp Business API (Meta Cloud API) is a different product and is not what OpenWA uses.
How do I send to a group?
Use the group JID (...@g.us) as the chatId. See Groups.
How do I run behind a reverse proxy? Forward WebSocket upgrades and set generous idle timeouts — OpenWA keeps a long-lived connection per dashboard client on the same port as the REST API. See Deployment.
How do I integrate with n8n? See the n8n integration guide.
What webhook events can I subscribe to?
Message events (message.received, message.sent, message.ack, message.receipt (v0.26.0+),
message.failed, message.revoked, message.edited, message.reaction), status events
(status.received), session events (session.status, session.qr, session.authenticated,
session.disconnected, session.reconnect_loop, session.restriction), presence events
(presence.update), event RSVPs (event.response, v0.25.0+), poll votes (poll.vote, v0.26.0+), group events (group.join, group.leave, group.update,
group.join_request), and call events (call.received, call.accepted, call.rejected,
call.missed) — twenty-six in all. presence.update, event.response, message.receipt and the three call
outcome events come from Baileys only, poll.vote comes from whatsapp-web.js and, since v0.30.2, from
Baileys while the poll's creation message is still in the session's message store
(BAILEYS_MESSAGE_STORE_LIMIT; earlier votes are not backfilled), and call.received
is not reliable on whatsapp-web.js. A * subscription delivers every event except message.receipt,
which must be named explicitly. See Webhooks.
Getting help
Before opening an issue:
- Re-check this page for your symptom.
- Read the logs:
docker compose logs openwa-api --tail=200. - Try a restart and, if relevant, a clean re-scan.
- Search existing issues — someone may have hit it already.
When you report, include your OpenWA version (v0.31.0), deployment (Docker/OS),
engine (ENGINE_TYPE), Database adapter, session count, reproduction steps, and
sanitized logs.
Next steps
- API conventions — auth, pagination, and the error envelope in detail
- Full API reference — every endpoint, field, and status code
- Glossary — definitions for JID, session states, adapters, and more