Skip to content

Create a session

POST
/v1/sessions

Creates a clinical-summarization session. Powers Flows 2, 3, and 4 depending on which fields you pass:

  • Flow 2 (patient-link with full UX): pass template_code or custom_questions[] — patient gets a hosted URL with iterative Q&A + uploads + voice
  • Flow 3 (direct mode): pass patient, document_ids[], and complete custom_questions[] (with answers) — your backend has the data, no patient UI needed
  • Flow 4 (LLM-driven dynamic): omit template_code and custom_questions[] — LLM generates each next question based on prior answers

Authorizations

Parameters

Header Parameters

Idempotency-Key

Optional UUID to deduplicate retries. 24h TTL.

string format: uuid

Request Body required

object
type
required

Server-side aliases: emergency-summaryemergency, pre-anc-visitpre-consult.

string
Allowed values: pre-consult clinical-note discharge referral transfer medication lab-requisition history international emergency emergency-summary pre-anc-visit pre-visit-clinic care-plan radiology
specialty
string
obstetrics
purpose

Visit purpose (e.g. ‘second-trimester checkup’); biases LLM

string
nullable
language

ISO 639-1 code; supported: en, hi, te, mr

string
en
initiator
string
default: system
Allowed values: patient doctor system
template_code

Pin a specific template; omit for catalog auto-resolve or LLM dynamic

string
nullable
custom_questions

Pre-defined questions; if all have answer, this is Flow 3 direct mode

Array<object>
object
id
string
question
string
answer
string
nullable
patient_id
string format: uuid
nullable
appointment_id
string format: uuid
nullable
patient

Structured patient data for Flow 3 direct mode

object
document_ids
Array<string>
nullable
metadata

Free-form key-value pairs; common keys: source, user_id, urgency, visit_type

object
key
additional properties
any
red_flags

Pre-detected red flags (Flow 3 emergency)

Array<object>
nullable
object
clinic_info
object
expires_in_minutes
integer
default: 60
{
"type": "pre-consult",
"specialty": "obstetrics",
"initiator": "patient",
"template_code": "anc_first_visit",
"patient_id": "c2c5...",
"metadata": {
"source": "preg.care"
}
}

Responses

201

Session created

object
id
string format: uuid
session_id
string format: uuid
token

Opaque public token used in patient-facing URLs

string
type

Server-side aliases: emergency-summaryemergency, pre-anc-visitpre-consult.

string
Allowed values: pre-consult clinical-note discharge referral transfer medication lab-requisition history international emergency emergency-summary pre-anc-visit pre-visit-clinic care-plan radiology
specialty
string
nullable
obstetrics
session_url
string format: uri
https://previsit.summary.to/obstetrics/bRJIY1oc8BgtMCucjWfPJk3P
expires_at
string format: date-time
created_at
string format: date-time
ui_type

Hint for which UI mode the link is intended for

string
Allowed values: patient clinician

400

Validation error

object
error
required
string
Invalid link
code
integer
1003

401

Invalid API key

object
error
required
string
Invalid link
code
integer
1003

409

Idempotency-Key body mismatch

object
error
required
string
Invalid link
code
integer
1003

429

Rate limit / quota exceeded

object
error
required
string
Invalid link
code
integer
1003