Conventions
Where v1 of the API is not uniform, and how to handle each difference in one place.
Most of the API follows one set of rules: JSON with camelCase fields, ISO 8601 timestamps in UTC, UUIDs for IDs and upper-case enum values. A few areas grew up separately and differ. They are stable for the life of v1: any change comes with a new API version and a changelog entry. The reference marks each affected operation and field with a link back here.
List responses
Lists come in a few shapes. Each operation in the reference states its paging style beside its scope. Write one small helper per style rather than one for all.
Cursor (
items,nextCursor)Pass
nextCursorback ascursoruntil it isnull.Offset (
nextOffset)Pass
nextOffsetback asoffsetuntil it isnull.Offset (
hasMore)Add the page size to
offsetwhilehasMoreistrue.Feed (
data,hasMore,nextCursor)Pass
nextCursorback ascursor;hasMore: falsemeans caught up, not finished.Page number (
page,pageSize)Increase
pagefrom 1 until a page has fewer thanpageSizeitems.Cursor in the
X-Next-CursorheaderPass the
X-Next-Cursorheader back ascursor; it is absent on the last page.Not paged
Returns the whole list in one response: a bare array, or
itemswithnextCursoralwaysnull.
QUERY requests
Some reads, such as Query leads, use the HTTP QUERY method: a safe, repeatable read like GET, but with its filters in a JSON body instead of the URL. Use it when the filters would make a URL too long, for example a long list of IDs. Each one has a GET twin with the same filters as query parameters and the same response.
- Send
Content-Type: application/json; without it the API returns415. A body that is valid JSON but does not match the fields returns422. - Most HTTP clients send any method name. Some proxies, gateways and firewalls only pass standard methods; if a
QUERYrequest never arrives, use theGETtwin. - Retry a
QUERYlike aGET: it never changes anything.
BASE="$LMS_API/v1/tenants/$LMS_WORKSPACE"curl -X QUERY "$BASE/lms/leads" \ -H "Authorization: Bearer $LMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "stageCategory": "QUALIFIED", "limit": 50 }'Enum values
Resources you read and write through the REST operations use upper-case values, such as QUALIFIED. Webhook and change-feed payloads use lower-case values for the same ideas, such as qualified, so a stage category arrives in two spellings. Compare case-insensitively, or map each event value once at the edge of your integration.
| Where | Casing | Example | Opens |
|---|---|---|---|
| REST resources and request bodies | Upper case with underscores | stageCategory=QUALIFIED, status: ACTIVE | |
| Webhook and change-feed payloads | Lower case with underscores | stage.category: qualified, outcome: no_answer | |
| Exceptions in REST | Lower case | sort=received-desc (leads), category=retryable (intake exceptions), status=pending (quality reviews) | |
| Names, everywhere | Lower-case dotted | Scopes leads.read, event types lead.stage_changed, field targets lead.fullName |
- REST resources and request bodiesCasing: Upper case with underscoresExample:
stageCategory=QUALIFIED,status: ACTIVE - Webhook and change-feed payloadsCasing: Lower case with underscoresExample:
stage.category: qualified,outcome: no_answer - Exceptions in RESTCasing: Lower caseExample:
sort=received-desc(leads),category=retryable(intake exceptions),status=pending(quality reviews) - Names, everywhereCasing: Lower-case dottedExample: Scopes
leads.read, event typeslead.stage_changed, field targetslead.fullName
Lead priority
Requests set a lead's priority by name. Lead responses and events report it as a rank, so an integration that reads a lead and writes it back must translate.
LOW- =
1 MEDIUM- =
2 HIGH- =
3 URGENT- =
4
Path templates
The reference and the OpenAPI document write path parameters in braces: /lms/leads/{leadId}. One response uses the route catalogue form with a colon instead: the operations list of Describe the current credential returns GET /lms/leads/:leadId. Both name the same operation.
// Turn a catalogue key into the reference's form.const toTemplate = (operation) => operation.replace(/:([A-Za-z]+)/g, "{$1}");toTemplate("GET /lms/leads/:leadId"); // "GET /lms/leads/{leadId}"Sorting
| List | Parameter or field | Values | Opens |
|---|---|---|---|
| Leads (search and export) | sort | received-desc (default) or received-asc | |
| Call detail records | order | NEWEST (default) or OLDEST | |
| Every other list | None | A fixed order, stated in the operation's description (usually newest first) |
- Leads (search and export)Parameter or field:
sortValues:received-desc(default) orreceived-asc - Call detail recordsParameter or field:
orderValues:NEWEST(default) orOLDEST - Every other listParameter or field: NoneValues: A fixed order, stated in the operation's description (usually newest first)
Archiving and removing
Records that other records point to are archived, not deleted: they leave lists but keep their history. Most of them archive with a POST to an action path; processes archive with DELETE. A real deletion is always called that in the operation's summary.
| Record | Operation | Effect | Opens |
|---|---|---|---|
| Process | Archive a processDELETE/processes/{processId} | Archived; history kept | |
| Segment | Archive a segmentPOST/lms/segments/{segmentId}/archive | Archived | |
| Team | Archive a teamPOST/teams/{teamId}/archive | Archived | |
| Lead contact | Remove a contactPOST/lms/leads/{leadId}/contacts/{contactId}/deactivate | Removed from the lead; kept in its history | |
| Team member | Remove a team memberPOST/teams/{teamId}/members/{userId}/deactivate | Removed from the team | |
| Report template | Delete a report templateDELETE/lms/campaigns/{campaignId}/cdr/templates/{templateId} | Deleted | |
| Report export | Cancel or discard a report exportDELETE/lms/campaigns/{campaignId}/cdr/exports/{exportId} | Deleted; a running export is cancelled |
Concurrency tokens
Updates that could overwrite someone else's change carry the version you last read. Leads and their contacts and customer fields use the lead's updatedAt, sent back as expectedUpdatedAt; everything else uses an integer revision, sent back as expectedRevision. A stale token returns 409 and saves nothing; see Concurrent changes.
Field names
Fields are camelCase everywhere except the recording manifest of a quality review, which is passed through as the call recorder writes it, in snake_case (call_id, sample_rate).