Edit a menu (append a version)
curl --request PUT \
--url https://api.wave.sa/v1/callflows/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"prompt": {
"say": {
"text": "<string>",
"language": "<string>"
},
"play": {
"audio_ref": "<string>"
}
},
"branches": [
{
"digit": "<string>",
"action": {
"say": {
"text": "<string>",
"language": "<string>"
}
},
"input": {}
}
],
"gather": {
"num_digits": 1,
"timeout_seconds": 8
},
"no_input": {
"action": {
"say": {
"text": "<string>",
"language": "<string>"
}
},
"input": {}
}
},
"activate": false
}
'import requests
url = "https://api.wave.sa/v1/callflows/{name}"
payload = {
"definition": {
"prompt": {
"say": {
"text": "<string>",
"language": "<string>"
},
"play": { "audio_ref": "<string>" }
},
"branches": [
{
"digit": "<string>",
"action": { "say": {
"text": "<string>",
"language": "<string>"
} },
"input": {}
}
],
"gather": {
"num_digits": 1,
"timeout_seconds": 8
},
"no_input": {
"action": { "say": {
"text": "<string>",
"language": "<string>"
} },
"input": {}
}
},
"activate": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
prompt: {say: {text: '<string>', language: '<string>'}, play: {audio_ref: '<string>'}},
branches: [
{
digit: '<string>',
action: {say: {text: '<string>', language: '<string>'}},
input: {}
}
],
gather: {num_digits: 1, timeout_seconds: 8},
no_input: {action: {say: {text: '<string>', language: '<string>'}}, input: {}}
},
activate: false
})
};
fetch('https://api.wave.sa/v1/callflows/{name}', 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.wave.sa/v1/callflows/{name}",
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' => [
'prompt' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
],
'play' => [
'audio_ref' => '<string>'
]
],
'branches' => [
[
'digit' => '<string>',
'action' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
]
],
'input' => [
]
]
],
'gather' => [
'num_digits' => 1,
'timeout_seconds' => 8
],
'no_input' => [
'action' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
]
],
'input' => [
]
]
],
'activate' => false
]),
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.wave.sa/v1/callflows/{name}"
payload := strings.NewReader("{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.wave.sa/v1/callflows/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wave.sa/v1/callflows/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"version": 123,
"is_active": true,
"definition": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"versions": [
{
"version": 123,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}Callflows
Edit a menu (append a version)
Menus are immutable/append-only — this adds the next version. Requires callflows:write.
PUT
/
v1
/
callflows
/
{name}
Edit a menu (append a version)
curl --request PUT \
--url https://api.wave.sa/v1/callflows/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"prompt": {
"say": {
"text": "<string>",
"language": "<string>"
},
"play": {
"audio_ref": "<string>"
}
},
"branches": [
{
"digit": "<string>",
"action": {
"say": {
"text": "<string>",
"language": "<string>"
}
},
"input": {}
}
],
"gather": {
"num_digits": 1,
"timeout_seconds": 8
},
"no_input": {
"action": {
"say": {
"text": "<string>",
"language": "<string>"
}
},
"input": {}
}
},
"activate": false
}
'import requests
url = "https://api.wave.sa/v1/callflows/{name}"
payload = {
"definition": {
"prompt": {
"say": {
"text": "<string>",
"language": "<string>"
},
"play": { "audio_ref": "<string>" }
},
"branches": [
{
"digit": "<string>",
"action": { "say": {
"text": "<string>",
"language": "<string>"
} },
"input": {}
}
],
"gather": {
"num_digits": 1,
"timeout_seconds": 8
},
"no_input": {
"action": { "say": {
"text": "<string>",
"language": "<string>"
} },
"input": {}
}
},
"activate": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
prompt: {say: {text: '<string>', language: '<string>'}, play: {audio_ref: '<string>'}},
branches: [
{
digit: '<string>',
action: {say: {text: '<string>', language: '<string>'}},
input: {}
}
],
gather: {num_digits: 1, timeout_seconds: 8},
no_input: {action: {say: {text: '<string>', language: '<string>'}}, input: {}}
},
activate: false
})
};
fetch('https://api.wave.sa/v1/callflows/{name}', 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.wave.sa/v1/callflows/{name}",
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' => [
'prompt' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
],
'play' => [
'audio_ref' => '<string>'
]
],
'branches' => [
[
'digit' => '<string>',
'action' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
]
],
'input' => [
]
]
],
'gather' => [
'num_digits' => 1,
'timeout_seconds' => 8
],
'no_input' => [
'action' => [
'say' => [
'text' => '<string>',
'language' => '<string>'
]
],
'input' => [
]
]
],
'activate' => false
]),
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.wave.sa/v1/callflows/{name}"
payload := strings.NewReader("{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.wave.sa/v1/callflows/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wave.sa/v1/callflows/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {\n \"prompt\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"play\": {\n \"audio_ref\": \"<string>\"\n }\n },\n \"branches\": [\n {\n \"digit\": \"<string>\",\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n ],\n \"gather\": {\n \"num_digits\": 1,\n \"timeout_seconds\": 8\n },\n \"no_input\": {\n \"action\": {\n \"say\": {\n \"text\": \"<string>\",\n \"language\": \"<string>\"\n }\n },\n \"input\": {}\n }\n },\n \"activate\": false\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"version": 123,
"is_active": true,
"definition": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"versions": [
{
"version": 123,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"error_code": "INVALID_API_KEY",
"message": "<string>",
"message_ar": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}Authorizations
Your API key from the Wave dashboard. Sandbox keys start sk_sandbox_; production keys start sk_live_. Send as Authorization: Bearer <key>. Some endpoints require a production key and specific scopes.
Path Parameters
The menu name (unique per org).

