Skip to main content
Everything here lives under /callcenter/* on https://api.lokutor.com. The routes exist only on a server with telephony configured; where it is not, they are not registered at all and answer 404. api.lokutor.com has telephony configured. For a step-by-step setup, see the Phone agent quickstart. Authentication: every endpoint takes an API key or wst_ ticket as Authorization: Bearer, X-API-Key or ?api_key= (Authentication). The key must belong to an account (401 otherwise). Billing: calls and numbers are paid from the account’s prepaid balance (Pricing and billing). Buying a number and placing calls need a first top-up: before it, those endpoints answer 402 with {"code": "billing.topup_required", "error": "…"}. With less than $0.25 of balance they answer 402 billing.insufficient_balance; the other 402s are in Billing errors, and the rest of the codes in Phone errors. Roles and permissions: reading needs calls or numbers on a narrowed key. Placing a call needs a member; numbers, pools, carriers and campaigns need an admin. What the platform asks of the calls you place is in Outbound calls. Account scope: every endpoint acts only on the account that owns the key. The agents and numbers you list are your own. Assign, release, dial and bulk-dial work only with numbers you own and agents you own. A number or agent that belongs to another account answers 404 (403 for a from number you don’t own), whether or not it exists. The API needs a key that belongs to an account (401 otherwise).

GET /callcenter/status — Provisioning Status

Whether calling is enabled, and through which carrier.

Response


GET /callcenter/agents — List Agents

Returns every agent on the account, for populating a “route to agent” picker.

Response


GET /callcenter/numbers/countries — Where Numbers Are Sold

Every country numbers are on sale in, 133 today, what works at once for this account first. Each has its types with their price and what they take:
state is now (works in seconds), papers (the country asks who holds it; asks says what, in a few words) or no (why says why not for this account). GET /callcenter/numbers/needs?country=ES&type=local&locality=Madrid lists each paper one takes and which the account has given (admins).

GET /callcenter/numbers/search — Search Available Numbers

What can be bought in a country now, with its price.

Query Parameters

Response

month_usd and setup_usd are what you pay. receives_only: a toll-free number takes calls and is not shown on the ones you make.

cURL


GET /callcenter/numbers — List Owned Numbers

Returns every number on the account, merged with its agent binding (if any).

Response

id is what the number’s paths take (/callcenter/numbers/{id}), and number_id what a pool’s numbers take. source is lokutor for a number rented here, or twilio, telnyx or sip for one on your own carrier, which also has trunk_id and trunk_name. A number being ordered is not here yet: it is in the orders. status is active, or activating while the carrier is still doing its review of the holder: it turns active by itself. status_note explains it in words and telnyx_status is the carrier’s own value.

POST /callcenter/numbers — Buy a Number

Purchases a number you have already found via search — phone_number must be an exact result from /callcenter/numbers/search, not an arbitrary string. There’s no “buy a random number for this country” shortcut; searching first is required.
This rents the number: its month and setup are set aside from your balance and charged when it works, then a month in advance. There’s no confirmation step at the API level; the caller is the confirmation step. Buying a number needs a first top-up (402 billing.topup_required before it) and its month and setup in the balance (402 billing.insufficient_balance).
If the balance cannot pay a month, the number is kept for 30 days, still answering calls while the balance allows; after that it is released, and a released number cannot be recovered. A call on a number is billed like any agent session (platform time per second and the language model per token) plus the phone line per started minute, by direction and number: a call your agent receives is priced by your number, one it makes (dial, campaign) by the destination, landline or mobile. For example, a received call on a Spanish number is $0.035 a minute of line, about 9.5¢ a minute in all; a call made to a Spanish mobile is $0.105 a minute of line, about 16.5¢ in all. Every country’s rate is in Pricing and billing and in the rate card. A call to your number while the balance is under $0.25 is not answered.

Request

Response (200)

It works.

Response (202)

It is being activated. note says why, in words; nothing is charged until it works. Asking for the same number again answers the same order.
A number that takes papers the account has not given answers 422 number.papers_needed with needs; one it cannot hold, 422 number.cannot_hold; one that is gone, 409 number.gone. Nothing is bought.

Numbers being activated

GET /callcenter/numbers/orders lists them, with the ones that ended in the last week: status is ordering, waiting_credit (a delay of ours, tried again by itself), under_review, declined (a document has to be given again; note is what the reviewer wrote), activating, failed, cancelled or expired. DELETE /callcenter/numbers/orders/{id} cancels one, and what was set aside is free again. One that never completes is cancelled after 14 days. The papers themselves (/callcenter/papers and POST /callcenter/numbers/orders/{id}/papers) are given by an admin signed in to the dashboard: an API key is answered 403 account.person_required.

cURL


PATCH /callcenter/numbers/{id} — Change a Number

Send only what changes: In the list, care has what is known of it: resting (since, until, reason: objections, short_calls, answer_rate or manual), label_seen and label_checked_at.

Number Health and Rest

GET /callcenter/numbers/health answers, for each number, its calls of today and of this hour with what it may make (calls_today, of the number’s own day, calls_hour, per_day, per_hour, and stage: first_week, second_week or full), its calls and answered calls in 7 and 30 days, how many answered calls lasted six seconds or less (short_7d of talked_7d) and how many people asked not to be called (objections_30d); and, for each pool, how many numbers were replaced in 90 days. POST /callcenter/numbers/{id}/rest with { "days": 14 } puts one to rest, 1 to 90 days; { "days": 0 } wakes it (admins).

POST /callcenter/numbers/{id}/assign — Assign a Number to an Agent

Rebinds an already-owned number to route inbound calls to a different agent (or, with agent_id: "", no agent).

Request

Response


DELETE /callcenter/numbers/{id} — Release a Number

Releases a number rented here and removes its agent binding. {id} is the id from GET /callcenter/numbers, not the phone number itself. A number on your own carrier is only disconnected: it stays yours there.
This is irreversible — you lose the number.

Response


POST /callcenter/dial — Place One Outbound Call

Request

A number on the account’s do-not-call list, or of a business on it, answers 403 dial.do_not_call. Calls from a number rented here go out through Lokutor’s carrier, with the destination limits below; calls from a number on your own carrier go out through yours. A connection_id in the body is ignored. An outbound call is billed as agent time and tokens plus the line per started minute, at the price of the two numbers (Pricing and billing); a call nobody answers costs nothing. Placing calls needs a first top-up (402 billing.topup_required before it), and the first two minutes are set aside from the balance before it is dialled. Any country with a price can be called, if the account allows it: one that is off, or a call that costs more than is allowed, is refused with its code and its price in amounts, and nothing is billed. Emergency numbers and short codes are never called.
consent_confirmed isn’t a default-true convenience flag — omit it or send false and the request is rejected with 400. It asserts you have a lawful basis to make this specific call (consent, an existing business relationship, etc.) and is written to an audit log (call_consent_log) alongside the call. It documents that you made the assertion; it doesn’t verify it. Outbound calling still needs a real consent/TCPA policy behind it — this is a gate and a paper trail, not a compliance program.

Response

warnings, when there are any, say what is worth knowing of a call that was placed: the number is past its calls, the person was already called today or as often in 14 days as campaigns may, they asked not to be called and are not on the list, or nobody answers the number when called back. Past twice its calls, the answer is 429 dial.number_limit:

cURL

Use the returned call_id to follow the call or hang it up with POST /callcenter/hangup/{id}.

Price and Permission

PATCH /callcenter/calling and resume are an admin’s, signed in to the dashboard: an API key is answered 403 account.person_required, so a leaked one calls nowhere new. The public prices, with no key, are in /v1/pricing/calls.

GET /callcenter/call-monitor — Follow a Call

GET /callcenter/call-monitor?call_id={call_id} returns the current state of a call your account placed:
status is dialing, ringing, connected or ended. A call that is not yours, or that the server does not know, reads as {"status": "ended", "transcript": [], "duration": 0}.

Live updates (Server-Sent Events)

GET /callcenter/sse/call-monitor?call_id={call_id} streams the same information. The first event is a snapshot (status, transcript, duration); then status, transcript (one new line in text), transcript_sync (the whole transcript) and ended (with end_reason) events follow as the call progresses. Each arrives as a data: line holding a JSON object with a type field. A : heartbeat comment is sent every 15 seconds. A browser EventSource cannot send headers, so pass a short-lived ticket (minted on your backend, see Authentication) as api_key:

Hang Up a Call

POST /callcenter/hangup/{id} hangs up a call your account placed. {id} is the call_id from /callcenter/dial.

POST /callcenter/bulk-dial — Create a Bulk Dial Batch

Queues up to 5,000 calls at once. Calls start at the platform’s pace, a few a second for everybody, behind single calls and transfers: a large list is spread over time, and no row is lost for it. Each row dials independently, at its own scheduled time (or immediately) — this runs server-side on a background scheduler, so it keeps going even if you close the tab, and even the “dial now” rows go through the same pacing as scheduled ones.

Request

Response

Rows that cannot be called are in skipped, and the rest start. When none can, the answer is 400. A commercial campaign that lacks its number or its consents does not start: 403 dial.commercial_number or dial.consent_needed, with how many rows and which numbers (the first 50). One from a number nobody answers is refused with campaign.unanswered_number. A key with a monthly limit cannot start a campaign (account.key_limited).

GET /callcenter/bulk-dial — List Batches

Returns every batch created by the authenticated account, most recent first, each with a live status breakdown.

Response


GET /callcenter/bulk-dial/{id} — Batch Detail

Returns one batch with its rows, 200 at a time (?offset=200 for the next), each with its conversation once the call has happened. A key without conversations:read gets the rows without it.

Response

Row status is one of pending, dialing, sent, failed, cancelled. Once a call ends, outcome says what became of it: answered, no_answer, busy, voicemail, failed or unknown. POST /callcenter/bulk-dial/{id}/pause, /resume and /cancel control it; calls already up are not cut. A campaign’s status is running, paused, cancelled or finished. One that may not go on (no balance, a spend limit, its number or agent gone, calls at high prices paused) pauses itself: paused_reason says why, in words. One that waits (for its hours, or for its numbers to have room) is still running, with waiting_reason and waiting_until. A row’s asked_at says when that person asked not to be called. GET /callcenter/bulk-dial/{id}/export is the results as CSV, a line per person; ?attempts=1, a line per call.

Attempts

GET /callcenter/attempts lists the calls placed, the latest first, 100 at a time (?offset=): ?to= a person, ?from= one of your numbers, or ?row= a campaign’s row.
outcome is answered, no_answer, busy, voicemail or failed, and null while the call is in progress.

Pools

GET /callcenter/pools, POST /callcenter/pools, GET, PATCH and DELETE /callcenter/pools/{id}. What each field does is in Numbers, pools and campaigns.
after_hours.action is agent (with agent_id), forward (with number, a phone number or a SIP address) or message. overflow takes a number, a message, or both. Messages are up to 500 characters. caller_id.strategy is rotate, match_prefix or fixed (with number). max_concurrent is 1 to 1,000, or null for no limit of its own. limits are the calls each number may make in campaigns, or null for the usual ones. numbers replaces the pool’s numbers; POST /callcenter/pools/{id}/numbers moves some in or out. An account has up to 100 pools.

Your own carrier

Numbers you have with Twilio or any SIP provider (what each needs). Not open to every workspace yet: these answer 503 trunks.not_enabled until it is; write to [email protected]. An account has up to 20 connections of 500 numbers each. Credentials are stored encrypted and never returned. A Telnyx account can’t be connected yet (503 carrier.not_yet): connect its numbers as a SIP trunk.

Do not call

No call or campaign of the account dials a number on the list, or anybody of a business on it (who is not called).