Create a New Call Batch (Campaign)
curl --request POST \
--url https://sa.dialgen.ai/api/v1/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "agent_clx123abc...",
"userId": "user_clx456def...",
"contacts": [
{
"id": "contact_clx789xyz...",
"phoneNumber": "+15551234567",
"name": "Jane Doe",
"email": "jane@example.com",
"company": "Acme Corp",
"metadata": {
"lead_score": 80
}
},
{
"phoneNumber": "+15557654321",
"name": "John Smith",
"email": "john@example.com",
"company": null,
"metadata": {
"account_id": "A123"
}
}
],
"options": {
"priority": 5,
"scheduledStartTime": "2025-11-16T09:00:00.000Z",
"timezone": "UTC",
"maxCallsPerSecond": 10,
"retryStrategy": {
"maxAttempts": 3,
"noAnswerDelay": 3600000,
"busyDelay": 300000
},
"webhooks": {
"onCallComplete": "https://api.your-crm.com/webhook/dialgen/call-complete"
},
"tags": [
"Q4_campaign",
"high_priority"
]
}
}
'import requests
url = "https://sa.dialgen.ai/api/v1/batch"
payload = {
"agentId": "agent_clx123abc...",
"userId": "user_clx456def...",
"contacts": [
{
"id": "contact_clx789xyz...",
"phoneNumber": "+15551234567",
"name": "Jane Doe",
"email": "jane@example.com",
"company": "Acme Corp",
"metadata": { "lead_score": 80 }
},
{
"phoneNumber": "+15557654321",
"name": "John Smith",
"email": "john@example.com",
"company": None,
"metadata": { "account_id": "A123" }
}
],
"options": {
"priority": 5,
"scheduledStartTime": "2025-11-16T09:00:00.000Z",
"timezone": "UTC",
"maxCallsPerSecond": 10,
"retryStrategy": {
"maxAttempts": 3,
"noAnswerDelay": 3600000,
"busyDelay": 300000
},
"webhooks": { "onCallComplete": "https://api.your-crm.com/webhook/dialgen/call-complete" },
"tags": ["Q4_campaign", "high_priority"]
}
}
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({
agentId: 'agent_clx123abc...',
userId: 'user_clx456def...',
contacts: [
{
id: 'contact_clx789xyz...',
phoneNumber: '+15551234567',
name: 'Jane Doe',
email: 'jane@example.com',
company: 'Acme Corp',
metadata: {lead_score: 80}
},
{
phoneNumber: '+15557654321',
name: 'John Smith',
email: 'john@example.com',
company: null,
metadata: {account_id: 'A123'}
}
],
options: {
priority: 5,
scheduledStartTime: '2025-11-16T09:00:00.000Z',
timezone: 'UTC',
maxCallsPerSecond: 10,
retryStrategy: {maxAttempts: 3, noAnswerDelay: 3600000, busyDelay: 300000},
webhooks: {onCallComplete: 'https://api.your-crm.com/webhook/dialgen/call-complete'},
tags: ['Q4_campaign', 'high_priority']
}
})
};
fetch('https://sa.dialgen.ai/api/v1/batch', 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://sa.dialgen.ai/api/v1/batch",
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([
'agentId' => 'agent_clx123abc...',
'userId' => 'user_clx456def...',
'contacts' => [
[
'id' => 'contact_clx789xyz...',
'phoneNumber' => '+15551234567',
'name' => 'Jane Doe',
'email' => 'jane@example.com',
'company' => 'Acme Corp',
'metadata' => [
'lead_score' => 80
]
],
[
'phoneNumber' => '+15557654321',
'name' => 'John Smith',
'email' => 'john@example.com',
'company' => null,
'metadata' => [
'account_id' => 'A123'
]
]
],
'options' => [
'priority' => 5,
'scheduledStartTime' => '2025-11-16T09:00:00.000Z',
'timezone' => 'UTC',
'maxCallsPerSecond' => 10,
'retryStrategy' => [
'maxAttempts' => 3,
'noAnswerDelay' => 3600000,
'busyDelay' => 300000
],
'webhooks' => [
'onCallComplete' => 'https://api.your-crm.com/webhook/dialgen/call-complete'
],
'tags' => [
'Q4_campaign',
'high_priority'
]
]
]),
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://sa.dialgen.ai/api/v1/batch"
payload := strings.NewReader("{\n \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\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://sa.dialgen.ai/api/v1/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sa.dialgen.ai/api/v1/batch")
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 \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"batchId": "batch_1678886400_agent_clx123...",
"status": "ingesting",
"message": "Batch accepted and is being processed. Monitor the status link for updates.",
"links": {
"status": "https://sa.dialgen.ai/api/v1/batch/batch_1678886400_agent_clx123.../status",
"dashboard": "https://sa.dialgen.ai/batch/monitor/batch_1678886400_agent_clx123..."
}
}Batches
Create a New Call Batch (Campaign)
Submits a list of contacts to be called as a new campaign. The server accepts the job and begins ingesting the contacts in the background.
POST
/
api
/
v1
/
batch
Create a New Call Batch (Campaign)
curl --request POST \
--url https://sa.dialgen.ai/api/v1/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "agent_clx123abc...",
"userId": "user_clx456def...",
"contacts": [
{
"id": "contact_clx789xyz...",
"phoneNumber": "+15551234567",
"name": "Jane Doe",
"email": "jane@example.com",
"company": "Acme Corp",
"metadata": {
"lead_score": 80
}
},
{
"phoneNumber": "+15557654321",
"name": "John Smith",
"email": "john@example.com",
"company": null,
"metadata": {
"account_id": "A123"
}
}
],
"options": {
"priority": 5,
"scheduledStartTime": "2025-11-16T09:00:00.000Z",
"timezone": "UTC",
"maxCallsPerSecond": 10,
"retryStrategy": {
"maxAttempts": 3,
"noAnswerDelay": 3600000,
"busyDelay": 300000
},
"webhooks": {
"onCallComplete": "https://api.your-crm.com/webhook/dialgen/call-complete"
},
"tags": [
"Q4_campaign",
"high_priority"
]
}
}
'import requests
url = "https://sa.dialgen.ai/api/v1/batch"
payload = {
"agentId": "agent_clx123abc...",
"userId": "user_clx456def...",
"contacts": [
{
"id": "contact_clx789xyz...",
"phoneNumber": "+15551234567",
"name": "Jane Doe",
"email": "jane@example.com",
"company": "Acme Corp",
"metadata": { "lead_score": 80 }
},
{
"phoneNumber": "+15557654321",
"name": "John Smith",
"email": "john@example.com",
"company": None,
"metadata": { "account_id": "A123" }
}
],
"options": {
"priority": 5,
"scheduledStartTime": "2025-11-16T09:00:00.000Z",
"timezone": "UTC",
"maxCallsPerSecond": 10,
"retryStrategy": {
"maxAttempts": 3,
"noAnswerDelay": 3600000,
"busyDelay": 300000
},
"webhooks": { "onCallComplete": "https://api.your-crm.com/webhook/dialgen/call-complete" },
"tags": ["Q4_campaign", "high_priority"]
}
}
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({
agentId: 'agent_clx123abc...',
userId: 'user_clx456def...',
contacts: [
{
id: 'contact_clx789xyz...',
phoneNumber: '+15551234567',
name: 'Jane Doe',
email: 'jane@example.com',
company: 'Acme Corp',
metadata: {lead_score: 80}
},
{
phoneNumber: '+15557654321',
name: 'John Smith',
email: 'john@example.com',
company: null,
metadata: {account_id: 'A123'}
}
],
options: {
priority: 5,
scheduledStartTime: '2025-11-16T09:00:00.000Z',
timezone: 'UTC',
maxCallsPerSecond: 10,
retryStrategy: {maxAttempts: 3, noAnswerDelay: 3600000, busyDelay: 300000},
webhooks: {onCallComplete: 'https://api.your-crm.com/webhook/dialgen/call-complete'},
tags: ['Q4_campaign', 'high_priority']
}
})
};
fetch('https://sa.dialgen.ai/api/v1/batch', 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://sa.dialgen.ai/api/v1/batch",
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([
'agentId' => 'agent_clx123abc...',
'userId' => 'user_clx456def...',
'contacts' => [
[
'id' => 'contact_clx789xyz...',
'phoneNumber' => '+15551234567',
'name' => 'Jane Doe',
'email' => 'jane@example.com',
'company' => 'Acme Corp',
'metadata' => [
'lead_score' => 80
]
],
[
'phoneNumber' => '+15557654321',
'name' => 'John Smith',
'email' => 'john@example.com',
'company' => null,
'metadata' => [
'account_id' => 'A123'
]
]
],
'options' => [
'priority' => 5,
'scheduledStartTime' => '2025-11-16T09:00:00.000Z',
'timezone' => 'UTC',
'maxCallsPerSecond' => 10,
'retryStrategy' => [
'maxAttempts' => 3,
'noAnswerDelay' => 3600000,
'busyDelay' => 300000
],
'webhooks' => [
'onCallComplete' => 'https://api.your-crm.com/webhook/dialgen/call-complete'
],
'tags' => [
'Q4_campaign',
'high_priority'
]
]
]),
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://sa.dialgen.ai/api/v1/batch"
payload := strings.NewReader("{\n \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\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://sa.dialgen.ai/api/v1/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sa.dialgen.ai/api/v1/batch")
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 \"agentId\": \"agent_clx123abc...\",\n \"userId\": \"user_clx456def...\",\n \"contacts\": [\n {\n \"id\": \"contact_clx789xyz...\",\n \"phoneNumber\": \"+15551234567\",\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"lead_score\": 80\n }\n },\n {\n \"phoneNumber\": \"+15557654321\",\n \"name\": \"John Smith\",\n \"email\": \"john@example.com\",\n \"company\": null,\n \"metadata\": {\n \"account_id\": \"A123\"\n }\n }\n ],\n \"options\": {\n \"priority\": 5,\n \"scheduledStartTime\": \"2025-11-16T09:00:00.000Z\",\n \"timezone\": \"UTC\",\n \"maxCallsPerSecond\": 10,\n \"retryStrategy\": {\n \"maxAttempts\": 3,\n \"noAnswerDelay\": 3600000,\n \"busyDelay\": 300000\n },\n \"webhooks\": {\n \"onCallComplete\": \"https://api.your-crm.com/webhook/dialgen/call-complete\"\n },\n \"tags\": [\n \"Q4_campaign\",\n \"high_priority\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"batchId": "batch_1678886400_agent_clx123...",
"status": "ingesting",
"message": "Batch accepted and is being processed. Monitor the status link for updates.",
"links": {
"status": "https://sa.dialgen.ai/api/v1/batch/batch_1678886400_agent_clx123.../status",
"dashboard": "https://sa.dialgen.ai/batch/monitor/batch_1678886400_agent_clx123..."
}
}Authorizations
Bearer token authentication. Obtain your API key from the Dialgen API Keys dashboard at https://sa.dialgen.ai/api-keys
Body
application/json
⌘I