# Publish call flow

> Publishes the working draft, making it the live call flow for the phone number. This changes live inbound routing immediately. Runs full validation, which is…

`POST /v2/api/numbers/{number}/call_flow/publish`

<Note>
**Required scope:** `PHONE_NUMBERS_WRITE`
</Note>

## Behavior

Publishes the working draft, making it the **live** call flow for the phone number. The `{number}` path parameter is the Allo phone number in E.164 format.

Pass the `lock_version` of the draft you are publishing. Get it with [Get call flow draft](/docs/phone-numbers/get-call-flow-draft).

<Warning>
This changes live inbound routing immediately. If you would rather have a person confirm the change, don't call this endpoint: [Save call flow draft](/docs/phone-numbers/save-call-flow-draft) returns a `confirmation_url` where a signed-in user reviews the draft and publishes it themselves.
</Warning>

Publishing keeps the draft's `engine_subset`. A `NESTED_IVR` flow only runs its root phone menu on live calls: save the draft with `"engine_subset": "FULL_FLOW"` to run the whole tree. See [Engine subset](/docs/phone-numbers/save-call-flow-draft#engine-subset).

Publishing runs **full** validation, which is stricter than the lenient validation a draft save runs: a draft that saved successfully can still fail to publish. If any rule fails, the whole publish is rolled back and the previously live flow keeps routing calls.

Publishing **consumes** the draft: the draft version becomes the published version, so the line is left with no draft and the response carries no `confirmation_url`. Start the next edit cycle with a fresh `PUT …/call_flow/draft`.

## Errors

- `400 CALL_FLOW_INVALID`: the draft failed full validation.
- `400 CALL_FLOW_ROOT_MENU_TOO_SMALL`: the line runs an IVR and this flow would leave its menu with fewer than 2 options.
- `400 CALL_FLOW_CONTACT_PROPERTY_KEY_REQUIRED`: a `CONTACT_PROPERTY` node has no `propertyKey`.
- `400 CALL_FLOW_CONTACT_PROPERTY_VALUE_REQUIRED`: a `CONTACT_PROPERTY` node has no `expectedValue`.
- `400 CALL_FLOW_CONTACT_PROPERTY_UNKNOWN`: a `CONTACT_PROPERTY` node's `propertyKey` does not name a custom person property of your team. Renaming or deleting a property in the CRM invalidates a flow that branches on it.
- `404 CALL_FLOW_DRAFT_NOT_FOUND`: there is no draft to publish. Save one first with `PUT /v2/api/numbers/{number}/call_flow/draft`.
- `404 PHONE_NUMBER_NOT_FOUND`: the number is not one of your account's numbers.
- `409 CALL_FLOW_STALE_LOCK`: the `lock_version` is stale; refetch the draft and retry.
