Docs · Developers

API keys, scopes and the sandbox key

Make a key that can do only what your code needs: what each scope opens, what a sandbox key proves, the IP allowlist, replacing a key, and the order a request is checked in.

Before you start

  • API access is on Growth and above. Without it every request answers 402, and the key works again once the plan includes it.
  • An admin with the Developers permission makes keys, on the Developers page in the dashboard.
  1. Make a key with only the scopes it needs

    In your dashboard, open Developers, API keys, and make a key. Tick only the scopes your code uses: a key that only reads calls cannot place one. You can give a key only what you may do yourself in the dashboard, and because a key reads the whole workspace, you also need See everyone's data.

    The key is shown in full once. Store it like a password, in an environment variable or a secret store, never in your code or in a web page.

  2. Send it as a Bearer token

    Every request carries the key in the Authorization header, as Bearer and the key. A live key starts with mtc_ and a sandbox key with mtc_sandbox_. To check a new key, list your agents: it needs the agents:read scope.

    GET /api/v1/agents List agents in the API reference

    GET /api/v1/agents with curl
    curl "https://aicallstudio.com/api/v1/agents" \
      -H "Authorization: Bearer mtc_YOUR_TOKEN"
  3. Limit it to your servers' addresses

    A key can carry an IP allowlist: up to 20 addresses or CIDR blocks, such as 203.0.113.0/24. From any other network the key answers 403 before anything else about it is looked at, so a leaked key does nothing from elsewhere. An empty list means anywhere. A change applies from the key's next request.

  4. Replace a key before it gets old

    A key past its reminder age, 90 days unless you change it, is flagged Replace on the Developers page, and you are reminded once. It is never revoked for you. To replace it, make a new key, move your code to it, then revoke the old one.

    Revoking a key stops everything that uses it at once. So does removing the person who made it.

Which scope opens which endpoint?

A key reaches only the endpoints in the API reference, and each one only with its scope. Any other address answers 403, whatever the key holds. calls:write, campaigns:write and messages:send can ring a real person or spend from your wallet: give them only to code that must.

Scopes and the endpoints each opens
ScopeOpens
agents:readList agents GET /api/v1/agents
analytics:readCalls by classification GET /api/analytics/classification-breakdown
Calls by outcome GET /api/analytics/disposition-breakdown

Call summary GET /api/analytics/summary
calls:readList calls GET /api/analytics/calls
List calls GET /api/v1/calls

Get a call GET /api/v1/calls/{call_id}
calls:writePlace a call POST /api/calls/dial
Schedule a call-back POST /api/v1/callbacks

Cancel a call-back DELETE /api/v1/callbacks/{callback_id}
campaigns:readList campaigns GET /api/v1/campaigns
Campaign progress GET /api/v1/campaigns/{campaign_id}/stats
campaigns:writeAdd contacts to a campaign POST /api/v1/campaigns/{campaign_id}/contacts
Pause a campaign POST /api/v1/campaigns/{campaign_id}/pause

Resume a campaign POST /api/v1/campaigns/{campaign_id}/resume
contacts:eraseErase a person's data POST /api/v1/contacts/{contact_id}/erasure
contacts:readList contacts GET /api/contacts
Export contacts GET /api/contacts/export
contacts:writeCreate a contact POST /api/contacts
Import contacts from a file POST /api/sources/import/csv

Add or update a contact POST /api/v1/contacts

Add or update many contacts POST /api/v1/contacts/bulk

Update a contact PATCH /api/v1/contacts/{contact_id}
dnc:writeAdd a number to Do-Not-Call POST /api/v1/dnc
Take a number off Do-Not-Call DELETE /api/v1/dnc/{phone}
messages:sendSend an email POST /api/v1/messages/email
Send an SMS POST /api/v1/messages/sms

Send a WhatsApp template POST /api/v1/messages/whatsapp
recordings:readNo endpoint of its own. It adds the recording's link to a call you fetch by id; without it the link is null.
reports:readList saved reports GET /api/v1/reports
Run a saved report GET /api/v1/reports/{report_id}/run
wallet:readWallet and this month's usage GET /api/v1/wallet

What does a sandbox key do?

It proves that a key and its scopes are right, and nothing more. A sandbox key never writes and never reads your workspace's real data, and there is no sample data behind it yet.

A request inside its scopes answers 403 with a sentence saying it is a sandbox token: the key and the scope are right. A request outside its scopes answers 403 naming the missing scope, exactly as a live key would. Use it to check your code's sign-in and its error handling before a live key goes anywhere near it.

In what order is a request checked?

The key first: an unknown or revoked key answers 401. Then its IP allowlist (403), the requests a minute your plan gives each key (429, with the seconds to wait in Retry-After), the scope the endpoint needs (403), and whether it is a sandbox key (403).

Then the workspace: a plan without API access answers 402, and the same key works again once the plan includes it. Only after all of that does the endpoint run its own checks. Errors, rate limits and retries lists every status and code.

Costs and what to watch

  • A key with calls:write or campaigns:write rings real customers, billed like any call. One with messages:send sends real WhatsApp, SMS and email messages, each billed from the wallet. One with contacts:erase deletes a person and their calls for good.
  • A key is shown once. If it is lost, revoke it and make another: there is no way to see it again.
  • A key reads the whole workspace, not one person's share of it. Treat every live key as access to all your contacts and calls.
FAQ

Questions, answered.

How do I authenticate to the AI Call Studio API?
Send your key in the Authorization header, as Bearer and the key, with every request. Keys are made on the Developers page in your dashboard, start with mtc_, and are shown once.
Can I limit an API key to certain IP addresses?
Yes. A key can list up to 20 addresses or CIDR blocks. From any other network it answers 403. An empty list allows any address.

Put AI Call Studio on your phone lines.

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