API guide
Getting started
API keys and scopes, the base URL, request and response format, pagination, errors, rate limits and versioning.
Create an API key#
API keys are created by an admin of the company (tenant) the integration works for, in Admin → Developer → API keys:
- Click New API key, give it a name (for example the partner's product name) and pick the scopes it needs.
- Optionally set an expiry date and a rate limit.
- Copy the key. It starts with
nc_live_and is shown once; LexoConnect only keeps a hash.
A key acts as the admin who created it, in that company only, limited to its scopes. It can never reach platform, billing, trunk, channel or API key management endpoints, and it never acts across companies. Every write made with a key is in the company's audit log, and the last use is shown next to the key. Revoke a key at any time; it stops working at once.
Scopes#
Every endpoint in the API reference shows the scope it needs. A request outside the key's scopes is refused with 403 forbidden.
| Scope | What it allows |
|---|---|
calls:read | List and read calls, recordings, voicemails and parked calls |
calls:write | Place click-to-call calls, hang up, transfer, record, park and pick up calls |
calls:monitor | Listen to, whisper into or barge into live calls and read the wallboard |
numbers:read | Read numbers and routing objects (queues, schedules, call flows, caller ID profiles) |
numbers:write | Change number routing; create, update and delete queues (and members), schedules, call flows and caller ID profiles |
crm:read | Read CRM objects, records, activities; search records by phone |
crm:write | Create, update and delete CRM records, activities and notes |
messages:read | List conversations and messages (SMS, WhatsApp, email, chat) |
messages:write | Send messages and start conversations |
users:read | List users and extensions |
users:write | Create, update and delete users (extension, role, queue membership, manual outbound AMD) |
reports:read | Read call, missed call, agent, queue and campaign reports |
campaigns:read | Read dialer campaigns and their leads |
campaigns:write | Manage campaigns, upload leads and edit the do-not-call list |
webphone | Mint webphone tokens for users |
webhooks | Manage webhook endpoints and read the delivery log |
rvm:read | Read voicemail messages and ringless voicemail / voicemail drop results |
rvm:write | Create voicemail messages and send ringless voicemails / voicemail drops |
ai:read | Read AI agents and AI call history (transcripts, tool log, outcome) |
ai:write | Create, update and delete AI agents and place outbound AI agent calls |
Base URL and authentication#
All endpoints live under one base URL:
https://telco.lexogenix.com/api/v1If your LexoConnect provider runs LexoConnect on its own domain, use that domain instead; only the host changes. The samples in this guide read the host and key from two environment variables:
export LEXO_URL="https://telco.lexogenix.com"
export LEXO_API_KEY="nc_live_..."Send the key as a bearer token on every request:
curl "$LEXO_URL/api/v1/me" -H "Authorization: Bearer $LEXO_API_KEY"GET /me answers with the key's user and company, so it is the quickest way to check a key.
Requests and responses#
- Request and response bodies are JSON (
Content-Type: application/json) with camelCase field names. A few uploads usemultipart/form-data; the reference says so. - Ids are UUIDs. Times are RFC 3339 in UTC, for example
2026-11-13T15:04:05Z. - Phone numbers are E.164:
+followed by the country code and number, for example+12125550123. PATCHchanges only the fields you send.PUTreplaces the whole object (absent fields take their defaults).- Successful creates answer
201, deletes204with no body, and operations that start something in the background (placing a call, sending a voicemail drop)202.
Pagination#
List endpoints return an envelope:
{ "items": [ { "id": "..." } ], "nextCursor": "eyJ0IjoiMjAyNi0xMS0xM1QxNTowNDowNVoifQ" }Pass limit (1–200, default 50 where supported) and, for the next page, cursor set to the previous nextCursor. nextCursor is null on the last page. Lists are newest first unless the reference says otherwise.
curl "$LEXO_URL/api/v1/calls?limit=100" -H "Authorization: Bearer $LEXO_API_KEY"
curl "$LEXO_URL/api/v1/calls?limit=100&cursor=NEXT_CURSOR" -H "Authorization: Bearer $LEXO_API_KEY"Page numbers#
Every list that is not cursor-paged also accepts page numbers. Send page (from 1) and pageSize (1–100, default 10; larger values are reduced to 100), optionally q to search the items' text and sort to order by a field (sort=name, sort=-createdAt for descending). The response then carries the total:
curl -s "$LEXO_URL/api/v1/queues?page=2&pageSize=25&sort=name" -H "Authorization: Bearer $LEXO_API_KEY"Without page/pageSize these lists answer as before ({items, nextCursor: null} with every item, capped at 1,000; "truncated": true marks a capped list), so existing integrations keep working. Lists that page with cursor (calls, conversations, CRM records, audit log, opt-outs) keep using the cursor.
Errors#
Errors use HTTP status codes and one JSON shape:
{ "error": { "code": "validation_error", "message": "Validation failed", "fields": { "to": "must be a phone number" } } }fields is present for validation errors and names each wrong field.
| HTTP | code | Meaning |
|---|---|---|
| 400 | validation_error | The request is malformed or a field is wrong; see fields. |
| 401 | unauthorized | Missing, wrong, expired or revoked key, or the user who created the key is no longer active. |
| 402 | payment_required, insufficient_balance | The company's plan or prepaid balance does not allow it (for example no balance for an outbound call). |
| 403 | forbidden | The key lacks the scope, the endpoint is not available to keys, the user's role does not allow it, or the company is suspended. |
| 403 | module_disabled, feature_disabled | The feature is not part of the company's plan or is switched off. |
| 403 | call_blocked | Call protection or fraud rules refused the destination. |
| 404 | not_found | The object does not exist or the key's user may not see it. |
| 409 | conflict | The object is in the wrong state (for example a campaign must be paused before it is deleted, or a call is not live any more). |
| 409 | opted_out, consent_required | The recipient opted out, or consent must be attested first. |
| 429 | rate_limited | Too many requests; wait for Retry-After seconds. |
| 500 | internal | Something went wrong on LexoConnect's side; retry later. |
| 503 | media_unavailable, service_unavailable | The phone system (or another part) is briefly unavailable; retry shortly. |
Treat any unknown code by its HTTP status. Retry only 429, 500 and 503, with back-off.
Rate limits#
- Per key: 600 requests a minute by default. The admin can set each key between 1 and 6 000 requests a minute.
- Per IP address: 600 requests a minute with bursts of up to 200, for all traffic from one address.
Over a limit the API answers 429 rate_limited with Retry-After: 10. Prefer webhooks to polling: they arrive within seconds and cost no requests.
Retries and idempotency#
The API does not support an Idempotency-Key header. Before retrying a request that creates something (a call, a message, a record), check whether the first attempt succeeded:
- place calls once and follow them through the
call.*webhooks; - for records, search first (
GET /crm/lookup?phone=...) and create only when nothing is found; - for webhooks, deduplicate on the
webhook-idheader, which stays the same across retries.
Versioning#
The version is in the path (/api/v1). Within v1, LexoConnect only adds things: new endpoints, new optional request fields, new response fields and new webhook event types. Your code must ignore fields it does not know. A breaking change would ship as /api/v2, with v1 kept running alongside it.
Testing safely#
- Ask your LexoConnect provider for a separate test company (tenant) and create the key there. Test data never mixes with live customers.
- Use test phone numbers you own; outbound calls and messages are real and are billed from the company's prepaid balance.
- Point webhooks at a request inspector or a local tunnel while you develop, and use Send test event on the endpoint.
- Use short-lived keys (set an expiry) for experiments, and revoke them afterwards.