async: true, the API queues the send and responds immediately with a commandId.
Queued commands run in parallel, so two consecutive sends to the same
contact can arrive out of order — a heavy image goes out after the text that
was sent right after it.
Add sequential: true so that sends to the same recipient
go out one at a time, in the order the API received them.
commandId to
get the command or
correlate with the
command.result webhook.
How it works
- Ordering is per conversation: session (
sessionId) + recipient (to). Sends to other recipients keep running in parallel, without waiting. - The next send only starts when the previous one finishes, whether it succeeded or failed.
A failure does not interrupt the sequence: it is reported in that command’s
command.resultand the next one goes out normally. - Without
sequential, async sending works exactly as before.
Supported routes
The field accepts a boolean (
true) or a string ("true"). It is ignored when:
- the send does not have
async: true; - the session is an Official API session (
cloud_api), where sending is always synchronous.
Pending send limit
Each recipient accepts up to 100 pending sends in the sequence. Above that, the API responds429 and the send is not queued:
Retry-After header indicates how many seconds to wait (from 1 to 60) before
trying again.