Patient messages
Read the messages your practice has sent to, or received from, its patients.
- Two levels of access.
read_messagesreturns a message's metadata. Its subject and body needread_message_contentas well, because recorded content can contain patient links and personal information. Existing keys don't gain either scope automatically. - Patient messages only. A message is included when it belongs to your practice, its patient does too, and it was addressed to the patient (
recipient_scopeispatient). A message about a patient that wasn't sent to them is not included, nor are internal notifications, drafts, or rows with an unknown status. - Channels:
email,sms,pushandapp. Notes, calls and other channels aren't covered yet. - Metadata is identity, patient, channel, direction, status and delivery code, whether there are attachments, and the created, updated, occurred, sent, failed, read and retracted times. It never includes the body, subject, addresses, phone numbers, failure detail, provider ids, status history or attachment paths.
- A delivery code is what the provider reported. It isn't proof of delivery, of the recipient's identity, or of clinical review. An attachment flag doesn't mean the attachment can be fetched through this API.
- Retracted messages stay in the list, but their content is unavailable.
Listing
Filters: patient_id, channel_type, direction, status, plus limit (default 20, max 100) and offset (max 100,000). An empty, repeated or unsupported parameter returns 422; a patient_id you can't see returns 404. Newest first (created_at, then id). See Pagination for what live paging means during concurrent changes.
Reading content
GET /messages/{id}/content returns { id, patient_id, available, content? }.
- Sent messages (sent, delivered, read, opened or bounced) return the copy as sent:
sent_htmlasformat: htmlwhen it was recorded, otherwisesent_bodyasformat: native. The draft is never substituted for what was sent. - Received messages return the recorded body and subject as
format: native. That doesn't establish who sent it, and the source may not be plain text. - No copy returns
available: falsewith a reason:not_recorded,not_sent_or_received(still queued, sending or failed) orretracted. An empty recorded copy comes back empty. - HTML is returned as stored, not sanitised. Apply your own safe-rendering policy before displaying it.
- Size: content over 1 MiB of body or 4,096 bytes of subject is refused rather than truncated.
- Responses carry
Cache-Control: no-store.
Sending, retrying, drafts, marking as read and fetching attachments are not part of this API.
/messagesList messages addressed to permitted patientsread_messagesGET/messages/{id}Get authorised patient message metadataread_messagesGET/messages/{id}/contentGet recorded sent or received message contentread_messagesread_message_content/messagesScoperead_messagesList messages addressed to permitted patients
Requires live read_messages. Applies recipient_scope=patient; rows merely about a patient but addressed internally are excluded. Drafts, unknown statuses and channels outside email/sms/push/app are excluded. Native workflow and delivery state are preserved without inferring successful delivery or verified identity. No bodies, subjects or raw addresses. Sort: created_at DESC NULLS LAST, id DESC. Unsupported, empty and repeated query parameters are rejected. Retracted metadata is retained.
Query
limitintegeroffsetintegerpatient_iduuidchannel_typestringdirectionstringstatusstringResponses
Bounded metadata page with Cache-Control no-store
Missing live message metadata authority
Patient or message not available
Invalid query
Message read failed
/messages/{id}Scoperead_messagesGet authorised patient message metadata
Requires read_messages. Accepts no query parameters; content requires a separate grant and endpoint.
Path
iduuidrequiredResponses
Message metadata with Cache-Control no-store
Missing live message metadata authority
Message not available
Invalid identifier or query
Message read failed
/messages/{id}/contentScoperead_messagesread_message_contentGet recorded sent or received message content
Requires BOTH read_messages and read_message_content on a live key. Accepts no query parameters. Prefers recorded sent_html, otherwise reports the native sent_body representation without substituting a current draft. Inbound received rows preserve recorded source content without a verified-sender claim. Missing, pending, failed and retracted copies are explicitly unavailable. Body responses are capped at 1 MiB UTF-8 bytes and subjects at 4096 bytes. HTML is a stored representation, not newly sanitised; native content does not imply a plaintext format. Attachments and sending are separate operations.
Path
iduuidrequiredResponses
Recorded-copy availability with Cache-Control no-store
One or both explicit message grants missing
Message not available
Invalid identifier or query
Content read failed or recorded copy exceeds limits
