API reference

Do-Not-Call API

2 endpoints for do-not-call. 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.

Do-Not-Call

Add a number to Do-Not-Call

POST/api/v1/dncScope dnc:write

Put a number on your Do-Not-Call list. It is never called again, by any campaign, workflow or person, until it is taken off. Every contact with the number is marked.

Parameters
ParameterTypeWhat it is
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
phonerequiredstring, up to 20 charactersThe number never to call, in any format.
Answer (200): these fields
FieldTypeWhat it is
phonerequiredstring—
on_listrequiredbooleanWhether the number is on the Do-Not-Call list now.
changedrequiredbooleanfalse when it already was (adding) or already was not (removing).
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.
POST /api/v1/dnc with curl
curl -X POST "https://aicallstudio.com/api/v1/dnc" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+919876543210"}'

Take a number off Do-Not-Call

DELETE/api/v1/dnc/{phone}Scope dnc:write

Take a number off your Do-Not-Call list, so it may be called again straight away. Do this only when the person asked to be called again: their opt-out is a legal obligation.

Parameters
ParameterTypeWhat it is
phonerequiredstring, 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
phonerequiredstring—
on_listrequiredbooleanWhether the number is on the Do-Not-Call list now.
changedrequiredbooleanfalse when it already was (adding) or already was not (removing).
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.
DELETE /api/v1/dnc/{phone} with curl
curl -X DELETE "https://aicallstudio.com/api/v1/dnc/9876543210" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Put AI Call Studio on your phone lines.

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