Place an outbound AI phone call
curl --request POST \
--url https://api.dairo.app/v1/phone/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"from": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"voice": "Rime.Coda.lorelei",
"model": "anthropic/claude-haiku-4-5",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 600,
"record": true,
"variables": {},
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.dairo.app/v1/phone/calls"
payload = {
"to": "<string>",
"from": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"voice": "Rime.Coda.lorelei",
"model": "anthropic/claude-haiku-4-5",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 600,
"record": True,
"variables": {},
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<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>',
from: '<string>',
instructions: '<string>',
greeting: '<string>',
voice: 'Rime.Coda.lorelei',
model: 'anthropic/claude-haiku-4-5',
language: '<string>',
backgroundAudio: 'silence',
maxDurationSeconds: 600,
record: true,
variables: {},
webhookUrl: '<string>',
metadata: {},
idempotencyKey: '<string>'
})
};
fetch('https://api.dairo.app/v1/phone/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.dairo.app/v1/phone/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>',
'from' => '<string>',
'instructions' => '<string>',
'greeting' => '<string>',
'voice' => 'Rime.Coda.lorelei',
'model' => 'anthropic/claude-haiku-4-5',
'language' => '<string>',
'backgroundAudio' => 'silence',
'maxDurationSeconds' => 600,
'record' => true,
'variables' => [
],
'webhookUrl' => '<string>',
'metadata' => [
],
'idempotencyKey' => '<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.dairo.app/v1/phone/calls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<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.dairo.app/v1/phone/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/phone/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 \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "phone_call",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "outbound",
"status": "queued",
"fromNumber": "<string>",
"toNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"instructions": "<string>",
"greeting": "<string>",
"voice": "<string>",
"model": "<string>",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 123,
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"answeredAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"hangupCause": "<string>",
"answeredBy": "<string>",
"summary": "<string>",
"costUsd": 123,
"error": "<string>",
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<string>"
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Phone
Place an outbound AI phone call
Place an outbound AI phone call
POST
/
v1
/
phone
/
calls
Place an outbound AI phone call
curl --request POST \
--url https://api.dairo.app/v1/phone/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"from": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"voice": "Rime.Coda.lorelei",
"model": "anthropic/claude-haiku-4-5",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 600,
"record": true,
"variables": {},
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.dairo.app/v1/phone/calls"
payload = {
"to": "<string>",
"from": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"voice": "Rime.Coda.lorelei",
"model": "anthropic/claude-haiku-4-5",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 600,
"record": True,
"variables": {},
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<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>',
from: '<string>',
instructions: '<string>',
greeting: '<string>',
voice: 'Rime.Coda.lorelei',
model: 'anthropic/claude-haiku-4-5',
language: '<string>',
backgroundAudio: 'silence',
maxDurationSeconds: 600,
record: true,
variables: {},
webhookUrl: '<string>',
metadata: {},
idempotencyKey: '<string>'
})
};
fetch('https://api.dairo.app/v1/phone/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.dairo.app/v1/phone/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>',
'from' => '<string>',
'instructions' => '<string>',
'greeting' => '<string>',
'voice' => 'Rime.Coda.lorelei',
'model' => 'anthropic/claude-haiku-4-5',
'language' => '<string>',
'backgroundAudio' => 'silence',
'maxDurationSeconds' => 600,
'record' => true,
'variables' => [
],
'webhookUrl' => '<string>',
'metadata' => [
],
'idempotencyKey' => '<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.dairo.app/v1/phone/calls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<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.dairo.app/v1/phone/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/phone/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 \"from\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"voice\": \"Rime.Coda.lorelei\",\n \"model\": \"anthropic/claude-haiku-4-5\",\n \"language\": \"<string>\",\n \"backgroundAudio\": \"silence\",\n \"maxDurationSeconds\": 600,\n \"record\": true,\n \"variables\": {},\n \"webhookUrl\": \"<string>\",\n \"metadata\": {},\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "phone_call",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "outbound",
"status": "queued",
"fromNumber": "<string>",
"toNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"instructions": "<string>",
"greeting": "<string>",
"voice": "<string>",
"model": "<string>",
"language": "<string>",
"backgroundAudio": "silence",
"maxDurationSeconds": 123,
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"answeredAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"hangupCause": "<string>",
"answeredBy": "<string>",
"summary": "<string>",
"costUsd": 123,
"error": "<string>",
"webhookUrl": "<string>",
"metadata": {},
"idempotencyKey": "<string>"
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
Dairo API key, e.g. dairo_test_... or dairo_live_...
Headers
Optional idempotency key for safe retries of side-effecting operations.
Maximum string length:
128Body
application/json
Destination, E.164. A real phone rings here.
Caller id, E.164. MUST be a number this account owns with status active.
What the agent should accomplish. Supports {{handlebars}} filled from variables.
Maximum string length:
8000Opening line spoken when the callee answers.
Available options:
silence, office, none Hard cap on call length. The provider's own floor is 30 seconds.
Required range:
30 <= x <= 1800Values for {{handlebars}} placeholders.
A retried request returns the original call rather than dialing the human twice.
Response
Success
Allowed value:
"phone_call"Available options:
outbound, inbound Terminal: completed, failed, no_answer, busy, canceled.
Available options:
queued, initiating, ringing, in_progress, completed, failed, no_answer, busy, canceled Available options:
silence, office, none, null human or machine, from answering-machine detection.
Billed per started minute.