Create Phone Call
curl --request POST \
--url https://api.puppeteerai.com/voice/phone-call \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"callee": "<string>",
"project_id": "<string>",
"timezone": "<string>",
"json_data": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"background": false,
"retell_account_id": "<string>"
}
'import requests
url = "https://api.puppeteerai.com/voice/phone-call"
payload = {
"callee": "<string>",
"project_id": "<string>",
"timezone": "<string>",
"json_data": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"background": False,
"retell_account_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callee: '<string>',
project_id: '<string>',
timezone: '<string>',
json_data: '<string>',
scheduled_for: '2023-11-07T05:31:56Z',
background: false,
retell_account_id: '<string>'
})
};
fetch('https://api.puppeteerai.com/voice/phone-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.puppeteerai.com/voice/phone-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([
'callee' => '<string>',
'project_id' => '<string>',
'timezone' => '<string>',
'json_data' => '<string>',
'scheduled_for' => '2023-11-07T05:31:56Z',
'background' => false,
'retell_account_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.puppeteerai.com/voice/phone-call"
payload := strings.NewReader("{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/voice/phone-call")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/voice/phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"call": {
"id": "<string>",
"call_type": "<string>",
"status": "<string>",
"to_number": "<string>",
"from_number": "<string>",
"scheduled_for": "<string>",
"start_timestamp": 123,
"end_timestamp": 123,
"duration_ms": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Voice
Create Phone Call
Find or create a thread for the given phone number and project, then initiate a phone call.
POST
/
voice
/
phone-call
Create Phone Call
curl --request POST \
--url https://api.puppeteerai.com/voice/phone-call \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"callee": "<string>",
"project_id": "<string>",
"timezone": "<string>",
"json_data": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"background": false,
"retell_account_id": "<string>"
}
'import requests
url = "https://api.puppeteerai.com/voice/phone-call"
payload = {
"callee": "<string>",
"project_id": "<string>",
"timezone": "<string>",
"json_data": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"background": False,
"retell_account_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callee: '<string>',
project_id: '<string>',
timezone: '<string>',
json_data: '<string>',
scheduled_for: '2023-11-07T05:31:56Z',
background: false,
retell_account_id: '<string>'
})
};
fetch('https://api.puppeteerai.com/voice/phone-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.puppeteerai.com/voice/phone-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([
'callee' => '<string>',
'project_id' => '<string>',
'timezone' => '<string>',
'json_data' => '<string>',
'scheduled_for' => '2023-11-07T05:31:56Z',
'background' => false,
'retell_account_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.puppeteerai.com/voice/phone-call"
payload := strings.NewReader("{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/voice/phone-call")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/voice/phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callee\": \"<string>\",\n \"project_id\": \"<string>\",\n \"timezone\": \"<string>\",\n \"json_data\": \"<string>\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"background\": false,\n \"retell_account_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"call": {
"id": "<string>",
"call_type": "<string>",
"status": "<string>",
"to_number": "<string>",
"from_number": "<string>",
"scheduled_for": "<string>",
"start_timestamp": 123,
"end_timestamp": 123,
"duration_ms": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
API key for your Puppeteer organization.
Body
application/json
The phone number to call, in E.164 format (e.g., +12025550123).
The UUID of the Puppeteer project.
Timezone for the thread (e.g., "America/Chicago").
JSON data as a string to be sent to the thread upon creation. This data will be processed by the thread's JSON input handler.
ISO 8601 datetime to schedule the call for a future time. If omitted, the call starts immediately.
When true, the call is queued and the endpoint returns 202 immediately. When false (default), the call is initiated synchronously.
The UUID of the Retell account to use. Required when the project has multiple phone numbers.
⌘I