Create Campaign
curl --request POST \
--url https://api.ravan.ai/api/v1/campaigns/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"contactIds": [
"<string>"
],
"schedule": {
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [
123
],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
}
}
'import requests
url = "https://api.ravan.ai/api/v1/campaigns/"
payload = {
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"contactIds": ["<string>"],
"schedule": {
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [123],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '<string>',
phoneNumberId: '<string>',
fromPhoneNumber: '<string>',
contactIds: ['<string>'],
schedule: {
windowStart: '<string>',
windowEnd: '<string>',
windowDays: [123],
timezone: '<string>',
maxConcurrent: 123,
retryAttempts: 123,
retryGapMin: 123
}
})
};
fetch('https://api.ravan.ai/api/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.ravan.ai/api/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([
'name' => '<string>',
'agentId' => '<string>',
'phoneNumberId' => '<string>',
'fromPhoneNumber' => '<string>',
'contactIds' => [
'<string>'
],
'schedule' => [
'windowStart' => '<string>',
'windowEnd' => '<string>',
'windowDays' => [
123
],
'timezone' => '<string>',
'maxConcurrent' => 123,
'retryAttempts' => 123,
'retryGapMin' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.ravan.ai/api/v1/campaigns/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.ravan.ai/api/v1/campaigns/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravan.ai/api/v1/campaigns/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"status": "<string>",
"executionStatus": "<string>",
"schedule": {
"start": "<string>",
"end": "<string>",
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [
123
],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
},
"contactStats": {
"total": 123,
"contacted": 123,
"successful": 123,
"failed": 123,
"noAnswer": 123,
"pending": 123,
"inProgress": 123
},
"startedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"outboundMaxConcurrent": 123,
"outboundMaxCps": 123
}
}Campaign API
Create Campaign
Create Campaign.
POST
/
api
/
v1
/
campaigns
/
Create Campaign
curl --request POST \
--url https://api.ravan.ai/api/v1/campaigns/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"contactIds": [
"<string>"
],
"schedule": {
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [
123
],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
}
}
'import requests
url = "https://api.ravan.ai/api/v1/campaigns/"
payload = {
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"contactIds": ["<string>"],
"schedule": {
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [123],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '<string>',
phoneNumberId: '<string>',
fromPhoneNumber: '<string>',
contactIds: ['<string>'],
schedule: {
windowStart: '<string>',
windowEnd: '<string>',
windowDays: [123],
timezone: '<string>',
maxConcurrent: 123,
retryAttempts: 123,
retryGapMin: 123
}
})
};
fetch('https://api.ravan.ai/api/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.ravan.ai/api/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([
'name' => '<string>',
'agentId' => '<string>',
'phoneNumberId' => '<string>',
'fromPhoneNumber' => '<string>',
'contactIds' => [
'<string>'
],
'schedule' => [
'windowStart' => '<string>',
'windowEnd' => '<string>',
'windowDays' => [
123
],
'timezone' => '<string>',
'maxConcurrent' => 123,
'retryAttempts' => 123,
'retryGapMin' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.ravan.ai/api/v1/campaigns/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.ravan.ai/api/v1/campaigns/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravan.ai/api/v1/campaigns/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"phoneNumberId\": \"<string>\",\n \"fromPhoneNumber\": \"<string>\",\n \"contactIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"windowStart\": \"<string>\",\n \"windowEnd\": \"<string>\",\n \"windowDays\": [\n 123\n ],\n \"timezone\": \"<string>\",\n \"maxConcurrent\": 123,\n \"retryAttempts\": 123,\n \"retryGapMin\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"agentId": "<string>",
"phoneNumberId": "<string>",
"fromPhoneNumber": "<string>",
"status": "<string>",
"executionStatus": "<string>",
"schedule": {
"start": "<string>",
"end": "<string>",
"windowStart": "<string>",
"windowEnd": "<string>",
"windowDays": [
123
],
"timezone": "<string>",
"maxConcurrent": 123,
"retryAttempts": 123,
"retryGapMin": 123
},
"contactStats": {
"total": 123,
"contacted": 123,
"successful": 123,
"failed": 123,
"noAnswer": 123,
"pending": 123,
"inProgress": 123
},
"startedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"outboundMaxConcurrent": 123,
"outboundMaxCps": 123
}
}Actual endpoint:
POST https://api.ravan.ai/api/v1/campaigns/ (note the trailing slash)Authorizations
string
required
Your Agni API key used to authenticate the request. Pass it in the
X-Api-Key header. Find or rotate it from your Ravan AI account settings.Body
string
required
The internal name of the resource. Use a clear name that your team can recognize in the dashboard and API responses.
string
required
The unique ID of the agent that should own, handle, or be assigned to this resource. Use the
id returned by the Agent API.string
required
The phone number record ID to use for calls or campaigns. Use the ID returned by the telephony endpoints.
string
required
The caller ID used for outbound calls, in E.164 format. The number must be purchased, imported, or connected in Agni.
string[]
required
A list of contact IDs to include in the request. Each ID must belong to a contact in your organization.
object
The campaign schedule settings. Use this object to define calling windows, timezone, concurrency, and retry behavior.
Show schedule
Show schedule
string
The daily start time for campaign calls in
HH:mm 24-hour format.string
The daily end time for campaign calls in
HH:mm 24-hour format.integer[]
The days of the week when the campaign can place calls. Use integers
1 through 7, where 1 is Monday and 7 is Sunday.string
The IANA timezone used for schedules and appointment availability.
integer
The maximum number of calls the campaign can run at the same time.
integer
The maximum number of retry attempts per contact after an unsuccessful campaign call.
integer
The wait time, in minutes, between campaign retry attempts.
Response
boolean
Whether the request succeeded.
string
Human-readable status message.
object
Created campaign object.
Show data
Show data
string
Campaign UUID. Example:
019ebbef-48d7-7ebc-a751-4a10362a3bbfstring
Organization UUID. Example:
95a4e479-03a7-4f1b-834d-8705756e8e59string
Campaign name. Example:
Q4 Outreachstring
Assigned agent UUID. Example:
019e92f8-f032-7fb7-b294-508f4167618estring
Phone number UUID. Example:
019e92f4-097d-7a52-b5e5-fa7e0dd0761fstring
Caller ID in E.164 format. Example:
+918035088113string
Campaign status:
draft, active, paused, completed.string
Execution state of the campaign:
draft, running, paused, completed.object
Campaign scheduling configuration.
Show schedule
Show schedule
string
Campaign start datetime.
string
Campaign end datetime.
string
Daily calling window start time. Example:
09:00string
Daily calling window end time. Example:
17:00integer[]
Active days of the week (1=Monday … 7=Sunday). Example:
[1, 2, 3, 4, 5]string
Timezone for the schedule. Example:
Asia/Kolkatainteger
Maximum concurrent calls. Example:
1integer
Number of retry attempts. Example:
2integer
Gap in minutes between retries. Example:
30object
string
Timestamp when the campaign started (ISO 8601).
string
Timestamp when the campaign completed (ISO 8601).
string
Creation timestamp. Example:
2026-06-12T13:04:41Zstring
Last updated timestamp. Example:
2026-06-12T13:04:41Zinteger
Maximum concurrent outbound calls limit.
integer
Maximum outbound calls per second.
⌘I

