Create Campaign
curl --request POST \
--url https://api.revring.ai/v1/campaigns \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"fromNumber": "<string>",
"agentId": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [
3
]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": [
"no_answer",
"busy",
"failed"
]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"defaultVariables": {},
"contacts": [
{
"toNumber": "<string>",
"variables": {},
"timezone": "<string>"
}
],
"start": false,
"voicemailStrategy": "agent"
}
'import requests
url = "https://api.revring.ai/v1/campaigns"
payload = {
"name": "<string>",
"fromNumber": "<string>",
"agentId": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [3]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": ["no_answer", "busy", "failed"]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"defaultVariables": {},
"contacts": [
{
"toNumber": "<string>",
"variables": {},
"timezone": "<string>"
}
],
"start": False,
"voicemailStrategy": "agent"
}
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>',
fromNumber: '<string>',
agentId: '<string>',
environment: '<string>',
startAt: '2023-11-07T05:31:56Z',
callingWindow: {start: '09:00', end: '18:00', timezone: 'America/New_York', days: [3]},
retryPolicy: {
maxAttempts: 3,
retryDelayMinutes: 60,
retryOn: ['no_answer', 'busy', 'failed']
},
maxConcurrency: 2,
callsPerSecond: 1,
defaultVariables: {},
contacts: [{toNumber: '<string>', variables: {}, timezone: '<string>'}],
start: false,
voicemailStrategy: 'agent'
})
};
fetch('https://api.revring.ai/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.revring.ai/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>',
'fromNumber' => '<string>',
'agentId' => '<string>',
'environment' => '<string>',
'startAt' => '2023-11-07T05:31:56Z',
'callingWindow' => [
'start' => '09:00',
'end' => '18:00',
'timezone' => 'America/New_York',
'days' => [
3
]
],
'retryPolicy' => [
'maxAttempts' => 3,
'retryDelayMinutes' => 60,
'retryOn' => [
'no_answer',
'busy',
'failed'
]
],
'maxConcurrency' => 2,
'callsPerSecond' => 1,
'defaultVariables' => [
],
'contacts' => [
[
'toNumber' => '<string>',
'variables' => [
],
'timezone' => '<string>'
]
],
'start' => false,
'voicemailStrategy' => 'agent'
]),
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.revring.ai/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\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.revring.ai/v1/campaigns")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/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 \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"status": "draft",
"agentId": "<string>",
"agentName": "<string>",
"fromNumber": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [
3
]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": [
"no_answer",
"busy",
"failed"
]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"voicemailStrategy": "agent",
"defaultVariables": {},
"progress": {
"total": 123,
"done": 123,
"contacts": {},
"outcomes": {}
},
"startedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"contactsAdded": 123,
"duplicatesSkipped": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Campaigns
Create Campaign
Create a campaign, optionally with contacts (up to 10,000) and optionally started at once with start: true. Duplicate numbers are skipped.
POST
/
campaigns
Create Campaign
curl --request POST \
--url https://api.revring.ai/v1/campaigns \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"fromNumber": "<string>",
"agentId": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [
3
]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": [
"no_answer",
"busy",
"failed"
]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"defaultVariables": {},
"contacts": [
{
"toNumber": "<string>",
"variables": {},
"timezone": "<string>"
}
],
"start": false,
"voicemailStrategy": "agent"
}
'import requests
url = "https://api.revring.ai/v1/campaigns"
payload = {
"name": "<string>",
"fromNumber": "<string>",
"agentId": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [3]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": ["no_answer", "busy", "failed"]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"defaultVariables": {},
"contacts": [
{
"toNumber": "<string>",
"variables": {},
"timezone": "<string>"
}
],
"start": False,
"voicemailStrategy": "agent"
}
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>',
fromNumber: '<string>',
agentId: '<string>',
environment: '<string>',
startAt: '2023-11-07T05:31:56Z',
callingWindow: {start: '09:00', end: '18:00', timezone: 'America/New_York', days: [3]},
retryPolicy: {
maxAttempts: 3,
retryDelayMinutes: 60,
retryOn: ['no_answer', 'busy', 'failed']
},
maxConcurrency: 2,
callsPerSecond: 1,
defaultVariables: {},
contacts: [{toNumber: '<string>', variables: {}, timezone: '<string>'}],
start: false,
voicemailStrategy: 'agent'
})
};
fetch('https://api.revring.ai/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.revring.ai/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>',
'fromNumber' => '<string>',
'agentId' => '<string>',
'environment' => '<string>',
'startAt' => '2023-11-07T05:31:56Z',
'callingWindow' => [
'start' => '09:00',
'end' => '18:00',
'timezone' => 'America/New_York',
'days' => [
3
]
],
'retryPolicy' => [
'maxAttempts' => 3,
'retryDelayMinutes' => 60,
'retryOn' => [
'no_answer',
'busy',
'failed'
]
],
'maxConcurrency' => 2,
'callsPerSecond' => 1,
'defaultVariables' => [
],
'contacts' => [
[
'toNumber' => '<string>',
'variables' => [
],
'timezone' => '<string>'
]
],
'start' => false,
'voicemailStrategy' => 'agent'
]),
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.revring.ai/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\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.revring.ai/v1/campaigns")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/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 \"fromNumber\": \"<string>\",\n \"agentId\": \"<string>\",\n \"environment\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"callingWindow\": {\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"timezone\": \"America/New_York\",\n \"days\": [\n 3\n ]\n },\n \"retryPolicy\": {\n \"maxAttempts\": 3,\n \"retryDelayMinutes\": 60,\n \"retryOn\": [\n \"no_answer\",\n \"busy\",\n \"failed\"\n ]\n },\n \"maxConcurrency\": 2,\n \"callsPerSecond\": 1,\n \"defaultVariables\": {},\n \"contacts\": [\n {\n \"toNumber\": \"<string>\",\n \"variables\": {},\n \"timezone\": \"<string>\"\n }\n ],\n \"start\": false,\n \"voicemailStrategy\": \"agent\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"status": "draft",
"agentId": "<string>",
"agentName": "<string>",
"fromNumber": "<string>",
"environment": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"callingWindow": {
"start": "09:00",
"end": "18:00",
"timezone": "America/New_York",
"days": [
3
]
},
"retryPolicy": {
"maxAttempts": 3,
"retryDelayMinutes": 60,
"retryOn": [
"no_answer",
"busy",
"failed"
]
},
"maxConcurrency": 2,
"callsPerSecond": 1,
"voicemailStrategy": "agent",
"defaultVariables": {},
"progress": {
"total": 123,
"done": 123,
"contacts": {},
"outcomes": {}
},
"startedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"contactsAdded": 123,
"duplicatesSkipped": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Generate API keys from the RevRing dashboard.
Body
application/json
Caller ID; must be on the agent's SIP trunk
Don't dial before this time
Calling window. A contact's own timezone wins over the campaign's.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x >= 1Required range:
0.1 <= x <= 10Maximum array length:
10000Show child attributes
Show child attributes
Available options:
agent, last_attempt Response
Created
Show child attributes
Show child attributes