Skip to main content

Create a flow

POST 

/v1/flows

Creates the flow and its first version, from Flow JSON (application/json) or from an uploaded XLSForm or FHIR Questionnaire (multipart/form-data, a source_form file part beside the metadata fields). Never both. A source form is converted before this responds; its problems are immediate: 422 conversion_failed with the converter's sentence, 504 converter_timeout, 502 converter_unavailable. The response is 202: the flow exists and its first version is pending while WhatsApp processes it. Poll GET /v1/flows/{flow_id}/versions/{version_id} with latest_version.id until state leaves pending; a rejected document is failed with failure_reason, an accepted one draft with a preview_url, and publishable says when it can be published. warnings lists what the converter dropped or degraded; it is empty for Flow JSON. number_id defaults to your organisation's number (422 no_number_configured when it has none) and must be one of yours. record_action is not accepted here; set it through PUT /v1/flows/{flow_id}/record-action once the version has left pending, then publish. Bodies up to 5 MB. Idempotency-Key is accepted but not required: send one and a retry of the same request replays the first response as 200 with Idempotent-Replayed: true instead of creating a second flow. Requires the flows:write scope.

Request​

Responses​

Replay of an earlier completed request with the same Idempotency-Key and body: the original response, with Idempotent-Replayed: true. Nothing was created a second time.

Response Headers
    Idempotent-Replayed

    Always true on a replay.