curl --request PUT \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"schema_version": 1,
"lock_version": 123,
"base_published_version": 123
}
'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
payload = {
"definition": {},
"schema_version": 1,
"lock_version": 123,
"base_published_version": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {},
schema_version: 1,
lock_version: 123,
base_published_version: 123
})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'definition' => [
],
'schema_version' => 1,
'lock_version' => 123,
'base_published_version' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
payload := strings.NewReader("{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cflv-abc123",
"flow_id": "cflw-abc123",
"version": 3,
"status": "PUBLISHED",
"lock_version": 0,
"schema_version": 1,
"engine_subset": "FULL_FLOW",
"number": "+14155551234",
"confirmation_url": "https://app.withallo.com/call-flow-draft/cflv-abc123",
"entry_node_id": "node-22",
"definition": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Save call flow draft
Creates or updates the working draft of a phone number’s call flow. The draft is validated leniently and is not live until published. Optimistic concurrency: pass the lock_version returned by a previous read to detect a concurrent edit, and base_published_version to detect a publish that happened mid-edit.
curl --request PUT \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"schema_version": 1,
"lock_version": 123,
"base_published_version": 123
}
'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
payload = {
"definition": {},
"schema_version": 1,
"lock_version": 123,
"base_published_version": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {},
schema_version: 1,
lock_version: 123,
base_published_version: 123
})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'definition' => [
],
'schema_version' => 1,
'lock_version' => 123,
'base_published_version' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
payload := strings.NewReader("{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {},\n \"schema_version\": 1,\n \"lock_version\": 123,\n \"base_published_version\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cflv-abc123",
"flow_id": "cflw-abc123",
"version": 3,
"status": "PUBLISHED",
"lock_version": 0,
"schema_version": 1,
"engine_subset": "FULL_FLOW",
"number": "+14155551234",
"confirmation_url": "https://app.withallo.com/call-flow-draft/cflv-abc123",
"entry_node_id": "node-22",
"definition": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}PHONE_NUMBERS_WRITEBehavior
Creates or updates the working draft of a phone number’s call flow. The draft is validated leniently and does not affect live routing until you publish it. The{number} path parameter is the Allo phone number in E.164 format.
Send the full definition document and the schema_version it conforms to.
Going live
Saving a draft never changes live routing. There are two ways to put it on the air:- Publish it yourself with Publish call flow, passing the
lock_versionfrom this response. This changes live inbound routing immediately. - Hand it to a person using the
confirmation_urlin this response: a link where a signed-in user opens this draft, reviews it, and publishes it. Prefer this when a human should approve the change.
confirmation_url as opaque — pass it through verbatim; never build it from a hardcoded app host or parse it. (It is present only while the response status is DRAFT.)
Concurrency
lock_version— pass the value from the draft you read. Omit it (or sendnull) to upsert the draft without a concurrency check. A stale value returns409 CALL_FLOW_STALE_LOCK.base_published_version— the published version your edit is based on. If someone published a new version while you were editing, this returns409 CALL_FLOW_CONCURRENT_EDIT.
Errors
400 CALL_FLOW_SCHEMA_VERSION_MISMATCH—schema_versiondoes not match the server’s current version.400 CALL_FLOW_INVALID— thedefinitionis malformed or failed validation.404 PHONE_NUMBER_NOT_FOUND— the number is not one of your account’s numbers.409 CALL_FLOW_STALE_LOCK/409 CALL_FLOW_CONCURRENT_EDIT— see Concurrency above.
Authorizations
Path Parameters
Allo phone number in E.164 format
"+14155551234"
Body
The call flow tree document (opaque; camelCase keys).
Must match the server's current call flow schema version.
1
The lock_version of the draft you are updating; omit or null to upsert without a concurrency check.
The published version your edit is based on; a mismatch means someone published mid-edit (409).
Force the engine subset; inferred from the definition when omitted.
NESTED_IVR, FULL_FLOW Response
The saved draft
A version of a phone number's call flow.
Show child attributes
Show child attributes
Was this page helpful?