curl; the dashboard can do the same steps without code.
Before you start
- An agent created in the dashboard. Its prompt, voice, language and tools are what callers get.
- An API key in
LOKUTOR_API_KEY(Authentication). - A first top-up on the account. Phone numbers and outbound calls are not paid by the welcome credit: before the first top-up these endpoints answer
402billing.topup_required.
1. Find your agent’s id
2. Search for a number
Numbers are sold in 133 countries (GET /callcenter/numbers/countries lists them). Narrow the search with type, locality, region_code, area or digits; page=2 for more.
phone_number whose state is now, and look at its month_usd and setup_usd.
US, Canadian and a few other numbers work at once. Elsewhere the country asks who holds the number (
state is papers): an admin gives it once in the dashboard, in Documents for numbers. Until then, buying one answers number.papers_needed. Nothing is charged until the number works.3. Buy it, bound to the agent
200 means the number is yours and already routed to the agent. 202 means it is being activated: follow it in GET /callcenter/numbers/orders, and once it works it is in GET /callcenter/numbers.
4. Call it
Call the number from any phone. The agent answers with its first message and holds the conversation. The call appears in the dashboard with its transcript. A call to your number is not answered while the account balance is under $0.25.5. Route it to another agent later
{id} is the number’s id from GET /callcenter/numbers, not the phone number itself.
Outbound calls
The same number can call out.consent_confirmed: true is required and records that you have a lawful basis to call this person.
call_id lets you follow the call and hang it up. GET /callcenter/price?from=…&to=… says what a call would cost and whether your workspace may place it (where you can call).