Initiate Outbound Call
curl --request POST \
--url https://api.trillet.ai/v1/api/call \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"to": "<string>",
"call_agent_id": "<string>",
"callback_url": "<string>",
"dynamic_variables": {
"firstName": "<string>",
"lastName": "<string>",
"Zipcode": "<string>",
"address": "<string>",
"email": "<string>"
},
"metadata": {}
}
'import requests
url = "https://api.trillet.ai/v1/api/call"
payload = {
"to": "<string>",
"call_agent_id": "<string>",
"callback_url": "<string>",
"dynamic_variables": {
"firstName": "<string>",
"lastName": "<string>",
"Zipcode": "<string>",
"address": "<string>",
"email": "<string>"
},
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"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>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '<string>',
call_agent_id: '<string>',
callback_url: '<string>',
dynamic_variables: {
firstName: '<string>',
lastName: '<string>',
Zipcode: '<string>',
address: '<string>',
email: '<string>'
},
metadata: {}
})
};
fetch('https://api.trillet.ai/v1/api/call', 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.trillet.ai/v1/api/call",
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>',
'call_agent_id' => '<string>',
'callback_url' => '<string>',
'dynamic_variables' => [
'firstName' => '<string>',
'lastName' => '<string>',
'Zipcode' => '<string>',
'address' => '<string>',
'email' => '<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/call"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.trillet.ai/v1/api/call")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call")
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["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"call_id": "123456789",
"message": "Call initiated successfully"
}
Calls
Initiate Outbound Call
Send an AI-driven phone call to a given number.
POST
/
v1
/
api
/
call
Initiate Outbound Call
curl --request POST \
--url https://api.trillet.ai/v1/api/call \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"to": "<string>",
"call_agent_id": "<string>",
"callback_url": "<string>",
"dynamic_variables": {
"firstName": "<string>",
"lastName": "<string>",
"Zipcode": "<string>",
"address": "<string>",
"email": "<string>"
},
"metadata": {}
}
'import requests
url = "https://api.trillet.ai/v1/api/call"
payload = {
"to": "<string>",
"call_agent_id": "<string>",
"callback_url": "<string>",
"dynamic_variables": {
"firstName": "<string>",
"lastName": "<string>",
"Zipcode": "<string>",
"address": "<string>",
"email": "<string>"
},
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"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>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '<string>',
call_agent_id: '<string>',
callback_url: '<string>',
dynamic_variables: {
firstName: '<string>',
lastName: '<string>',
Zipcode: '<string>',
address: '<string>',
email: '<string>'
},
metadata: {}
})
};
fetch('https://api.trillet.ai/v1/api/call', 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.trillet.ai/v1/api/call",
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>',
'call_agent_id' => '<string>',
'callback_url' => '<string>',
'dynamic_variables' => [
'firstName' => '<string>',
'lastName' => '<string>',
'Zipcode' => '<string>',
'address' => '<string>',
'email' => '<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/call"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.trillet.ai/v1/api/call")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call")
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["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"call_agent_id\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"dynamic_variables\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"Zipcode\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"call_id": "123456789",
"message": "Call initiated successfully"
}
Headers
string
required
API key used for authenticating requests to the API.
string
required
Workspace identifier for the API.
Request Body
string
required
The phone number to which the call will be made.
string
required
The ID of the agent assigned to make the call.
string
A URL to receive webhook events about the call. If provided, this URL will be used for notifications.
object
Dynamic variables that can be used to customize call scripts. Each key represents a variable that can be inserted into the call script dynamically. For example:
Show Dynamic Variables Details
Show Dynamic Variables Details
object
Any fields passed here will be sent to the call agent and directly passed to the webhook triggered by the agent under its ‘metadata’ header, but they will not be included in the call agent’s context.
Show Metadata Details
Show Metadata Details
Response Fields
string
The status of the request, indicating the success or failure of the call initiation.
string
A unique identifier assigned to the initiated call. This ID can be used to track the call’s progress or retrieve its details later.
string
A message providing feedback about the call initiation process, typically confirming successful initiation or describing an error.
{
"status": "success",
"call_id": "123456789",
"message": "Call initiated successfully"
}
⌘I
