Skip to content

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:

  1. Click New API key, give it a name (for example the partner's product name) and pick the scopes it needs.
  2. Optionally set an expiry date and a rate limit.
  3. 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.

Least privilege. Give each integration its own key with only the scopes it needs. When the admin who created a key leaves (is disabled or deleted), create a new key with another admin.

Scopes#

Every endpoint in the API reference shows the scope it needs. A request outside the key's scopes is refused with 403 forbidden.

ScopeWhat it allows
calls:readList and read calls, recordings, voicemails and parked calls
calls:writePlace click-to-call calls, hang up, transfer, record, park and pick up calls
calls:monitorListen to, whisper into or barge into live calls and read the wallboard
numbers:readRead numbers and routing objects (queues, schedules, call flows, caller ID profiles)
numbers:writeChange number routing; create, update and delete queues (and members), schedules, call flows and caller ID profiles
crm:readRead CRM objects, records, activities; search records by phone
crm:writeCreate, update and delete CRM records, activities and notes
messages:readList conversations and messages (SMS, WhatsApp, email, chat)
messages:writeSend messages and start conversations
users:readList users and extensions
users:writeCreate, update and delete users (extension, role, queue membership, manual outbound AMD)
reports:readRead call, missed call, agent, queue and campaign reports
campaigns:readRead dialer campaigns and their leads
campaigns:writeManage campaigns, upload leads and edit the do-not-call list
webphoneMint webphone tokens for users
webhooksManage webhook endpoints and read the delivery log
rvm:readRead voicemail messages and ringless voicemail / voicemail drop results
rvm:writeCreate voicemail messages and send ringless voicemails / voicemail drops
ai:readRead AI agents and AI call history (transcripts, tool log, outcome)
ai:writeCreate, update and delete AI agents and place outbound AI agent calls

Base URL and authentication#

All endpoints live under one base URL:

Text
https://telco.lexogenix.com/api/v1

If 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:

curl
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.

Never put an API key in a browser or a mobile app. Keys belong on your server. To give a browser a phone, mint a short-lived webphone token on your server (see Embedding).

Requests and responses#

  • Request and response bodies are JSON (Content-Type: application/json) with camelCase field names. A few uploads use multipart/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.
  • PATCH changes only the fields you send. PUT replaces the whole object (absent fields take their defaults).
  • Successful creates answer 201, deletes 204 with no body, and operations that start something in the background (placing a call, sending a voicemail drop) 202.

Pagination#

List endpoints return an envelope:

JSON
{ "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:

JSON
{ "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.

HTTPcodeMeaning
400validation_errorThe request is malformed or a field is wrong; see fields.
401unauthorizedMissing, wrong, expired or revoked key, or the user who created the key is no longer active.
402payment_required, insufficient_balanceThe company's plan or prepaid balance does not allow it (for example no balance for an outbound call).
403forbiddenThe key lacks the scope, the endpoint is not available to keys, the user's role does not allow it, or the company is suspended.
403module_disabled, feature_disabledThe feature is not part of the company's plan or is switched off.
403call_blockedCall protection or fraud rules refused the destination.
404not_foundThe object does not exist or the key's user may not see it.
409conflictThe 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).
409opted_out, consent_requiredThe recipient opted out, or consent must be attested first.
429rate_limitedToo many requests; wait for Retry-After seconds.
500internalSomething went wrong on LexoConnect's side; retry later.
503media_unavailable, service_unavailableThe 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-id header, 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.
Getting started · API guide · LexoConnect