Create a call
Initiate an outbound phone call using an agent.
The agent’s prompt and first_message support placeholders.
Pass variables to fill them dynamically per call.
Optionally override first_message entirely.
Provide a webhook_url to receive a POST when the call completes.
Set provider to “twilio” or “telnyx” to pick which provider places the
call when the agent has both configured. When omitted, Twilio is used if
configured, otherwise Telnyx.
Pass an Idempotency-Key header to safely retry this request: a repeat
with the same key and body replays the original response instead of
placing a second call; the same key with a different body is rejected.
curl --request POST \
--url https://app.eclatira.com/api/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"to_number": "<string>",
"variables": {},
"first_message": "<string>",
"webhook_url": "<string>",
"provider": "<string>"
}
'import requests
url = "https://app.eclatira.com/api/v1/calls"
payload = {
"agent_id": "<string>",
"to_number": "<string>",
"variables": {},
"first_message": "<string>",
"webhook_url": "<string>",
"provider": "<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({
agent_id: '<string>',
to_number: '<string>',
variables: {},
first_message: '<string>',
webhook_url: '<string>',
provider: '<string>'
})
};
fetch('https://app.eclatira.com/api/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://app.eclatira.com/api/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([
'agent_id' => '<string>',
'to_number' => '<string>',
'variables' => [
],
'first_message' => '<string>',
'webhook_url' => '<string>',
'provider' => '<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://app.eclatira.com/api/v1/calls"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<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://app.eclatira.com/api/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eclatira.com/api/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 \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"call_sid": "<string>",
"agent_id": "<string>",
"to_number": "<string>",
"status": "<string>",
"provider": "<string>",
"warnings": []
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
A long-lived, privileged API key (ek_... prefix), minted once from the dashboard. Intended for trusted server-side use only; never expose it in client-side code. Send as Authorization: Bearer ek_.... Required by every Calls, Batches, Agents, Tools, MCP Servers, Documents, and Realtime route.
Body
curl --request POST \
--url https://app.eclatira.com/api/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"to_number": "<string>",
"variables": {},
"first_message": "<string>",
"webhook_url": "<string>",
"provider": "<string>"
}
'import requests
url = "https://app.eclatira.com/api/v1/calls"
payload = {
"agent_id": "<string>",
"to_number": "<string>",
"variables": {},
"first_message": "<string>",
"webhook_url": "<string>",
"provider": "<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({
agent_id: '<string>',
to_number: '<string>',
variables: {},
first_message: '<string>',
webhook_url: '<string>',
provider: '<string>'
})
};
fetch('https://app.eclatira.com/api/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://app.eclatira.com/api/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([
'agent_id' => '<string>',
'to_number' => '<string>',
'variables' => [
],
'first_message' => '<string>',
'webhook_url' => '<string>',
'provider' => '<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://app.eclatira.com/api/v1/calls"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<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://app.eclatira.com/api/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eclatira.com/api/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 \"agent_id\": \"<string>\",\n \"to_number\": \"<string>\",\n \"variables\": {},\n \"first_message\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"call_sid": "<string>",
"agent_id": "<string>",
"to_number": "<string>",
"status": "<string>",
"provider": "<string>",
"warnings": []
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}