Developers

Quickstart: your first AI call from code in 5 minutes

Make an API key, find your agent, place one AI call to your own number and read its outcome, in curl, Node.js, Python or PHP.

Developers

Before you start

  • An agent that is live: built and switched on in your dashboard, with a phone line to call from.
  • API access is on Growth and above. Without it every request answers 402, and the key works again once the plan includes it.
  • Your own mobile number, 10 digits without +91. You will ring it.

Sandbox or live token?

  • A sandbox token starts with mtc_sandbox_. It never writes and never reads your real data, and there is no sample data behind it yet: it only proves the token and its scopes are right. A request it may make answers 403 saying so.
  • A live token starts with mtc_. The call in step 3 is a real call, billed like any other: ring your own mobile.
  1. Make an API key

    In your dashboard, open Developers, API keys, and make a live key with three scopes: agents:read, calls:write and calls:read. It is shown once: store it like a password, in an environment variable, never in your code.

  2. Find the agent that will speak

    List your agents and copy the id of the one that should make the call. Each one says whether it takes real calls now.

    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. Place the call

    Send your own number and the agent's id. The answer means ringing has started, not that anyone picked up: keep its room, it names this call attempt. Send an Idempotency-Key so a retried request never rings twice.

    This is a real call, billed like any other.

    POST /api/calls/dial Place a call in the API reference

    POST /api/calls/dial with curl
    curl -X POST "https://aicallstudio.com/api/calls/dial" \
      -H "Authorization: Bearer mtc_YOUR_TOKEN" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"phone":"9876543210","agent_id":"YOUR_AGENT_ID","name":"Asha Verma","variables":{"amount":"12,500","due_date":"5 December"}}'
  4. Read the outcome

    Answer the call and talk to your agent. When it ends, list your calls with the room from step 3: the call carries its status, outcome, score and summary. Fetch it by id for the transcript, the details it captured and the recording.

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

    GET /api/v1/calls with curl
    curl "https://aicallstudio.com/api/v1/calls?limit=50" \
      -H "Authorization: Bearer mtc_YOUR_TOKEN"
  5. Get told instead of asking

    Rather than asking for the result, add a webhook on the Developers page and pick call.completed: your server is sent the outcome the moment a call ends. Webhooks has every event and the signature check.

    call.completed, a sample delivery
    {
      "event": "call.completed",
      "ts": 1772634500,
      "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
      "data": {
        "call": {
          "id": "00000000-0000-0000-0000-000000000001",
          "contact_id": "00000000-0000-0000-0000-000000000002",
          "campaign_id": null,
          "agent_id": "00000000-0000-0000-0000-000000000003",
          "direction": "outbound",
          "status": "completed",
          "duration_seconds": 94,
          "disposition": "interested",
          "disposition_label": "Interested",
          "classification": "hot",
          "score": 82,
          "summary": "Asked for a site visit on Saturday.",
          "transcript": "Agent: Hello, am I speaking with Asha?\nLead: Yes.",
          "transcript_turns": [
            {
              "speaker": "agent",
              "text": "Hello, am I speaking with Asha?"
            },
            {
              "speaker": "lead",
              "text": "Yes."
            }
          ],
          "placed_by": {
            "kind": "ai_agent",
            "id": "00000000-0000-0000-0000-000000000003",
            "name": "Priya"
          },
          "cost_inr": 4.5,
          "disposition_by": "ai"
        }
      }
    }

Why did my call answer 403 or 409?

403 means the key lacks a scope, it is a sandbox key, or the number cannot be called: it is on Do-Not-Call or Do-Not-Disturb, has no consent, or it is outside your calling window. 409 means the call cannot start now: a calls-at-once limit, the agent's calling hours, a draft or paused agent, or no phone line to call from. Each answer's detail says which. Errors and limits lists every code.

Costs and what to watch

  • Every call the API places is a real call to a real person, billed from your wallet like any other call, at your plan's rates. Try it on your own number first.
  • Outbound calls are placed only inside the calling hours, 9 am to 9 pm IST at the widest. A request outside them is refused, not queued.
  • A number that is not a contact yet is saved as one, under the name you send.
FAQ

Questions, answered.

How do I make my first API call to place an AI phone call?
Make a live key with the calls:write scope, then POST /api/calls/dial with a 10-digit Indian mobile and your agent's id, in the Authorization header as Bearer and your key. The answer means ringing has started; the outcome follows in the call log and the call.completed webhook.
Can my agent use the person's name or amount on the call?
Yes. Send name and variables with the call, such as {"amount": "12,500", "due_date": "5 December"}: they fill {amount} and {due_date} in your agent's script, and are saved on the contact for the next call too.

Put AI Call Studio on your phone lines.

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