curl --request POST \
--url https://api.callrounded.com/v1/calls/phone \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"from_number": "<string>",
"to_number": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dynamic_variables_values": {
"active": true,
"age": 35,
"appointment_date": "2023-05-15T14:30:00Z",
"first_name": "John",
"last_name": "Doe",
"opening_hours": {
"monday": [
{
"end": "17:00",
"start": "07:00"
}
]
}
},
"custom_headers": {
"From": "Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a",
"X-Custom-Header": "value"
}
}
'import requests
url = "https://api.callrounded.com/v1/calls/phone"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dynamic_variables_values": {
"active": True,
"age": 35,
"appointment_date": "2023-05-15T14:30:00Z",
"first_name": "John",
"last_name": "Doe",
"opening_hours": { "monday": [
{
"end": "17:00",
"start": "07:00"
}
] }
},
"custom_headers": {
"From": "Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a",
"X-Custom-Header": "value"
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_number: '<string>',
to_number: '<string>',
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dynamic_variables_values: {
active: true,
age: 35,
appointment_date: '2023-05-15T14:30:00Z',
first_name: 'John',
last_name: 'Doe',
opening_hours: {monday: [{end: '17:00', start: '07:00'}]}
},
custom_headers: {
From: 'Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a',
'X-Custom-Header': 'value'
}
})
};
fetch('https://api.callrounded.com/v1/calls/phone', 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.callrounded.com/v1/calls/phone",
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([
'from_number' => '<string>',
'to_number' => '<string>',
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dynamic_variables_values' => [
'active' => true,
'age' => 35,
'appointment_date' => '2023-05-15T14:30:00Z',
'first_name' => 'John',
'last_name' => 'Doe',
'opening_hours' => [
'monday' => [
[
'end' => '17:00',
'start' => '07:00'
]
]
]
],
'custom_headers' => [
'From' => 'Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a',
'X-Custom-Header' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.callrounded.com/v1/calls/phone"
payload := strings.NewReader("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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.post("https://api.callrounded.com/v1/calls/phone")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/calls/phone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"message": "Phone call started successfully",
"status": 201
}Start a new phone call
Start a new phone call with the specified parameters. The response includes headers about rate limiting.
curl --request POST \
--url https://api.callrounded.com/v1/calls/phone \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"from_number": "<string>",
"to_number": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dynamic_variables_values": {
"active": true,
"age": 35,
"appointment_date": "2023-05-15T14:30:00Z",
"first_name": "John",
"last_name": "Doe",
"opening_hours": {
"monday": [
{
"end": "17:00",
"start": "07:00"
}
]
}
},
"custom_headers": {
"From": "Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a",
"X-Custom-Header": "value"
}
}
'import requests
url = "https://api.callrounded.com/v1/calls/phone"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dynamic_variables_values": {
"active": True,
"age": 35,
"appointment_date": "2023-05-15T14:30:00Z",
"first_name": "John",
"last_name": "Doe",
"opening_hours": { "monday": [
{
"end": "17:00",
"start": "07:00"
}
] }
},
"custom_headers": {
"From": "Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a",
"X-Custom-Header": "value"
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_number: '<string>',
to_number: '<string>',
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dynamic_variables_values: {
active: true,
age: 35,
appointment_date: '2023-05-15T14:30:00Z',
first_name: 'John',
last_name: 'Doe',
opening_hours: {monday: [{end: '17:00', start: '07:00'}]}
},
custom_headers: {
From: 'Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a',
'X-Custom-Header': 'value'
}
})
};
fetch('https://api.callrounded.com/v1/calls/phone', 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.callrounded.com/v1/calls/phone",
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([
'from_number' => '<string>',
'to_number' => '<string>',
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dynamic_variables_values' => [
'active' => true,
'age' => 35,
'appointment_date' => '2023-05-15T14:30:00Z',
'first_name' => 'John',
'last_name' => 'Doe',
'opening_hours' => [
'monday' => [
[
'end' => '17:00',
'start' => '07:00'
]
]
]
],
'custom_headers' => [
'From' => 'Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a',
'X-Custom-Header' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.callrounded.com/v1/calls/phone"
payload := strings.NewReader("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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.post("https://api.callrounded.com/v1/calls/phone")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/calls/phone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dynamic_variables_values\": {\n \"active\": true,\n \"age\": 35,\n \"appointment_date\": \"2023-05-15T14:30:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"opening_hours\": {\n \"monday\": [\n {\n \"end\": \"17:00\",\n \"start\": \"07:00\"\n }\n ]\n }\n },\n \"custom_headers\": {\n \"From\": \"Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"X-Custom-Header\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"message": "Phone call started successfully",
"status": 201
}Authorizations
The API Key created in Rounded Studio.
- You can create it by going to the "API Keys" settings of your profile.
- Need help? You can email us at team@callrounded.com or join our Discord community.
Body
Phone number emitting the call, in E.164 format. It must be a phone number from your Rounded organization.
8"+33912345678"
Phone number receiving the call, in E.164 format.
8"+33612345678"
Id of the agent making the call. You can get the id from your agent's config page URL, e.g. https://app.callrounded.com/agents/411b82c8-462a-4e1b-89bc-10ab3ce1ed29.
"411b82c8-462a-4e1b-89bc-10ab3ce1ed29"
Values for the variables that should be initialized before call starts, provided as a JSON object. Values can be strings, numbers, booleans, or nested JSON objects.
Show child attributes
Show child attributes
{
"active": true,
"age": 35,
"appointment_date": "2023-05-15T14:30:00Z",
"first_name": "John",
"last_name": "Doe",
"opening_hours": {
"monday": [{ "end": "17:00", "start": "07:00" }]
}
}
If SIP is used, the custom headers will be forwarded to the configured trunk provider when sending the INVITE request to start the call. If more control is needed, it's also possible to override default headers like From, To, P-Asserted-Identity, etc.
Show child attributes
Show child attributes
{
"From": "Anonymous <sip:anonymous@example.com>;tag=3c90c3cc-0d44-4b50-8888-8dd25736052a",
"X-Custom-Header": "value"
}
Response
Successfully started phone call
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
}