Create outbound campaign
curl --request POST \
--url https://api.pathors.com/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"fromNumber": "<string>",
"name": "<string>",
"schedule": {
"timezone": "<string>",
"windows": [
{
"dayOfWeek": 3,
"startTime": "<string>",
"endTime": "<string>"
}
]
},
"contacts": [
{
"contactNumber": "<string>",
"dynamicVariables": {}
}
],
"description": "<string>",
"status": "draft"
}
'import requests
url = "https://api.pathors.com/v1/campaigns"
payload = {
"projectId": "<string>",
"fromNumber": "<string>",
"name": "<string>",
"schedule": {
"timezone": "<string>",
"windows": [
{
"dayOfWeek": 3,
"startTime": "<string>",
"endTime": "<string>"
}
]
},
"contacts": [
{
"contactNumber": "<string>",
"dynamicVariables": {}
}
],
"description": "<string>",
"status": "draft"
}
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({
projectId: '<string>',
fromNumber: '<string>',
name: '<string>',
schedule: {
timezone: '<string>',
windows: [{dayOfWeek: 3, startTime: '<string>', endTime: '<string>'}]
},
contacts: [{contactNumber: '<string>', dynamicVariables: {}}],
description: '<string>',
status: 'draft'
})
};
fetch('https://api.pathors.com/v1/campaigns', 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/campaigns",
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>',
'name' => '<string>',
'schedule' => [
'timezone' => '<string>',
'windows' => [
[
'dayOfWeek' => 3,
'startTime' => '<string>',
'endTime' => '<string>'
]
]
],
'contacts' => [
[
'contactNumber' => '<string>',
'dynamicVariables' => [
]
]
],
'description' => '<string>',
'status' => 'draft'
]),
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.pathors.com/v1/campaigns"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\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.pathors.com/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/campaigns")
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 \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "<string>",
"status": "<string>",
"totalContacts": 123,
"duplicatesSkipped": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Campaigns
Create outbound campaign
Create an outbound campaign with its call list. fromNumber must be an active pool number with an outbound trunk, in the same organization as projectId. Contacts are validated as E.164 and de-duplicated within the batch; the call list is immutable after creation. Campaigns are created as draft unless status says otherwise — activate separately to start dialing.
POST
/
v1
/
campaigns
Create outbound campaign
curl --request POST \
--url https://api.pathors.com/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"fromNumber": "<string>",
"name": "<string>",
"schedule": {
"timezone": "<string>",
"windows": [
{
"dayOfWeek": 3,
"startTime": "<string>",
"endTime": "<string>"
}
]
},
"contacts": [
{
"contactNumber": "<string>",
"dynamicVariables": {}
}
],
"description": "<string>",
"status": "draft"
}
'import requests
url = "https://api.pathors.com/v1/campaigns"
payload = {
"projectId": "<string>",
"fromNumber": "<string>",
"name": "<string>",
"schedule": {
"timezone": "<string>",
"windows": [
{
"dayOfWeek": 3,
"startTime": "<string>",
"endTime": "<string>"
}
]
},
"contacts": [
{
"contactNumber": "<string>",
"dynamicVariables": {}
}
],
"description": "<string>",
"status": "draft"
}
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({
projectId: '<string>',
fromNumber: '<string>',
name: '<string>',
schedule: {
timezone: '<string>',
windows: [{dayOfWeek: 3, startTime: '<string>', endTime: '<string>'}]
},
contacts: [{contactNumber: '<string>', dynamicVariables: {}}],
description: '<string>',
status: 'draft'
})
};
fetch('https://api.pathors.com/v1/campaigns', 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/campaigns",
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>',
'name' => '<string>',
'schedule' => [
'timezone' => '<string>',
'windows' => [
[
'dayOfWeek' => 3,
'startTime' => '<string>',
'endTime' => '<string>'
]
]
],
'contacts' => [
[
'contactNumber' => '<string>',
'dynamicVariables' => [
]
]
],
'description' => '<string>',
'status' => 'draft'
]),
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.pathors.com/v1/campaigns"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\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.pathors.com/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/campaigns")
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 \"projectId\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"schedule\": {\n \"timezone\": \"<string>\",\n \"windows\": [\n {\n \"dayOfWeek\": 3,\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ]\n },\n \"contacts\": [\n {\n \"contactNumber\": \"<string>\",\n \"dynamicVariables\": {}\n }\n ],\n \"description\": \"<string>\",\n \"status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "<string>",
"status": "<string>",
"totalContacts": 123,
"duplicatesSkipped": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Developer key created from the dashboard (Settings → Developer Keys)
Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Available options:
draft, active ⌘I
