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
Only local numbers are offered, in the US (US), Spain (ES), the UK (UK), Germany (DE), France (FR), Italy (IT) and Portugal (PT). Narrow the search with region_code or locality; results come 15 per page (page=2 for more).
In most countries outside the US the regulator requires the account holder’s identity and address documents before a number can be activated, and Lokutor cannot collect them yet. Buying such a number is refused with the code
number.documents_required and nothing is charged. US numbers are activated at once.phone_number from the results. The monthly_cost shown there is the carrier’s figure, not your price.
3. Buy it, bound to the agent
200 means the number is yours and already routed to the agent. 202 means the order was placed and the number appears in GET /callcenter/numbers shortly.
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. Which destinations can be dialled is listed under /callcenter/dial.