> ## Documentation Index
> Fetch the complete documentation index at: https://help.cloudtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace a number's call flow

> Replaces the whole flow with the document you send. Steps you keep carry their `id`; steps you leave out are deleted; steps without an `id` are created. **It answers the next call**, so a mistake reaches callers at once: run [Validate a call flow](/api-reference/call-flows/validate-a-call-flow) first. To undo the save with [Restore a call flow version](/api-reference/call-flows/restore-a-call-flow-version), keep the `versionId` of your read: the `versionId` a save returns names the version that save created. If you did not keep it, or your read had `versionId: null`, find the version from before your save in [List call flow versions](/api-reference/call-flows/list-call-flow-versions) (for a first save, the `source: baseline` version, which keeps the flow as it was) and restore that id.

- **Concurrency.** Send `If-Match` with the `ETag` of your last read, so you never overwrite steps you have not seen (see `412`).
- **References.** Give a new step a `ref` (a label you choose) when another step must point at it. A reference field takes an existing step id or a `ref` from the same document, for example `{{input[ask-order]}}`.
- **Jump to steps elsewhere.** Deleting a step also deletes every Jump to step, in any number of your account, that pointed at it. Validate lists those numbers first.
- **Secrets.** Send an HTTP Request header without `value` to keep its stored value.
- **Size limits.** At most 200 steps and a body of at most 1 MiB. A step `name` takes up to 100 characters and a Collect input `pattern` up to 255. An HTTP Request step takes a `url` of up to 2,048 characters, up to 50 headers (name up to 256 characters, value up to 8,192) and up to 50 body fields (key up to 255 characters, value up to 8,192). A Condition splitter takes up to 50 branches with up to 50 conditions each, and a Day/Time splitter up to 50 branches. The Dashboard does not enforce these limits, so a flow saved there can exceed one; such a flow reads normally, but sending it back unchanged is refused with `422 VALIDATION.INVALID_FIELD` at the field over its limit. Shorten that field, or edit the flow in the Dashboard.
- **Ring time.** The Dashboard also saves a ring step with steps under "no answer" but no ring time. Such a flow reads normally, but sending it back unchanged is refused with `422 CALL_FLOWS.RING_SECONDS_REQUIRED` at that step: add `ringSeconds`.
- **Drafts.** `draft=true` saves the document as a draft version instead, through every check of a live save (see `201`). Calls keep using the live flow. `If-Match` is optional: send the `ETag` of your read, and the same one to [Publish a call flow draft](/api-reference/call-flows/publish-a-call-flow-draft).

Every save keeps a version. The legacy [Edit a number](/api-reference/numbers-legacy/edit-a-number) deletes a flow built here; the next read shows the change, and restore brings back the last saved version.



## API Specification

The full API specification for this endpoint is available in the [documentation index](https://help.cloudtalk.io/llms.txt).


## Related topics

- [Get a number's call flow](https://help.cloudtalk.io/api-reference/call-flows/get-a-numbers-call-flow.md)
- [Validate a call flow](https://help.cloudtalk.io/api-reference/call-flows/validate-a-call-flow.md)
- [Publish a call flow draft](https://help.cloudtalk.io/api-reference/call-flows/publish-a-call-flow-draft.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.