List Campaigns
curl --request GET \
--url https://api.ravan.ai/api/v1/campaigns/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.ravan.ai/api/v1/campaigns/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.ravan.ai/api/v1/campaigns/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ravan.ai/api/v1/campaigns/")
.header("X-Api-Key", "<api-key>")
.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::Get.new(url)
request["X-Api-Key"] = '<api-key>'
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": [
{}
],
"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>"
}
],
"meta": {
"total": 123,
"limit": 123,
"offset": 123
}
}Campaign API
List Campaigns
List Campaigns.
GET
/
api
/
v1
/
campaigns
/
List Campaigns
curl --request GET \
--url https://api.ravan.ai/api/v1/campaigns/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.ravan.ai/api/v1/campaigns/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.ravan.ai/api/v1/campaigns/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ravan.ai/api/v1/campaigns/")
.header("X-Api-Key", "<api-key>")
.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::Get.new(url)
request["X-Api-Key"] = '<api-key>'
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": [
{}
],
"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>"
}
],
"meta": {
"total": 123,
"limit": 123,
"offset": 123
}
}Actual endpoint:
GET 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.Query Parameters
integer
The maximum number of records to return. Use this with
offset or pagination fields to page through results.integer
The number of records to skip before returning results. Use this with
limit for pagination.string
Filters or sets the current status of the resource. Use one of the status values supported by the endpoint.
Response
boolean
Whether the request succeeded.
string
Human-readable status message.
array
Array of campaign objects.
Show Campaign Object
Show Campaign Object
string
Unique campaign identifier.
string
ID of the organization this campaign belongs to.
string
Name of the campaign.
string
ID of the agent assigned to this campaign.
string
ID of the phone number used for this campaign.
string
The phone number calls are made from.
string
Current status of the campaign.
string
Execution-level status of the campaign.
object
Campaign scheduling configuration.
Show schedule
Show schedule
string
Campaign start datetime.
string
Campaign end datetime.
string
Daily calling window start time.
string
Daily calling window end time.
array
Days of the week the calling window is active (0=Sunday, 6=Saturday).
string
Timezone for the schedule window.
integer
Maximum number of concurrent calls allowed.
integer
Number of retry attempts for unanswered calls.
integer
Gap in minutes between retry attempts.
object
Aggregated contact-level statistics for the campaign.
Show contactStats
Show contactStats
integer
Total number of contacts in the campaign.
integer
Number of contacts successfully reached.
integer
Number of contacts with a successful outcome.
integer
Number of contacts that failed.
integer
Number of contacts that did not answer.
integer
Number of contacts yet to be called.
integer
Number of contacts currently being called.
string
Timestamp when the campaign started.
string
Timestamp when the campaign completed.
string
Timestamp when the campaign was created.
string
Timestamp when the campaign was last updated.
⌘I

