Skip to content

API guide

CRM

Read the company's CRM objects, create and search records, find a caller by phone number, and work with the timeline, notes and tasks.

Objects and records#

The LexoConnect CRM stores records of objects. Every company has contacts, companies, leads and deals out of the box, and can add its own objects and fields. GET /crm/objects (scope crm:read) lists the objects with their fields and pipelines, so your integration can discover custom fields instead of hard-coding them.

A record has an object, a title, its field values in data, an ownerId, optionally a pipeline stageId, and the phone numbers and emails LexoConnect uses to link calls and messages to it automatically.

Create, read, update and delete#

curl -X POST "$LEXO_URL/api/v1/crm/records" \
  -H "Authorization: Bearer $LEXO_API_KEY" -H "Content-Type: application/json" \
  -d '{"object": "contact", "data": {"name": "Grace Hopper", "phone": "+12125550123", "email": "grace@example.com"}}'
NeedEndpoint
List or searchGET /crm/records?object=contact&q=grace&ownerId=...&limit=50
Get oneGET /crm/records/{id}
Update fields (only those sent)PATCH /crm/records/{id} {"data": {...}, "ownerId": "...", "stageId": "..."}
DeleteDELETE /crm/records/{id}
Simple contact directoryGET /contacts, POST /contacts, PATCH /contacts/{id}, DELETE /contacts/{id} (name, phone, email, company)

Writes need crm:write. Without the supervisor role, the creator of the key sees the records they own or handled calls for.

Find a caller by phone number#

GET /crm/lookup?phone=+12125550123 returns the records with that number. Use it for a screen pop in your product when a call.ringing webhook arrives.

curl "$LEXO_URL/api/v1/crm/lookup?phone=%2B12125550123" -H "Authorization: Bearer $LEXO_API_KEY"

Timeline, notes and tasks#

Every record has a timeline: calls, messages, voicemails, AI calls, notes, tasks and wrap-ups, newest first.

curl
curl "$LEXO_URL/api/v1/crm/records/RECORD_ID/activities" -H "Authorization: Bearer $LEXO_API_KEY"

Add a note or a task (type note or task; tasks take a dueAt and are assigned to the key's user):

curl -X POST "$LEXO_URL/api/v1/crm/records/RECORD_ID/activities" \
  -H "Authorization: Bearer $LEXO_API_KEY" -H "Content-Type: application/json" \
  -d '{"type": "task", "body": "Send the quote", "dueAt": "2026-11-20T15:00:00Z"}'

PATCH /crm/activities/{id} edits a note's body or a task's dueAt, or completes a task with {"done": true}; DELETE removes it.

Keep another CRM in sync#

To mirror LexoConnect into your own CRM, subscribe to contact.created and contact.updated (any CRM object; data.object names it), plus call.ended, call.dispositioned, message.received and voicemail.created to log activity. To push records from your CRM into LexoConnect, create them with POST /crm/records after checking GET /crm/lookup for an existing match. See the call logging recipe.

Documents and generated PDFs#

Records hold documents: uploaded files and PDFs generated from the company's PDF templates. GET /crm/records/{id}/documents lists them, POST /crm/records/{id}/documents uploads one (multipart form with file, at most 25 MB, and an optional typeId from GET /crm/document-types), and GET /crm/documents/{id}/download returns the file. To produce a contract or letter, call POST /crm/records/{id}/documents/generate with a templateId from GET /crm/pdf-templates: LexoConnect fills the template's {{merge}} fields from the record and saves the PDF on it.

curl
curl -X POST "$LEXO_URL/api/v1/crm/records/$RECORD_ID/documents" \
  -H "Authorization: Bearer $LEXO_API_KEY" \
  -F "file=@statement.pdf" -F "typeId=$TYPE_ID"

Meetings in Google Calendar#

When the key's owner has connected Google Calendar in LexoConnect (My calendar), POST /crm/records/{id}/meetings books a meeting for the record: LexoConnect checks free/busy first and answers 409 with error.code slot_busy and error.fields.nextFree when the time is taken. GET /crm/records/{id}/meetings lists the meetings booked for a record.

JavaScript
const res = await lexo("POST", `/crm/records/${recordId}/meetings`, {
  start: "2026-11-20T15:00:00-05:00", durationMinutes: 30, title: "Intro call", attendeeEmail: "grace@example.com",
});
CRM · API guide · LexoConnect