Create a call flow
curl --request POST \
--url https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "en-US",
"tts_voice": "Telnyx.NaturalHD.astra",
"max_recording_seconds": 155,
"missed_call_sms_delay_seconds": 30,
"provider_assistant_id": "<string>",
"forwarding_number": "<string>",
"caller_id_voice_number_id": 123,
"greeting": "<string>",
"notification_emails": [
"jsmith@example.com"
],
"notification_phones": [
"<string>"
],
"fallback_to_voicemail": false,
"missed_call_sms_enabled": false,
"missed_call_sms_template": "<string>",
"is_active": true
}
'import requests
url = "https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows"
payload = {
"name": "<string>",
"language": "en-US",
"tts_voice": "Telnyx.NaturalHD.astra",
"max_recording_seconds": 155,
"missed_call_sms_delay_seconds": 30,
"provider_assistant_id": "<string>",
"forwarding_number": "<string>",
"caller_id_voice_number_id": 123,
"greeting": "<string>",
"notification_emails": ["jsmith@example.com"],
"notification_phones": ["<string>"],
"fallback_to_voicemail": False,
"missed_call_sms_enabled": False,
"missed_call_sms_template": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: 'en-US',
tts_voice: 'Telnyx.NaturalHD.astra',
max_recording_seconds: 155,
missed_call_sms_delay_seconds: 30,
provider_assistant_id: '<string>',
forwarding_number: '<string>',
caller_id_voice_number_id: 123,
greeting: '<string>',
notification_emails: ['jsmith@example.com'],
notification_phones: ['<string>'],
fallback_to_voicemail: false,
missed_call_sms_enabled: false,
missed_call_sms_template: '<string>',
is_active: true
})
};
fetch('https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows', 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.contactbutton.com/v1/workspaces/{workspace}/call-flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'language' => 'en-US',
'tts_voice' => 'Telnyx.NaturalHD.astra',
'max_recording_seconds' => 155,
'missed_call_sms_delay_seconds' => 30,
'provider_assistant_id' => '<string>',
'forwarding_number' => '<string>',
'caller_id_voice_number_id' => 123,
'greeting' => '<string>',
'notification_emails' => [
'jsmith@example.com'
],
'notification_phones' => [
'<string>'
],
'fallback_to_voicemail' => false,
'missed_call_sms_enabled' => false,
'missed_call_sms_template' => '<string>',
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.contactbutton.com/v1/workspaces/{workspace}/call-flows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}Create a call flow
POST
/
workspaces
/
{workspace}
/
call-flows
Create a call flow
curl --request POST \
--url https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "en-US",
"tts_voice": "Telnyx.NaturalHD.astra",
"max_recording_seconds": 155,
"missed_call_sms_delay_seconds": 30,
"provider_assistant_id": "<string>",
"forwarding_number": "<string>",
"caller_id_voice_number_id": 123,
"greeting": "<string>",
"notification_emails": [
"jsmith@example.com"
],
"notification_phones": [
"<string>"
],
"fallback_to_voicemail": false,
"missed_call_sms_enabled": false,
"missed_call_sms_template": "<string>",
"is_active": true
}
'import requests
url = "https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows"
payload = {
"name": "<string>",
"language": "en-US",
"tts_voice": "Telnyx.NaturalHD.astra",
"max_recording_seconds": 155,
"missed_call_sms_delay_seconds": 30,
"provider_assistant_id": "<string>",
"forwarding_number": "<string>",
"caller_id_voice_number_id": 123,
"greeting": "<string>",
"notification_emails": ["jsmith@example.com"],
"notification_phones": ["<string>"],
"fallback_to_voicemail": False,
"missed_call_sms_enabled": False,
"missed_call_sms_template": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: 'en-US',
tts_voice: 'Telnyx.NaturalHD.astra',
max_recording_seconds: 155,
missed_call_sms_delay_seconds: 30,
provider_assistant_id: '<string>',
forwarding_number: '<string>',
caller_id_voice_number_id: 123,
greeting: '<string>',
notification_emails: ['jsmith@example.com'],
notification_phones: ['<string>'],
fallback_to_voicemail: false,
missed_call_sms_enabled: false,
missed_call_sms_template: '<string>',
is_active: true
})
};
fetch('https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows', 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.contactbutton.com/v1/workspaces/{workspace}/call-flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'language' => 'en-US',
'tts_voice' => 'Telnyx.NaturalHD.astra',
'max_recording_seconds' => 155,
'missed_call_sms_delay_seconds' => 30,
'provider_assistant_id' => '<string>',
'forwarding_number' => '<string>',
'caller_id_voice_number_id' => 123,
'greeting' => '<string>',
'notification_emails' => [
'jsmith@example.com'
],
'notification_phones' => [
'<string>'
],
'fallback_to_voicemail' => false,
'missed_call_sms_enabled' => false,
'missed_call_sms_template' => '<string>',
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.contactbutton.com/v1/workspaces/{workspace}/call-flows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/workspaces/{workspace}/call-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"en-US\",\n \"tts_voice\": \"Telnyx.NaturalHD.astra\",\n \"max_recording_seconds\": 155,\n \"missed_call_sms_delay_seconds\": 30,\n \"provider_assistant_id\": \"<string>\",\n \"forwarding_number\": \"<string>\",\n \"caller_id_voice_number_id\": 123,\n \"greeting\": \"<string>\",\n \"notification_emails\": [\n \"jsmith@example.com\"\n ],\n \"notification_phones\": [\n \"<string>\"\n ],\n \"fallback_to_voicemail\": false,\n \"missed_call_sms_enabled\": false,\n \"missed_call_sms_template\": \"<string>\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}Authorizations
A Contact Button scoped bearer key. Send Authorization: Bearer <token>.
Token abilities are enforced independently of workspace membership; both checks must pass.
OAuth 2.0 authorization-code flows are not currently available.
Headers
Stable 8–120 character key for safe mutation retries.
Required string length:
8 - 120Path Parameters
Body
application/json
Maximum string length:
120Available options:
ai_agent, forwarding, voicemail, callback Maximum string length:
16Example:
"en-US"
Maximum string length:
120Example:
"Telnyx.NaturalHD.astra"
Required range:
10 <= x <= 300Required range:
0 <= x <= 3600Required for ai_agent mode. Use an assistant ID from the connected Telnyx account.
Maximum string length:
255Pattern:
^\+[1-9][0-9]{7,14}$Optional internal compatibility identifier. Omit unless returned by an authorized Contact Button client.
Required for voicemail and callback modes.
Maximum string length:
2000Maximum array length:
10Maximum array length:
10Pattern:
^\+[1-9][0-9]{7,14}$Maximum string length:
1000Related topics
Connect TelnyxList call flowsUpdate a call flowDelete an unused call flowPages and custom domainsWas this page helpful?
⌘I