Webhook visit.message.created

New message on the visit thread

Part of the Visit Messages API. This event is sent to your configured webhook URL — there is nothing to call.

Fires for every new message on the visit, in either direction — patient messages sent through this API and provider replies sent from the VSee Clinic dashboard. Filter on data.actor_type if you only want one side.

The payload is a thin pointer: it deliberately carries no message content and no PHI. Treat it as a signal to fetch, then read the thread with GET /api/visits/{visit_id}/messages.

Delivery

Configure the destination URL per clinic account in Admin settings. There is no signature header — restrict your endpoint by network or use an unguessable path.

BehaviourContract
AcknowledgementReturn any 2xx within 30 seconds
RetriesUp to 5 attempts, roughly 60 seconds apart
De-duplicationRetries repeat a delivery — de-duplicate on data.message_id
OrderingNot guaranteed; use data.ts to order
LatencySeconds for messages sent through this API, up to ~2 minutes for provider replies

Handling

1. Acknowledge immediately — do the work after responding, not before.

2. Skip the event if you have already seen its data.message_id.

3. Call GET /api/visits/{visit_id}/messages?skip=<count you hold> to pull only what is new.

Payload (application/json)

FieldTypeDescription
id requiredstringUnique id for this delivery. Changes on each retry — do not de-duplicate on it.
type requiredstringEvent name (one of: visit.message.created)
created requiredintegerUNIX timestamp when the event was emitted
account_code requiredstringClinic account the visit belongs to
version requiredstringPayload version
data requiredobjectPointer to the new message. Carries no message content or PHI.
data.visit_id requiredstringVisit whose message thread changed
data.message_id requiredstringThe new message. De-duplicate on this — retries repeat a delivery.
data.actor_type requiredstringWho sent the message (one of: patient, provider)
data.ts requiredintegerUNIX timestamp when the message was created

Example delivery

{
  "id": "6a47ea02-4809-4af6-b8f6-c56bc2bd2adb",
  "type": "visit.message.created",
  "created": 1786755119,
  "account_code": "aubrey",
  "version": "1.0",
  "data": {
    "visit_id": "1000021648",
    "message_id": "83c3b3d7-346c-4ac9-8276-f96ac8356e25",
    "actor_type": "provider",
    "ts": 1786755119
  }
}