Create Outbound Call
curl --request POST \
--url https://api.pathors.com/v1/calls/outbound \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {}
}
'import requests
url = "https://api.pathors.com/v1/calls/outbound"
payload = {
"projectId": "<string>",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {}
}
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({
projectId: '<string>',
fromNumber: '<string>',
toNumber: '<string>',
dynamicVariables: {}
})
};
fetch('https://api.pathors.com/v1/calls/outbound', 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.pathors.com/v1/calls/outbound",
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([
'projectId' => '<string>',
'fromNumber' => '<string>',
'toNumber' => '<string>',
'dynamicVariables' => [
]
]),
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.pathors.com/v1/calls/outbound"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\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.pathors.com/v1/calls/outbound")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/calls/outbound")
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 \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\n}"
response = http.request(request)
puts response.read_bodyCreate Outbound Call
Initiate an outbound phone call from a configured pool number to a target number
POST
/
v1
/
calls
/
outbound
Create Outbound Call
curl --request POST \
--url https://api.pathors.com/v1/calls/outbound \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {}
}
'import requests
url = "https://api.pathors.com/v1/calls/outbound"
payload = {
"projectId": "<string>",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {}
}
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({
projectId: '<string>',
fromNumber: '<string>',
toNumber: '<string>',
dynamicVariables: {}
})
};
fetch('https://api.pathors.com/v1/calls/outbound', 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.pathors.com/v1/calls/outbound",
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([
'projectId' => '<string>',
'fromNumber' => '<string>',
'toNumber' => '<string>',
'dynamicVariables' => [
]
]),
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.pathors.com/v1/calls/outbound"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\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.pathors.com/v1/calls/outbound")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/calls/outbound")
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 \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"toNumber\": \"<string>\",\n \"dynamicVariables\": {}\n}"
response = http.request(request)
puts response.read_bodyCreates an outbound call request. The call is queued and dispatched by the outbound scheduler; this endpoint returns as soon as the request is accepted, not when the call is connected.
The agent used for the call is automatically resolved from the project — there is no agent selector. Each project corresponds to one agent.
Request
POST https://api.pathors.com/v1/calls/outbound
Headers
string
required
Bearer token using your developer key (
dk_...).Body
string
required
The project that will own this call. The authenticated user must be a member of this project.
string
required
The source phone number. Must be
active in a number pool that the authenticated user is a member of, and must have an outbound trunk configured.string
required
The destination phone number, in E.164 format (e.g.
+886912345678). Must be different from fromNumber — a call dialing its own caller ID is rejected.object
Optional key-value map injected into the agent session as runtime variables. Values can be referenced from your pathway and prompts.
Example
curl -X POST https://api.pathors.com/v1/calls/outbound \
-H "Authorization: Bearer dk_your_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_abc123",
"fromNumber": "+886912345678",
"toNumber": "+886987654321",
"dynamicVariables": {
"customerName": "Jane Doe",
"orderId": "12345"
}
}'
Response
Returns200 OK once the call request is accepted into the dispatch queue.
{
"success": true
}
Errors
| Status | When |
|---|---|
| 400 | Validation error, fromNumber exists but is not active, or fromNumber and toNumber are the same number |
| 401 | Missing or invalid developer key |
| 402 | Project has insufficient credits to start an outbound call |
| 403 | The user has no access to projectId, or fromNumber does not belong to a number pool the user is a member of |
| 404 | fromNumber is not found, or has no outbound trunk configured |
| 409 | An outbound call to this toNumber is already in flight |
| 500 | Internal server error |
Notes
- Agent: The agent is resolved from
projectIdautomatically. The configured agent for that project will handle the call. - From-number ownership: The caller (developer key user) must be a member of the number pool that owns
fromNumber. Project membership is checked separately forprojectId. - Variables:
dynamicVariablesare stringified into the LiveKit room metadata and made available to the agent for the duration of the session. - Concurrency: The same
toNumbercannot have more than one in-flight outbound call at a time. Wait for the previous call to complete before retrying.
