{
"error": {
"code": "CALL_FLOWS.IF_MATCH_REQUIRED",
"message": "Send If-Match with the ETag of your last read of the flow.",
"target": "If-Match"
},
"requestId": "c41f0a9e2b"
}
Makes a draft the live flow, through the same checks as Replace a number’s call flow. It answers the next call, so a mistake reaches callers at once. Use it when a script or an AI assistant prepares a change and a person approves it. The new version has source: publish, and restoredFromVersionId names the draft. The draft itself stays in the history.
Publish the draft a person approved by the draft’s versionId: latest-draft names the newest draft when the request arrives, which may be one saved after the approval. Send If-Match with the ETag of the read the draft was built on (see 412).
POST
/
numbers
/
{numberId}
/
call-flow
/
versions
/
{versionId}
/
publish
Publish a call flow draft
curl --request POST \ --url https://api.cloudtalk.io/v1/numbers/{numberId}/call-flow/versions/{versionId}/publish \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --header 'If-Match: <if-match>' \ --data '{ "note": "Approved by the support lead"}'
{
"error": {
"code": "CALL_FLOWS.IF_MATCH_REQUIRED",
"message": "Send If-Match with the ETag of your last read of the flow.",
"target": "If-Match"
},
"requestId": "c41f0a9e2b"
}
HTTP Basic Authentication. Use your API Access Key ID as the username and your API Access Key Secret as the password. Generate keys in the CloudTalk Dashboard under Account -> Settings -> API Keys (https://dashboard.cloudtalk.io/menu/account/settings/API-keys).
Headers
If-Match
string
required
The ETag of the read the draft was built on, the one you sent with the draft save. A missing value, or *, is 428 CALL_FLOWS.IF_MATCH_REQUIRED; a value that no longer matches is 412 CALL_FLOWS.ETAG_MISMATCH.
A draft's version id, or latest-draft for the newest draft when the request arrives.
Example:
"1836"
Body
application/json
note
string
Optional, up to 255 characters, stored on the new version.
Maximum string length: 255
Response
The live flow, with its new ETag, versionId and any warnings.
The live flow after a save, a restore or a publish. New steps carry their stored id, and the ref you sent, once.
numberId
string
required
read-only
The number. Read-only.
Example:
"600"
etag
string
required
read-only
The same value as the ETag header. Read-only.
Example:
"\"cf1-9fJ2kQx7Lr0aT3\""
editable
boolean
required
read-only
false when the stored flow cannot be sent back unchanged; problems says why. With only DANGLING_REFERENCE problems, correct those fields and the save takes the document. true is not a guarantee: a flow saved in the Dashboard over a size limit, or with a ring step that has no ring time, reads editable: true, but sending it back unchanged is refused with 422, as the call flow document says. Read-only.
problems
object[]
required
read-only
Stored data the API cannot represent. Read-only.
Show child attributes
businessHours
object
required
Whether business hours run before this flow. When closed, they decide what the caller hears, instead of the flow. Read-only.
Show child attributes
steps
(Ring user · object | Ring favorite user · object | Ring group · object | Voice agent · object | Playback · object | Voicemail · object | Redirect · object | Call recording · object | Fax · object | Change of caller · object | Dial by extension · object | IVR menu · object | Day/time splitter · object | Jump to · object | Condition splitter · object | HTTP request · object | Collect input · object | Mark call as resolved · object | Unsupported step · object)[]
required
The main sequence, from "Call comes in". The first step runs first, then the next one in the array. A step that branches, or that ends the call, is the last in its array. 1 to 200 steps in the whole flow on a save; a number with no steps reads [].
One step of a call flow. type picks its fields. A step that branches, or that ends the call, is the last in its array. A branch is an array of steps with the same rules.
Ring user
Ring favorite user
Ring group
Voice agent
Playback
Voicemail
Redirect
Call recording
Fax
Change of caller
Dial by extension
IVR menu
Day/time splitter
Jump to
Condition splitter
HTTP request
Collect input
Mark call as resolved
Unsupported step
Show child attributes
updatedAt
string<date-time>
required
read-only
Time of the latest saved version, or of the latest step change when no version exists. Read-only.
versionId
string | null
required
read-only
The latest version other than a draft, or null before the flow's first save. Read-only.
dashboardUrl
string
required
read-only
Opens this flow in the Dashboard designer, for an Admin. Read-only.
warnings
object[]
required
Warnings about the saved flow. They never stop a save.