Skip to main content
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>"
}
]
}

Headers

Authorization
string
required

API key for your Puppeteer organization.

Body

application/json
callee
string
required

The phone number to call, in E.164 format (e.g., +12025550123).

project_id
string
required

The UUID of the Puppeteer project.

timezone
string | null

Timezone for the thread (e.g., "America/Chicago").

json_data
string | null

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.

scheduled_for
string<date-time> | null

ISO 8601 datetime to schedule the call for a future time. If omitted, the call starts immediately.

background
boolean
default:false

When true, the call is queued and the endpoint returns 202 immediately. When false (default), the call is initiated synchronously.

retell_account_id
string | null

The UUID of the Retell account to use. Required when the project has multiple phone numbers.

Response

Successful Response

thread_id
string
required

The unique identifier for the thread (new or existing).

call
PublicCallInfo · object
required

Details about the initiated call.