Contacts and accounts (CRM)
Contacts (people) and accounts (organisations): one contact per person however many channels they write on, and each account's people under it. The platform makes a contact for everyone who writes; your system adds the rest and reads them all. Scopes: crm:read to read, crm:write to add and change.
Contacts
GET /api/v1/contacts?stage=interested&view=followups&channel=whatsapp&q=mona&cursor=...
GET /api/v1/contacts/{id}
POST /api/v1/contacts { "name": "Mona Ali", "phone": "+20 100 123 4567", "email": "mona@example.com", "accountId": "0192...", "stage": "interested", "tags": ["vip"] }
PUT /api/v1/contacts/{id} (the same fields; what is left out is cleared)
POST /api/v1/contacts/{id}/stage { "stage": "customer", "dealValue": 2500 }
POST /api/v1/contacts/{id}/follow-up { "at": "2026-10-12T08:00:00Z", "note": "call back" }
POST /api/v1/contacts/{id}/merge { "fromId": "0192..." }
DELETE /api/v1/contacts/{id}
Phone numbers are stored as digits with the country code and matched on: a number already on another contact answers 409 conflict, so merge the two or update that one. stage: new, interested, customer or lost. view: followups (a follow-up is set) or ads (came from an ad: a chat opened from an ad, or a lead form).
{
"id": "0192...", "name": "Mona Ali", "phone": "201001234567", "email": "mona@example.com", "jobTitle": null,
"accountId": "0192...", "accountName": "Al Nour Clinic", "ownerUserId": null,
"stage": "interested", "stageChangedAt": "2026-10-09T10:15:00Z", "dealValue": null,
"followUpAt": null, "followUpNote": null, "source": "whatsapp", "tags": ["vip"], "notes": null,
"lastActivityAt": "2026-10-09T10:15:00Z", "createdAt": "2026-10-01T09:00:00Z", "updatedAt": "2026-10-09T10:15:00Z",
"customFields": { "treatment": "braces" }, "adId": "120210...", "adTitle": "Braces offer"
}
source says where the contact came from: facebook, instagram, whatsapp or telegram (wrote on a channel), manual (added in the portal), import (from a file), api (from your system), website (the "contact us" form on the company's site), lead_ad (a Facebook lead form). adId and adTitle: the ad that first brought them, from a chat opened from an ad or a lead form; set once and never changed, null when no ad brought them. customFields: the company's own fields by key (see below).
Every conversation carries contactId and contactName, so the messages that reach you say which person they belong to.
Linking to your own system (externalId)
Every contact and account can carry an externalId: its id in your own system (a Dynamics 365 contactid or accountid, an ERP code), up to 100 characters and unique in the company. Send it on POST or PUT. Left out, it stays as it is; an empty "" clears it. To find the one linked to an id of yours, look it up:
GET /api/v1/contacts?externalId=7f3c2a10-...
GET /api/v1/accounts?externalId=ERP-1042
POST /api/v1/contacts { "name": "Mona Ali", "phone": "+20 100 123 4567", "externalId": "7f3c2a10-..." }
It comes back on every contact and account, and in the crm.contact.* and crm.account.* events, so your system can update its own row without searching.
Accounts
GET /api/v1/accounts?status=active&q=clinic&cursor=...
GET /api/v1/accounts/{id}
POST /api/v1/accounts { "name": "Al Nour Clinic", "kind": "clinic", "industry": "dentistry", "phone": "+20 2 1234 5678", "city": "Cairo", "status": "active" }
PUT /api/v1/accounts/{id}
DELETE /api/v1/accounts/{id} (its people stay, without an account)
status: prospect, active or inactive.
Custom fields
GET /api/v1/custom-fields?target=contact|deal (key, label, type, options)
POST /api/v1/contacts { "name": "...", "customFields": { "treatment": "braces", "visits": "3", "vip": "true" } }
The company defines its fields under "Your own fields". Values are text under the field's key: a number with a dot, a date as yyyy-MM-dd, a choice one of options, several choices comma separated, "true" for yes. A value that doesn't fit answers 400. customFields, when given, replace the old ones; left out, they stay. The same on /v1/deals.
Pipeline and deals
GET /api/v1/pipeline (the stages in order: id, key, name, probability, kind = open | won | lost)
GET /api/v1/deals?status=open&contactId=...&stageId=...&ownerUserId=...&q=...&cursor=...
GET /api/v1/deals/{id}
POST /api/v1/deals { "contactId": "0192...", "title": "50 devices", "value": 18000, "currency": "SAR", "stageKey": "quote", "expectedCloseAt": "2026-11-01" }
PUT /api/v1/deals/{id} (the same fields but the stage; what is left out is cleared)
POST /api/v1/deals/{id}/stage { "stageKey": "won" } | { "stageKey": "lost", "lostReason": "price", "lostNote": "..." }
DELETE /api/v1/deals/{id}
The stage by stageId, or stageKey for the default ones: new, contacted, quote, negotiation, won, lost. A new deal can't start lost. Lost needs lostReason: price, competitor, not_now, no_response, not_a_fit, other. Won makes the contact a customer; moving back to an open stage reopens the deal. Currency is ISO (EGP, SAR…), the company's own when left out.
Activities
GET /api/v1/activities?contactId=...&dealId=...&kind=call&state=todo|late|done&cursor=...
GET /api/v1/activities/{id}
POST /api/v1/activities { "kind": "call", "contactId": "0192...", "done": true, "outcome": "no_answer", "notes": "..." }
POST /api/v1/activities { "kind": "visit", "contactId": "0192...", "dealId": "0192...", "subject": "Site visit", "dueAt": "2026-10-14T09:00:00Z" }
POST /api/v1/activities/{id}/done { "outcome": "answered", "notes": "..." }
POST /api/v1/activities/{id}/reschedule { "dueAt": "2026-10-15T09:00:00Z" }
DELETE /api/v1/activities/{id}
kind: call, meeting, visit, task, note. done logs it as happened; otherwise dueAt (UTC) is required and it shows on its owner's "My day". outcome for a call: answered, no_answer, busy, wrong_number. Scopes crm:read and crm:write; all closed when the CRM module is off.
{
"id": "0192...", "kind": "visit", "subject": "Site visit", "notes": null, "contactId": "0192...", "contactName": "Mona Ali",
"dealId": "0192...", "dealTitle": "50 devices", "ownerUserId": "0192...", "createdByUserId": "0192...",
"dueAt": "2026-10-14T09:00:00Z", "doneAt": null, "outcome": null, "createdAt": "2026-10-13T08:00:00Z",
"checkInAt": "2026-10-14T09:12:00Z", "checkInLat": 30.044420, "checkInLng": 31.235712, "checkInAccuracy": 18, "checkOutAt": null
}
checkIn…: a visit or meeting checked into from the phone app (the "I'm here" button): the time, the place in degrees, and how sure the phone was in meters (null when it didn't say); checkOutAt when the rep ends the visit, which also marks it done (doneAt). These are read-only in /api/v1: checking in and out is done from the phone app only, there is no API endpoint for it. They are null when nobody checked in.
Quotes have no endpoints in /api/v1: they are made in the portal, and your system hears of them through the crm.quote.created and crm.quote.updated events.
Events
crm.contact.created | A new contact from the portal or the API (one made by a message arrives with social.message.received). |
crm.contact.updated | A contact changed; change says what happened: edited, stage, follow_up (a follow-up was set), follow_up_due (a follow-up came due on a contact with no conversation), merged (another contact merged into it, with mergedContactId), imported (updated from a file), deal_won (one of their deals was won, with dealId), owner (moved to another owner), reactivate (a customer gone quiet got the "reactivate" tag), web_form (sent the website form), lead_ad (filled a Facebook lead form; adId and adTitle are on the contact). A new contact from the website form or a lead form arrives as crm.contact.created followed by crm.contact.updated with web_form or lead_ad. |
crm.account.created | A new account. |
crm.account.updated | An account was edited. |
crm.deal.created | A new deal for a contact: its title, value and currency, its stage (stageKind: open, won, lost) and its chance. |
crm.deal.updated | A deal edited or moved (change: edited, stage, won, lost, reopened). A lost one carries lostReason: price, competitor, not_now, no_response, not_a_fit, other. And change = stalled from the "stuck deal" rule (each morning): an open deal that hasn't moved or had anything done on it, with days = how long it has sat in its stage. |
crm.activity.created | A new activity on a contact: kind (call, meeting, visit, task, note), and for a call that happened its outcome (answered, no_answer, busy, wrong_number). One with dueAt and no doneAt is still to do. When a rule made it, it carries rule: quote (follow up on a quote), after_sale (the after-sale call), neglected (a neglected customer), stalled (a stuck deal), web_form or lead_ad (the note holding the request and the "get in touch" call). One made by hand or through the API has no rule. |
crm.activity.updated | An activity changed (change): done, rescheduled, due (its time came and it isn't done; not sent for a visit already checked into), checked_in (the rep checked in from the phone), checked_out (the rep ended the visit, followed straight away by done). |
crm.activity.deleted | An activity was deleted (activityId, contactId). |
crm.quote.created | A new quote for a deal: lines, tax, total and publicToken (the customer's link /q/{publicToken} on the company's address). |
crm.quote.updated | A quote edited, sent or answered by the customer (change: edited, sent, accepted, declined). Accepting wins the deal for the quote's total. |
crm.lead.received | Someone filled a lead form: an ad's (source: lead_ad, from Facebook, TikTok or Snapchat) or the website's (source: website). Carries the contact, the ad, the form's answers (details) and a leadId. |
crm.ticket.created | A new ticket (the tickets add-on): its number, the contact, its kind (repair, complaint, question, other), priority (low, normal, high, urgent) and dueAt. |
crm.ticket.updated | A ticket edited or moved (change: edited, status, resolved, closed, reopened). status: open, in_progress, waiting_customer, resolved, closed. |
crm.deal.deleted | A deal was deleted (dealId, contactId). |
Each event's data holds the whole object in the API's shape (contact, account, deal, activity or quote), with change, rule or days beside it when they apply:
{ "contact": { ... }, "change": "lead_ad" }
{ "deal": { ... }, "change": "stalled", "days": 12 }
{ "activity": { ... }, "rule": "neglected" }
{ "activity": { ... }, "change": "checked_in" }