API reference

Campaigns API

5 endpoints for campaigns. Send your token as a Bearer header; how tokens, scopes, limits and errors work is on the API reference page.

API reference

Before you start

  • Authentication, scopes, rate limits, errors, retrying safely and paging are explained once, on the API reference.
  • Every request needs a token with the scope shown on its endpoint; without it the answer is 403.

Campaigns

List campaigns

GET/api/v1/campaignsScope campaigns:read

Your campaigns, newest first. Deleted campaigns are left out.

Parameters
ParameterTypeWhat it is
statusstring, or null, in the queryOnly campaigns with this status, such as running.
limitinteger, 1 to 100, in the queryDefault: 50.
cursorstring, or null, in the querynext_cursor from the previous page.
Answer (200): these fields
FieldTypeWhat it is
datarequiredlist of objects—
data[].idrequiredstring (uuid)—
data[].namestring, or null—
data[].statusrequiredstringdraft, scheduled, running, paused, completed or cancelled.
data[].moderequiredstringai (an AI agent calls), power (your people call), whatsapp, sms or email.
data[].agent_idstring (uuid), or null—
data[].team_idstring (uuid), or null—
data[].paused_reasonstring, or nullWhy the campaign paused itself, such as wallet_empty; null when a person paused it or it is not paused.
data[].created_atstring (date-time), or null—
data[].started_atstring (date-time), or null—
data[].finished_atstring (date-time), or null—
next_cursorstring, or null—
Errors
CodeWhen
401The token is missing, unknown or revoked, or its workspace was deleted.
402The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.
403The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
422A field is missing or not in the form this endpoint takes. detail says which, and why.
429This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
GET /api/v1/campaigns with curl
curl "https://aicallstudio.com/api/v1/campaigns?limit=50" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN"

Add contacts to a campaign

POST/api/v1/campaigns/{campaign_id}/contactsScope campaigns:write

Add people to a calling campaign. While it runs they are rung like everyone else in it: within its schedule, your calling window and the plan's limits. Each call is billed.

Send contacts (found or saved by number, as Add or update a contact does) or contact_ids. A contact on Do-Not-Call is never added; one already in the campaign is not added twice.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

Parameters
ParameterTypeWhat it is
campaign_idrequiredstring (uuid), in the path—
Idempotency-Keystring, up to 255 characters, in the headersAny unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.
Request body (application/json)
FieldTypeWhat it is
contactslist of objects, or nullContacts to add, found or saved by number (1 to 100). Send this or contact_ids.
contacts[].phonerequiredstring, up to 20 characters8 to 15 digits, optionally starting with +. The same number in any format is the same contact.
contacts[].namestring, up to 255 characters, or nullRequired for a new number; for a known one it renames it.
contacts[].emailstring, up to 255 characters, or null—
contacts[].custom_fieldsobject, or nullYour own fields, by field name. Merged into the contact's: a field you leave out is kept.
contacts[].lead_typestring, or nullThe contact type's key, which decides the fields it needs.
contacts[].sourcestring, up to 50 characters, or nullWhere the contact came from, in your words.
contacts[].languagestring, or nullThe language the person prefers, as a code or a name, such as hi-IN.
contact_idslist of string (uuid), or nullExisting contacts to add, by id.
Answer (200): these fields
FieldTypeWhat it is
addedrequiredinteger—
alreadyrequiredinteger—
skipped_do_not_callrequiredinteger—
not_foundrequiredinteger—
failedlist of objectsContacts in contacts that could not be saved.
failed[].indexrequiredintegerThe position of this contact in the list you sent, from 0.
failed[].createdbooleanDefault: false.
failed[].contact_idstring (uuid), or null—
failed[].errorstring, or nullWhy this one was not saved; null when it was.
Errors
CodeWhen
401The token is missing, unknown or revoked, or its workspace was deleted.
402The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.
403The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404No calling campaign of yours has this id.
409The campaign has finished.
422A field is missing or not in the form this endpoint takes. detail says which, and why.
429This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
POST /api/v1/campaigns/{campaign_id}/contacts with curl
curl -X POST "https://aicallstudio.com/api/v1/campaigns/YOUR_CAMPAIGN_ID/contacts" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"contacts":[{"phone":"+919876543210","name":"Asha Verma"}]}'

Pause a campaign

POST/api/v1/campaigns/{campaign_id}/pauseScope campaigns:write

Stop a running campaign from placing new calls. Calls already ringing finish.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

Parameters
ParameterTypeWhat it is
campaign_idrequiredstring (uuid), in the path—
Idempotency-Keystring, up to 255 characters, in the headersAny unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.
Answer (200): these fields
FieldTypeWhat it is
idrequiredstring (uuid)—
namestring, or null—
statusrequiredstringdraft, scheduled, running, paused, completed or cancelled.
moderequiredstringai (an AI agent calls), power (your people call), whatsapp, sms or email.
agent_idstring (uuid), or null—
team_idstring (uuid), or null—
paused_reasonstring, or nullWhy the campaign paused itself, such as wallet_empty; null when a person paused it or it is not paused.
created_atstring (date-time), or null—
started_atstring (date-time), or null—
finished_atstring (date-time), or null—
Errors
CodeWhen
401The token is missing, unknown or revoked, or its workspace was deleted.
402The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.
403The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404No campaign of yours has this id.
409The campaign is not running.
422A field is missing or not in the form this endpoint takes. detail says which, and why.
429This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
POST /api/v1/campaigns/{campaign_id}/pause with curl
curl -X POST "https://aicallstudio.com/api/v1/campaigns/YOUR_CAMPAIGN_ID/pause" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Resume a campaign

POST/api/v1/campaigns/{campaign_id}/resumeScope campaigns:write

Start a paused campaign calling again. It rings real customers and each call is billed.

The same checks as pressing Resume on the Campaigns page apply: the plan, a phone line, the schedule and your calling window. If the campaign paused itself (an empty wallet, say) and the reason still holds, it pauses again and says why in paused_reason.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

Parameters
ParameterTypeWhat it is
campaign_idrequiredstring (uuid), in the path—
Idempotency-Keystring, up to 255 characters, in the headersAny unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.
Answer (200): these fields
FieldTypeWhat it is
idrequiredstring (uuid)—
namestring, or null—
statusrequiredstringdraft, scheduled, running, paused, completed or cancelled.
moderequiredstringai (an AI agent calls), power (your people call), whatsapp, sms or email.
agent_idstring (uuid), or null—
team_idstring (uuid), or null—
paused_reasonstring, or nullWhy the campaign paused itself, such as wallet_empty; null when a person paused it or it is not paused.
created_atstring (date-time), or null—
started_atstring (date-time), or null—
finished_atstring (date-time), or null—
Errors
CodeWhen
401The token is missing, unknown or revoked, or its workspace was deleted.
402The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan's campaign limit is reached.
403The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404No campaign of yours has this id.
409The campaign is not paused, or has no phone line to call from.
422A field is missing or not in the form this endpoint takes. detail says which, and why.
429This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
POST /api/v1/campaigns/{campaign_id}/resume with curl
curl -X POST "https://aicallstudio.com/api/v1/campaigns/YOUR_CAMPAIGN_ID/resume" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Campaign progress

GET/api/v1/campaigns/{campaign_id}/statsScope campaigns:read

How far a calling campaign has got: people it may ring, rung and reached, and today's calls. Counted the way the Campaigns page counts them.

Parameters
ParameterTypeWhat it is
campaign_idrequiredstring (uuid), in the path—
Answer (200): these fields
FieldTypeWhat it is
campaign_idrequiredstring (uuid)—
statusrequiredstring—
contacts_totalrequiredintegerPeople the campaign may ring in all.
contacts_dialledrequiredintegerOf those, people it has rung.
contacts_reachedrequiredintegerPeople who picked up (an answering machine does not count).
calls_todayrequiredintegerCalls the campaign placed today, India time.
connected_todayrequiredintegerOf those, calls someone picked up.
Errors
CodeWhen
401The token is missing, unknown or revoked, or its workspace was deleted.
402The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.
403The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.
404No campaign of yours has this id.
422A field is missing or not in the form this endpoint takes. detail says which, and why.
429This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.
GET /api/v1/campaigns/{campaign_id}/stats with curl
curl "https://aicallstudio.com/api/v1/campaigns/YOUR_CAMPAIGN_ID/stats" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN"

Put AI Call Studio on your phone lines.

Book a 30-minute walkthrough, or call us right now: +91 922 222 1378