https://voice-api.relationsai.com/v1 with a rai_test_ key, which never places a real call. It works once the API is enabled for your workspace (private preview: support@relationsai.com). Your key stays in this tab's memory; live keys are refused.Campaigns
Call a list of contacts with one agent, with pause, resume and stop.
List campaigns
Lists campaigns, newest first. Filter by status. Status and progress are refreshed in the background and can be up to a minute behind; a terminal status reached by the run itself (completed, failed) can take longer to appear.
GET /v1/campaigns · Operation ID: listCampaigns
query Parameters
limitMaximum number of objects to return, from 1 to 100. Defaults to 25.
cursorThe next_cursor of the previous page. Send it with exactly the same filters as the request that returned it; a changed filter set is 400 invalid_cursor.
created_afterOnly objects created at or after this time (RFC 3339, UTC).
created_beforeOnly objects created before this time (RFC 3339, UTC).
statusOnly campaigns in this status.
List campaigns › Responses
A page of campaigns.
objectAlways list.
has_moreTrue when more objects exist after this page.
next_cursorPass as cursor (with the same filters) to fetch the next page. Null on the last page.
Campaigns on this page.
Create a campaign
Creates a campaign in draft status. Nothing is dialled until you start it. You can add
recipients now (contact_ids) or later with the recipients endpoint, while the campaign is a
draft. Recipients are contacts: create them first, for example with the contact upsert.
Do-not-call numbers are left out when a campaign starts and block a resume; there is no API option
to include them. A campaign whose screening was switched off in the console is refused by start and
resume (409 campaign_dnc_override_enabled).
POST /v1/campaigns · Operation ID: createCampaign
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Create a campaign › Request Body
nameCampaign name.
agent_id^agent_[A-Za-z0-9_-]… · requiredThe agent that makes the calls.
concurrency_limitMost simultaneous calls. Defaults to 1. Lowered at start to the plan maximum.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Omit or null for no cap.
contact_idsContacts to add as recipients now. You can also add them later, while the campaign is draft.
Create a campaign › Responses
The campaign was created as a draft.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
Retrieve a campaign
Returns one campaign with its status, allowed actions (capabilities), progress and spend. The ETag header is the version to send as If-Match when you update it.
GET /v1/campaigns/{campaign_id} · Operation ID: getCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Retrieve a campaign › Responses
The campaign.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
Update a campaign
Changes a campaign's name, agent, concurrency or budget cap. Allowed in every status except
running (pause it first). Changes take effect at the next start: a resume continues the paused
run with the settings it began with. Requires If-Match with the campaign's current ETag.
PATCH /v1/campaigns/{campaign_id} · Operation ID: updateCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
If-MatchThe ETag from your most recent read of this resource. The update is refused if the resource has changed since. * matches any current version: the update is applied without the concurrency check.
Update a campaign › Request Body
nameCampaign name.
agent_id^agent_[A-Za-z0-9_-]…The agent that makes the calls.
concurrency_limitMost simultaneous calls.
The spend at which the campaign is paused, or null to remove the cap. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time.
Update a campaign › Responses
The updated campaign, with its new ETag.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
List recipients
Lists a campaign's recipients with what happened to each in the current or latest run: status, attempts, the last call and its outcome, or why the recipient was left out. Recipients are listed in a stable order (not by time). Use the cursor to page; do not rely on the order meaning anything else. Per-recipient results are refreshed in the background and can be up to a minute behind the calls themselves.
GET /v1/campaigns/{campaign_id}/recipients · Operation ID: listCampaignRecipients
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
query Parameters
limitMaximum number of objects to return, from 1 to 100. Defaults to 25.
cursorThe next_cursor of the previous page. Send it with exactly the same filters as the request that returned it; a changed filter set is 400 invalid_cursor.
statusOnly recipients in this status.
List recipients › Responses
A page of recipients.
objectAlways list.
has_moreTrue when more objects exist after this page.
next_cursorPass as cursor (with the same filters) to fetch the next page. Null on the last page.
Recipients on this page.
Add recipients
Adds contacts to a draft campaign. Contacts already in the campaign are skipped. Once a campaign
has started, its recipients are fixed: a later start calls the previous run's recipients again.
To call a different audience, create a new campaign. Up to 1000 contacts per request and 10,000
per campaign.
POST /v1/campaigns/{campaign_id}/recipients · Operation ID: addCampaignRecipients
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Add recipients › Request Body
contact_idsContacts to add. Contacts already in the campaign are skipped, not duplicated.
Add recipients › Responses
Recipients were added (or were already present).
objectAlways campaign_recipients_added.
livemodeMode of the campaign.
campaign_idThe campaign.
addedRecipients newly added by this request (contacts already in the campaign are not counted).
recipient_countTotal recipients in the campaign now.
Start a campaign
Starts a run: from draft it calls the recipients you added; from stopped, completed or
paused it begins a new run with the previous run's recipients (a paused run is abandoned; use
resume to continue it instead).
Before anything is dialled the API checks the agent, the account, balance and spend limits, the
campaign budget cap, calling hours and the telephony connection, and screens every recipient
against the do-not-call list, consent and the per-number daily limit. Blocked recipients are left
out (see the recipients list); if that leaves nobody, the start is refused. Screening happens at the
start: a number added to the do-not-call list while the run is going is still called by it (pause and
resume to re-screen, or stop). A campaign whose do-not-call screening was switched off in the console
is refused (409 campaign_dnc_override_enabled).
Daily call limit. In live mode a start counts every recipient of the campaign against the
workspace's daily limit of calls placed through the API (see limits.daily_call_limit on the
workspace), before anything is dialled, because the run may call each of them. A start that would go
past the limit is refused whole with 429 daily_call_limit_reached, and the message says how many calls
it needed. A start refused for any other reason before dialling does not count. Test mode has no limit.
What 200 means. The run was started and the campaign is running; calls are placed at up to
concurrency_limit at a time. 202 means the start was sent but its confirmation has not
arrived yet; the campaign shows running and is reconciled automatically, so retrieve it in a
minute rather than starting it again.
POST /v1/campaigns/{campaign_id}/start · Operation ID: startCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Start a campaign › Responses
The run started.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
Pause a campaign
Pauses a running campaign: no new calls are started. Calls already connected finish normally and
are charged as usual. The campaign is reported paused only once the pause is confirmed; if it is
not confirmed you get 409 campaign_pause_not_confirmed and the campaign may still be dialling.
POST /v1/campaigns/{campaign_id}/pause · Operation ID: pauseCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Pause a campaign › Responses
The campaign is paused.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
Resume a campaign
Continues a paused campaign's run from where it stopped. Before anything is sent, the API checks
the agent, the account, balance and spend limits, the budget cap, calling hours and the telephony
connection, and screens every recipient the run could still call against the do-not-call list,
consent and the per-number daily limit.
A resume cannot drop recipients from a run. So if any remaining recipient is now blocked (for
example added to the do-not-call list after the campaign started), nothing is resumed, the
campaign stays paused, and you get 409 campaign_recipients_blocked with the blocked contacts.
To continue without them, list the recipients still pending, create a new campaign with those
contacts minus the blocked ones, start it, and stop this one (stopping does not hang up calls in
progress). Do not stop and start this campaign: a new start calls every recipient of the previous
run again, including people already reached, and charges for those calls. If too many recipients
remain to re-screen, the resume is refused with 422 campaign_too_large.
A resume continues a run its start already counted against the daily call limit, so it counts nothing again.
POST /v1/campaigns/{campaign_id}/resume · Operation ID: resumeCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Resume a campaign › Responses
The run resumed and the campaign is running.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.
Stop a campaign
Stops a draft, running or paused campaign. No further calls are started; calls already
connected finish normally. A stopped campaign can be started again, which begins a new run with
the same recipients.
POST /v1/campaigns/{campaign_id}/stop · Operation ID: stopCampaign
path Parameters
campaign_id^cmp_[A-Za-z0-9_-]{1… · requiredThe campaign id (cmp_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Stop a campaign › Responses
The campaign is stopped.
id^cmp_[A-Za-z0-9_-]{1… · requiredCampaign id (cmp_...).
objectAlways campaign.
livemodetrue for a live campaign, false for a test-mode campaign.
nameCampaign name.
agent_idThe agent that makes the calls. Null if the agent was deleted; the campaign cannot start until one is set.
statusdraft (never started), running, paused, stopped, completed (the run finished), failed (the run ended in failure), unknown. Open enum.
Which actions the campaign allows in its current status.
concurrency_limitMost calls the campaign places at the same time. Lowered at start to the plan maximum (limits.campaign_max_concurrency on the workspace). Campaigns created in the console can hold a higher value than the API accepts on a write.
The spend at which the campaign is paused. When the campaign's spend reaches the cap the campaign is paused. The check runs about every 15 minutes, so spend can exceed the cap by the calls placed in that time. Null for no cap.
recipient_countBefore the first start, the recipients added to the campaign. From a start on, the recipients that run calls: recipients left out by compliance screening at that start are not counted.
Call counts for the current or latest run. A call is counted in in_progress until it ends, and only then in connected, no_answer or failed. Updated as calls end; can lag by up to a minute.
What the current or latest run has cost so far. Always zero in test mode, which never charges.
run_numberHow many runs the campaign has had. 0 before the first start.
created_atWhen the campaign was created.
dnc_screeningenforced (numbers on the do-not-call list are left out at every start and block a resume) or disabled_in_console (a person switched screening off for this campaign in the console; the API refuses to start or resume it with 409 campaign_dnc_override_enabled). Read-only. Open enum.