curl --request POST \
--url https://api.wave.sa/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"caller_id_name": "<string>",
"caller_id_number": "<string>",
"metadata": {},
"machine_detection": true,
"callflow": "<string>"
}
'import requests
url = "https://api.wave.sa/v1/calls"
payload = {
"to": "<string>",
"caller_id_name": "<string>",
"caller_id_number": "<string>",
"metadata": {},
"machine_detection": True,
"callflow": "<string>"
}
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({
to: '<string>',
caller_id_name: '<string>',
caller_id_number: '<string>',
metadata: {},
machine_detection: true,
callflow: '<string>'
})
};
fetch('https://api.wave.sa/v1/calls', 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/calls",
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([
'to' => '<string>',
'caller_id_name' => '<string>',
'caller_id_number' => '<string>',
'metadata' => [
],
'machine_detection' => true,
'callflow' => '<string>'
]),
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/calls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\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.wave.sa/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wave.sa/v1/calls")
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 \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"status": "initiated",
"direction": "outbound",
"to": "<string>",
"from": "<string>",
"sandbox": 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>"
}{
"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>"
}Place an outbound call
Programmatically originates a call to to. Requires the calls:write scope. A production key (sk_live_) places the call from your project’s own number. A sandbox key (sk_sandbox_) places a real call from the shared Wave number; it counts toward the project’s 15 sandbox minutes and is not billed. When the minutes are used up, a real sandbox call returns 403 SANDBOX_MINUTES_EXCEEDED. Test your IVR: send callflow (the name of a stored callflow of your organization) with a sandbox key, and the call plays that flow from the first turn: its live version, or its newest saved version when none is live. A production key gets 400 VALIDATION_ERROR for callflow; an unknown name gets 404 NOT_FOUND; callflow cannot be combined with machine_detection; a callflow that is not a menu or a graph gets 400 VALIDATION_ERROR. With machine_detection: true, Wave checks who answers first: a machine → Wave hangs up; a person (or not sure) → the call goes on as usual. The verdict is machine_detection_result on the call log and in call.answered / call.ended. machine_detection returns 400 where campaigns are not enabled yet.
curl --request POST \
--url https://api.wave.sa/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"caller_id_name": "<string>",
"caller_id_number": "<string>",
"metadata": {},
"machine_detection": true,
"callflow": "<string>"
}
'import requests
url = "https://api.wave.sa/v1/calls"
payload = {
"to": "<string>",
"caller_id_name": "<string>",
"caller_id_number": "<string>",
"metadata": {},
"machine_detection": True,
"callflow": "<string>"
}
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({
to: '<string>',
caller_id_name: '<string>',
caller_id_number: '<string>',
metadata: {},
machine_detection: true,
callflow: '<string>'
})
};
fetch('https://api.wave.sa/v1/calls', 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/calls",
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([
'to' => '<string>',
'caller_id_name' => '<string>',
'caller_id_number' => '<string>',
'metadata' => [
],
'machine_detection' => true,
'callflow' => '<string>'
]),
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/calls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\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.wave.sa/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wave.sa/v1/calls")
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 \"to\": \"<string>\",\n \"caller_id_name\": \"<string>\",\n \"caller_id_number\": \"<string>\",\n \"metadata\": {},\n \"machine_detection\": true,\n \"callflow\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"status": "initiated",
"direction": "outbound",
"to": "<string>",
"from": "<string>",
"sandbox": 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>"
}{
"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
Headers
Recommended. 1–255 printable ASCII characters (no spaces): a new random value per call, the same value on each retry. Within 24 hours, a retry with the same key and the same request gets the first reply (header x-idempotent-replayed: true) and places no second call. See https://docs.wave.sa/idempotency.
1 - 255
