Developers

REST API

Call the Calleague app API with a Bearer token — start a call, look it up, read assistants, paginate lists, and handle errors and rate limits. With the real worked example from the screenshot.

The Calleague REST API lets you do from code what you do in the dashboard: run your voice assistants, start and review calls, and read your account's data. This page covers the base address, Bearer authentication, the common operations, pagination, error codes, and rate limits — built around the real request and response shown in the screenshot.

Everything here is app-level: you sign in as your workspace and send requests over a secure connection. There is nothing to install.

At a glance

TopicSummary
TransportSecure connection (HTTPS), JSON in and JSON out.
AuthAPI key as an Authorization: Bearer header.
Base addresshttps://app.calleague.ai.
A single result{ "callId": "...", "status": "...", ... }.
A list{ "total": N, "list": [ ... ] }.
An errorA non-2xx reply with a code and a message.

REST API request and response

Base address

All requests go to your Calleague workspace, rooted at https://app.calleague.ai/api/.... Requests and responses are JSON. Set Content-Type: application/json on any request that sends a body.

Authentication

Every request carries an API key as a Bearer token in the standard Authorization header — the same Authorization: Bearer $TOKEN line you see in the screenshot:

Authorization: Bearer $TOKEN

You create, name, and revoke keys from your account settings inside the app. A key inherits your permissions, so it can do exactly what you can do — no more.

Generate a key

In your account settings, open the API keys area and create one. Name it after the integration so you can audit and revoke it on its own.

You'll see the full key once, at creation time.

Authenticate a request

Send the key on every request. A quick way to confirm it works is to list your assistants:

curl -s https://app.calleague.ai/api/core/voice/agent/list \
  -H "Authorization: Bearer $TOKEN"

You'll see a JSON list of your assistants if the key is valid.

Read the response

Check the HTTP status first, then read the JSON body. Check a value exists before you use it.

You'll get a 401 instead of data if the key is missing or wrong.

Never paste a key into scripts, repositories, or documents. Keep it in your own secret store and supply it at run time. The keys shown here are placeholders, not real credentials.

Common operations

The first row is the real endpoint from the screenshot. The rest are the companion operations you'll reach for; treat their exact paths as illustrative and confirm them for your workspace.

MethodPathPurposeBody
POST/api/core/voice/agent/callStart an outbound call.agentId, to
GET/api/core/voice/call/{callId}Look up one call's detail and outcome.
GET/api/core/voice/call/listList recent calls (paginated, filterable).
GET/api/core/voice/agent/listList your voice assistants.
GET/api/core/voice/agent/{agentId}Read one assistant's configuration.
POST/api/core/webhookRegister a webhook endpoint.url, events

Request fields — start a call

FieldInTypeRequiredDescription
agentIdbodystringYesThe voice assistant that will handle the call (its id, e.g. ag_123).
tobodystringYesThe number to dial, in international format (e.g. +90312...).
metadatabodyobjectNoYour own key/value pairs, echoed back on the call and its events.

Query fields — list calls

FieldInTypeDefaultDescription
pagequeryinteger1Which page to read (starts at 1).
pageSizequeryinteger20Items per page.
statusquerystringFilter by status, e.g. completed, failed.
agentIdquerystringRestrict to one assistant.

Start a call

This is the exact request and response from the screenshot. Add an optional metadata object to carry your own reference (such as an order id).

curl -s -X POST https://app.calleague.ai/api/core/voice/agent/call \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "agentId": "ag_123",
        "to": "+90312...",
        "metadata": { "orderId": "A-1042" }
      }'

A successful start returns the new call:

{
  "callId": "cl_8f2a",
  "status": "ringing",
  "language": "tr"
}

Look up a call

Read a single call to see how it progressed — or rely on webhooks to be told instead.

curl -s https://app.calleague.ai/api/core/voice/call/cl_8f2a \
  -H "Authorization: Bearer $TOKEN"
{
  "callId": "cl_8f2a",
  "status": "completed",
  "direction": "outbound",
  "durationSec": 84,
  "endedReason": "completed",
  "language": "tr",
  "recordingReady": true,
  "transcriptReady": true,
  "createdAt": "2026-01-01T12:00:00.000Z",
  "endedAt": "2026-01-01T12:01:24.000Z"
}

Call status values

StatusMeaning
ringingDialing the destination.
in-progressConnected; the conversation is underway.
completedFinished normally.
failedCould not connect or errored.
no-answerThe destination did not pick up.

Pagination

Listing calls returns a paginated shape — always handle an empty list gracefully:

curl -s "https://app.calleague.ai/api/core/voice/call/list?page=1&pageSize=20" \
  -H "Authorization: Bearer $TOKEN"
{
  "total": 0,
  "list": []
}

To page through results, increase page until the number of items you've collected reaches total.

A list endpoint can legitimately return an empty list. In your own code, default to an empty array before you loop, and check a value exists before reading it — assuming a populated shape is the most common integration bug.

Error codes

A failed request comes back with a non-2xx status, a code, and a human-readable message. Branch on the HTTP status first.

{
  "code": 401,
  "message": "Invalid or missing API key"
}
HTTPMeaningWhat to do
400Bad request — malformed JSON or a missing field.Validate the body; set Content-Type: application/json.
401Not signed in — key missing, wrong, or revoked.Re-check the Authorization: Bearer header and the key.
403Not allowed — the key's account lacks permission.Use a key whose account can do the action.
404Not found — unknown id or path.Verify the callId / agentId and the path.
409Conflict — the resource's state blocks the action.Re-read the resource and retry once resolved.
422Valid JSON but invalid values.Fix the field values (e.g. to must be a valid number).
429Too many requests.Slow down and retry after a short wait.
5xxTemporary problem on our side.Retry after a growing delay.

Rate limits

The API applies fair-use limits per workspace. Build your client to cope:

PracticeWhy
Respect a 429Stop sending until your wait window passes.
Back off, and add a little randomnessAvoids everyone retrying at the same instant.
Prefer webhooks over constant checkingRemoves most repeated reads.
Group work where you canFewer requests for the same result.

A burst of fast retries after a 429 makes throttling worse, not better. Wait, add a little randomness, then retry — do not loop immediately.

If something looks different

SymptomLikely causeFix
401 on every requestMissing/expired key or wrong headerConfirm Authorization: Bearer $TOKEN and that the key is active
400 on a POSTBody isn't JSON, or header missingSend valid JSON and set Content-Type: application/json
Your code crashes on a listThe list came back emptyDefault to an empty array before looping
404 on a call you know existsWrong id or stale pathRe-list to confirm the callId; check the path
Frequent 429Checking too aggressivelySwitch to webhooks or add a wait between requests
A field you read is missingA new/optional field is absentCheck it exists first; ignore fields you don't recognise

FAQ

Next steps