curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"toNumber": "+923001234567",
"variables": {
"patientName": "عائشہ صدیقی",
"doctorName": "ڈاکٹر عمران شیخ",
"appointmentTime": "کل صبح 11 بجے"
},
"additionalInstructions": "مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call"
payload = {
"toNumber": "+923001234567",
"variables": {
"patientName": "عائشہ صدیقی",
"doctorName": "ڈاکٹر عمران شیخ",
"appointmentTime": "کل صبح 11 بجے"
},
"additionalInstructions": "مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔"
}
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({
toNumber: '+923001234567',
variables: {
patientName: 'عائشہ صدیقی',
doctorName: 'ڈاکٹر عمران شیخ',
appointmentTime: 'کل صبح 11 بجے'
},
additionalInstructions: 'مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔'
})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/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([
'toNumber' => '+923001234567',
'variables' => [
'patientName' => 'عائشہ صدیقی',
'doctorName' => 'ڈاکٹر عمران شیخ',
'appointmentTime' => 'کل صبح 11 بجے'
],
'additionalInstructions' => 'مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔'
]),
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call"
payload := strings.NewReader("{\n \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call")
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 \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\n}"
response = http.request(request)
puts response.read_body{
"callId": "7c3f9a02-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"externalRef": "AD_xxxxxxxxxxxx",
"status": "dispatched"
}{
"message": [
"toNumber must be E.164 (e.g., +14155551234) or local format (e.g., 03001234567)"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Insufficient credits to start a realtime session",
"statusCode": 402
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"error": "duplicate_in_flight",
"callId": "7c3f9a02-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": "Organization concurrent outbound call limit reached",
"statusCode": 429
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Dispatch a call from this assistant
Dial a customer as this assistant. dispatched means the carrier accepted the call and it is about to ring, not that anyone picked up. The returned callId is also the sessionId: poll the session status for ringing, answer, and outcome. The response’s externalRef is the telephony reference to quote in support tickets.
Send an Idempotency-Key on retries so a timed-out request can’t place a second call; the key also makes the callId start with api_ instead of being a fresh UUID.
curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"toNumber": "+923001234567",
"variables": {
"patientName": "عائشہ صدیقی",
"doctorName": "ڈاکٹر عمران شیخ",
"appointmentTime": "کل صبح 11 بجے"
},
"additionalInstructions": "مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call"
payload = {
"toNumber": "+923001234567",
"variables": {
"patientName": "عائشہ صدیقی",
"doctorName": "ڈاکٹر عمران شیخ",
"appointmentTime": "کل صبح 11 بجے"
},
"additionalInstructions": "مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔"
}
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({
toNumber: '+923001234567',
variables: {
patientName: 'عائشہ صدیقی',
doctorName: 'ڈاکٹر عمران شیخ',
appointmentTime: 'کل صبح 11 بجے'
},
additionalInstructions: 'مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔'
})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/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([
'toNumber' => '+923001234567',
'variables' => [
'patientName' => 'عائشہ صدیقی',
'doctorName' => 'ڈاکٹر عمران شیخ',
'appointmentTime' => 'کل صبح 11 بجے'
],
'additionalInstructions' => 'مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔'
]),
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call"
payload := strings.NewReader("{\n \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/call")
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 \"toNumber\": \"+923001234567\",\n \"variables\": {\n \"patientName\": \"عائشہ صدیقی\",\n \"doctorName\": \"ڈاکٹر عمران شیخ\",\n \"appointmentTime\": \"کل صبح 11 بجے\"\n },\n \"additionalInstructions\": \"مریضہ کا نام عائشہ صدیقی ہے، اپائنٹمنٹ کل صبح 11 بجے ڈاکٹر عمران شیخ کے ساتھ ہے۔ اگر وہ کل نہ آ سکیں تو جمعرات دوپہر 3 بجے کا متبادل وقت پیش کریں۔\"\n}"
response = http.request(request)
puts response.read_body{
"callId": "7c3f9a02-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"externalRef": "AD_xxxxxxxxxxxx",
"status": "dispatched"
}{
"message": [
"toNumber must be E.164 (e.g., +14155551234) or local format (e.g., 03001234567)"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Insufficient credits to start a realtime session",
"statusCode": 402
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"error": "duplicate_in_flight",
"callId": "7c3f9a02-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": "Organization concurrent outbound call limit reached",
"statusCode": 429
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Authorizations
Project API key (sk_api_…).
Headers
Caller-chosen key that fixes the call id, so a retried request cannot dial twice. Scoped to this assistant.
256Path Parameters
Body
Number to dial, either E.164 (+923001234567) or a local leading-zero number (03001234567).
^(\+[1-9]\d{1,14}|0\d{8,14})$"+923001234567"
Caller ID to dial from, E.164. Only the format is checked, so a number your organization doesn't own dispatches and then fails at the carrier. Omit to let the platform allocate one.
^\+[1-9]\d{1,14}$"+924232175000"
Facts about this caller, like crop: cotton. They reach the model as a caller record after the prompt, and come back verbatim on every session read. String, number and boolean values go to the model. A nested object stays on the record only. Keys up to 64 characters, and the serialized object must stay under 3000 characters.
Appended to the assistant's instructions for this call only.
2000Which version of the assistant runs. prod is the published version, or the draft before the first publish. draft tries unpublished edits on a real conversation. A number runs that exact published version, and one never published is a 404. Send a number as a JSON number, not a string.
prod, draft "draft"
