List older messages
Keyset pagination walking backwards from `before`; items are ascending within the page.
Loading the API reference…
Create a lead from a conversation POST
Creates a patient and a journey for the chosen treatment and links this unlinked conversation to both, in one step; the creator takes the chat when their role can hold chats. Phone and email are optional here: the conversation is the way to reach this person. Needs conversation:update, patient:create and journey:create. 402 LEAD_LIMIT_REACHED on a full free plan; 409 CONVERSATION_ALREADY_LINKED when the conversation is linked, CONTACT_PARTY_SUBJECT_CONFLICT when its contact already represents a patient — link that patient instead; and DUPLICATE_CONTACT when the email or mobile already belongs to a patient — link them instead.
Send a message (or add an internal note) POST
Sends through the endpoint named by endpointId (required unless type=note). subjectPatientId identifies which represented patient a message concerns, must belong to that contact, and is required when the contact represents more than one patient (409 CONTACT_PARTY_SUBJECT_REQUIRED). Returns the queued row synchronously for optimistic UI; delivery progresses via WebSocket message.updated events. Notes are never sent to the patient. Sends respect per-channel opt-outs (403 OPTED_OUT), the WhatsApp 24h window (400 WHATSAPP_WINDOW_CLOSED — retry with a template), the Messenger/Instagram 24h and TikTok 48h reply windows (400 REPLY_WINDOW_CLOSED; a person replying from the Smileline app or mobile app may answer on Messenger/Instagram up to 7 days after the last inbound once Meta approved the Human Agent feature — API-key and OAuth sends never get that extension), and the 1 MiB patient-bearing metadata ceiling (413 MESSAGE_CONTENT_METADATA_TOO_LARGE).