Publish a version
POST/v1/flows/:flow_id/versions/:version_id/publish
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.
Request
Responses
- 200
- 202
- 400
- 401
- 403
- 404
- 409
- 429
Replay of an earlier completed request with the same Idempotency-Key: the original 202 response, with Idempotent-Replayed: true. Nothing was published a second time.
Response Headers
Always true on a replay.
The version as the publish was accepted on it — still draft, because the publish runs in the background. Poll it.
A malformed flow_id or version_id (code: invalid_parameter), an unrecognised query parameter (code: unknown_parameter), or an Idempotency-Key that is not 1–255 printable ASCII characters (code: invalid_parameter).
Missing, malformed, unknown, revoked, or expired key — one body for all of them (code: unauthorized), with WWW-Authenticate: Bearer realm="hop".
The key lacks the scope (code: insufficient_scope), named in WWW-Authenticate: Bearer error="insufficient_scope", scope="…".
No such flow, or no such version of this flow; the detail says which.
code: not_in_draft_state — the version is not a draft; the detail names the state it is in and the move out of it (a pending version: poll it until it reaches draft; a published one is already live; a deprecated or failed one is never republished — post Flow JSON as a new version). code: draft_not_yet_uploaded — the version is a draft WhatsApp has not received yet; poll it until publishable is true. code: in_flight — an earlier request with this Idempotency-Key is still being processed. code: plan_cap_reached — the organisation's plan has reached its published-flow cap; the detail names the cap. Nothing was published.
Over a bucket. Obey Retry-After (seconds); RateLimit-* fields are informational.
Response Headers
Requests allowed in the current window. Informational.
Requests left in the current window. Informational.
Seconds until the window resets. Informational.
Seconds to wait before retrying. The binding contract.