Skip to content

Patient-driven pre-visit

Endpoint: POST /v1/sessions/previsit/patient

Use this when you want the patient to fill in their history before they arrive. You send the session_url to them via SMS, WhatsApp, or your app’s notification.

Terminal window
curl -X POST https://api.snowmed.io/v1/sessions/previsit/patient \
-H "Authorization: Bearer sn_live_your_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: appt-12345-previsit" \
-d '{
"patient": { "name": "Priya S", "phone": "+919876543210" },
"clinic": { "doctor": "Dr. Padmavathi", "display_name": "Sunrise Clinic" }
}'
{
"id": "ses_01hwxyz...",
"session_url": "https://previsit.summary.to/Dr.Padmavathi/abc123xyz",
"type": "pre-consult",
"ui_type": "patient",
"expires_at": "2026-05-12T12:00:00Z",
"created_at": "2026-05-12T10:00:00Z"
}

Send session_url to the patient. When they submit, you receive a session.completed webhook.

For antenatal care, add template_code:

{
"template_code": "previsit_anc_v1",
"patient": { "name": "Priya S", "phone": "+919876543210" },
"clinic": { "doctor": "Dr. Padmavathi", "display_name": "Sunrise Clinic" }
}
FieldRequiredNotes
patient.nameRecommendedShown on the form intro screen
patient.phoneRecommendedPre-fills phone field
clinic.doctorRecommendedShown on form + used in the share URL
template_codeNoOmit for general OPD
appointment_idNoYour ID, stored for correlation, returned in webhooks
expires_in_minutesNoDefault 120; max 10080 (7 days)
languageNoDefault en; also hi, ta, te
metadataNoArbitrary key-value pairs echoed in webhooks

Always pass Idempotency-Key. If your server crashes after sending the request but before reading the response, retrying with the same key returns the original session — no duplicate created.

Recommended key pattern: {your-appointment-id}-previsit