Skip to main content

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 nextCursor back as cursor until it is null.

  • Offset (nextOffset)

    Pass nextOffset back as offset until it is null.

  • Offset (hasMore)

    Add the page size to offset while hasMore is true.

  • Feed (data, hasMore, nextCursor)

    Pass nextCursor back as cursor; hasMore: false means caught up, not finished.

  • Page number (page, pageSize)

    Increase page from 1 until a page has fewer than pageSize items.

  • Cursor in the X-Next-Cursor header

    Pass the X-Next-Cursor header back as cursor; it is absent on the last page.

  • Not paged

    Returns the whole list in one response: a bare array, or items with nextCursor always null.

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 returns 415. A body that is valid JSON but does not match the fields returns 422.
  • Most HTTP clients send any method name. Some proxies, gateways and firewalls only pass standard methods; if a QUERY request never arrives, use the GET twin.
  • Retry a QUERY like a GET: it never changes anything.
A QUERY request
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.

  • 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 types lead.stage_changed, field targets lead.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.

Convert an operation key (JavaScript)
// 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

  • Leads (search and export)Parameter or field: sortValues: received-desc (default) or received-asc
  • Call detail recordsParameter or field: orderValues: NEWEST (default) or OLDEST
  • 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.

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