Skip to main content

Flow versions

A flow's versions: each upload of its Flow JSON, the poll target for a create or a publish, and the publish and unpublish actions.

📄️Add a version

Adds a version of the flow from Flow JSON. 202 with the version `pending` while WhatsApp processes it; poll it. Identical Flow JSON to a version that is pending, in draft or failed answers 200 with that version as it is now, so a deploy script that runs twice creates nothing — except for a version that failed before WhatsApp ever saw the document, which is resumed instead: 202, the same version, `pending` again. A document rejected by WhatsApp ends `failed` with `failure_reason`; post a corrected document as a new version. A version already published or deprecated is never reused. Bodies up to 5 MB. `Idempotency-Key` is accepted. Requires the `flows:write` scope.

📄️Publish a version

Publishes the version: 202, and WhatsApp's publish runs in the background. Poll the version until `state` is `published` or `failure_reason.stage` is `publish`. On success the flow's current version moves to it, the flow's `status` becomes `active`, and the previously published version is deprecated. Only a draft that has finished uploading can be published (`publishable`): 409 `not_in_draft_state` names the version's state (a pending version: poll until draft; a published one is already live; a deprecated one is never republished, post its Flow JSON as a new version), 409 `draft_not_yet_uploaded` for a draft WhatsApp has not received, 409 `plan_cap_reached` when the organisation's plan has reached its published-flow cap. `Idempotency-Key` is accepted. Requires the `flows:write` scope.