Unpublish a version
POST/v1/flows/:flow_id/versions/:version_id/unpublish
Takes the published version off WhatsApp: 202, and the version is deprecated once the background job has run; the flow's status becomes inactive and current_version null. One-way: to go live again, post the Flow JSON as a new version and publish that. 409 not_published unless the version is currently published. 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 unpublished a second time.
Response Headers
Always true on a replay.
The version as the unpublish was accepted on it — still published, because the deprecation 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_published — the version is not the published one; the detail names the state it is in. code: in_flight — an earlier request with this Idempotency-Key is still being processed. Nothing was unpublished.
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.