Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(message): describe the send-pacing admission hold and retry hint

Yudhi Armyndharis0f317613e3aa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8d9a0ae3..4fc54eba9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -237,7 +237,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A stored automation rule whose `conditions` is malformed, such as one from a hand-edited backup, is skipped on its own instead of stopping every rule of its session from replying, and `POST /api/infra/import-data` refuses to restore one. One whose `conditions.conditions` is not a list no longer replies to every inbound message.
- `POST /api/infra/import-data` restores an automation rule whose `conditions`, or a queued webhook delivery whose `payload`, is a JSON object rather than a string, as it does a webhook's `filters`, instead of rolling back on SQLite.
- Two `presence.update` events for one group in the same millisecond get distinct idempotency keys, so a deduplicating receiver no longer drops the second.
-- Parallel sends can no longer together exceed the send-pacing daily and cold-reachout caps, and an edit is checked against the caps without being counted as a send.
+- Parallel sends can no longer together exceed the send-pacing daily and cold-reachout caps, and an edit is checked against the caps without being counted as a send; a refusal caused only by sends still in flight, including one for a group create or participant add, carries a `retryAfterSeconds` of 10 or less.
- Overlapping `PATCH /api/sessions/:sessionId/config` requests no longer drop each other's keys; one that keeps losing the race answers `409`.
- `MAX_CONCURRENT_SESSIONS` counts a session waiting to relaunch after a failed reconnect, so another start can no longer run one engine over the cap, and a start the cap refuses, from a takeover, boot auto-start or `POST /api/sessions/:sessionId/start`, including either of two concurrent starts for the last slot, leaves a lapsed session for a peer with room instead of down and reporting the dead node's status.
- A failed reconnect attempt no longer arms another attempt that tears down the next attempt's engine, which repeated until the session ended `failed`.
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index 097adb104..958b504aa 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -1629,8 +1629,18 @@ A refusal is `429` with a body carrying **`code: "SEND_PACING_LIMITED"`** and `r
```
The `code` is what distinguishes it from the **global rate limiter's** own `429`, which carries no
-`code`. The difference matters to a client: the throttler's 429 clears in seconds, a daily cap does
-not. Do not retry a `SEND_PACING_LIMITED` response before `retryAfterSeconds`.
+`code`. The difference matters to a client: the throttler's 429 clears in seconds, while a cap reached
+by stored sends lasts until the next UTC day. Do not retry a `SEND_PACING_LIMITED` response before
+`retryAfterSeconds`, and read it rather than assume a day-long wait.
+
+A chat send (not an edit) also counts toward both caps before its row lands, so parallel sends cannot
+together pass them: it is held while it is in flight (at most 5 minutes) and for 10 seconds after (a
+single send, which writes its row before WhatsApp is asked, for 10 seconds from its admission). A send
+that fails before WhatsApp may have taken it hands its place back at once. A daily or cold-reachout
+refusal can therefore come while the stored count is still under the cap; when only such held sends push
+it over, including for the group participant adds below, its `retryAfterSeconds` is 10 or less instead
+of the time to the next UTC day; while such a send is still in flight, a retry at that hint can be
+refused again.
Inside a bulk batch a refusal fails just that item (honouring `stopOnError`), not the batch — the
allowance may free up, and a batch killed outright could not be resumed.