Campaigns
Bulk outbound calling over a list of recipients.
List campaigns
/campaignscurl -X GET "https://api.rabbitt.ai/api/v1/campaigns" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.get(
"https://api.rabbitt.ai/api/v1/campaigns",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Query parameters
statusstringoptionalagentIdstringoptionalpageintegeroptionaldefault: 1 · min 1
limitintegeroptionaldefault: 25 · 1–100
Responses
Response body - 200
objectstringdataTypestringdataobject[]paginationobjectCreate a campaign
/campaignsCampaigns start in `draft`. Add recipients, then call `POST /campaigns/{id}/launch`.
curl -X POST "https://api.rabbitt.ai/api/v1/campaigns" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Asha Menon",
"agentId": "507f1f77bcf86cd799439011"
}'const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Asha Menon",
"agentId": "507f1f77bcf86cd799439011"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
json={
"name": "Asha Menon",
"agentId": "507f1f77bcf86cd799439011"
},
)
response.raise_for_status()
data = response.json()Body parameters
namestringrequiredmax length 200
descriptionstringoptionalmax length 1000
agentIdstringrequiredtimezonestringoptionalmax length 64
settingsobjectoptionalretryLimitintegeroptional1–5
retryDelayMinutesintegeroptional1–10080
concurrencyintegeroptional1–25
Responses
Response body - 201
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampRetrieve a campaign
/campaigns/{id}curl -X GET "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.get(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampUpdate a campaign
/campaigns/{id}Only campaigns in `draft` or `paused` can be edited.
curl -X PATCH "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Asha Menon",
"description": "…",
"timezone": "…",
"settings": {}
}'const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Asha Menon",
"description": "…",
"timezone": "…",
"settings": {}
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.patch(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
json={
"name": "Asha Menon",
"description": "…",
"timezone": "…",
"settings": {}
},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredBody parameters
namestringoptionalmax length 200
descriptionstringoptionalmax length 1000
timezonestringoptionalmax length 64
settingsobjectoptionalResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampLaunch a campaign
/campaigns/{id}/launchcurl -X POST "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/launch" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/launch", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/launch",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampPause a campaign
/campaigns/{id}/pausecurl -X POST "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/pause" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/pause", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/pause",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampResume a campaign
/campaigns/{id}/resumecurl -X POST "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/resume" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/resume", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/resume",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampCancel a campaign
/campaigns/{id}/cancelcurl -X POST "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/cancel" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/cancel", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/cancel",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestampArchive a campaign
/campaigns/{id}/archivecurl -X POST "https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/archive" \
-H "Authorization: Bearer rb_live_xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch("https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/archive", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITT_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();import os
import requests
response = requests.post(
"https://api.rabbitt.ai/api/v1/campaigns/507f1f77bcf86cd799439011/archive",
headers={"Authorization": f"Bearer {os.environ['RABBITT_API_KEY']}"},
)
response.raise_for_status()
data = response.json()Path parameters
idstringrequiredResponses
Response body - 200
idstringobjectstringnamestringdescriptionstringagentIdstringagentNamestringstatusstringOne of:draftscheduledrunningpausedcompletedcancelledarchived
timezonestringsettingsobjectretryLimitintegerretryDelayMinutesintegerconcurrencyintegerstatsobjecttotalintegerpendingintegercompletedintegerfailedintegerlaunchedAttimestamppausedAttimestampcompletedAttimestampcreatedAttimestamp