curl --request POST \
--url https://api.decodahealth.com/ai/patient/summary \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"context": {
"patient": {
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"gender": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"createdDate": "<string>"
},
"upcomingAppointments": [
{
"title": "<string>",
"start": "<string>",
"id": "<string>",
"status": "<string>",
"providerName": "<string>"
}
],
"recentAppointments": [
{
"title": "<string>",
"start": "<string>",
"id": "<string>",
"status": "<string>",
"providerName": "<string>"
}
],
"recentNotes": [
{
"createdDate": "<string>",
"summary": "<string>",
"answers": [],
"questions": []
}
],
"measurements": [
{
"measurementDate": "<string>",
"weight": 123,
"height": 123,
"systolicBp": 123,
"diastolicBp": 123,
"pulse": 123,
"temperature": 123,
"waistCircumference": 123
}
],
"medications": [
{
"name": "<string>",
"amount": 123,
"unit": "<string>",
"frequency": "<string>",
"quantity": 123,
"comment": "<string>",
"administrationLocation": "<string>"
}
],
"recentCharges": [
{
"id": "<string>",
"total": 123,
"totalOutstanding": 123,
"status": "<string>",
"description": "<string>",
"createdDate": "<string>",
"items": [
{
"quantity": 123,
"price": 123,
"name": "<string>",
"description": "<string>",
"discountAmount": 123
}
],
"payments": [
{}
]
}
],
"recentForms": [
{
"submissionDate": "<string>",
"isCompleted": true,
"name": "<string>"
}
],
"quickNotes": [
{
"note": "<string>",
"createdDate": "<string>",
"eventId": "<string>"
}
],
"tenant": {
"name": "<string>",
"clinicType": "DEFAULT",
"timezone": "<string>"
}
},
"modelName": "gemini-2.5-flash-lite",
"useStructuredOutput": true,
"conversationHistory": [
{
"role": "user",
"content": "<string>",
"timestamp": "<string>",
"files": [
{
"name": "<string>",
"size": 123,
"type": "<string>",
"data": "<string>"
}
]
}
],
"files": [
{
"name": "<string>",
"size": 123,
"type": "<string>",
"data": "<string>"
}
]
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Generate patient summary with guaranteed valid JSON output.
Uses Gemini’s native structured output streaming with json_repair fallback and automatic retry on failure to ensure valid JSON is always returned. Citation references are validated against the patient context.
curl --request POST \
--url https://api.decodahealth.com/ai/patient/summary \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"context": {
"patient": {
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"gender": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"createdDate": "<string>"
},
"upcomingAppointments": [
{
"title": "<string>",
"start": "<string>",
"id": "<string>",
"status": "<string>",
"providerName": "<string>"
}
],
"recentAppointments": [
{
"title": "<string>",
"start": "<string>",
"id": "<string>",
"status": "<string>",
"providerName": "<string>"
}
],
"recentNotes": [
{
"createdDate": "<string>",
"summary": "<string>",
"answers": [],
"questions": []
}
],
"measurements": [
{
"measurementDate": "<string>",
"weight": 123,
"height": 123,
"systolicBp": 123,
"diastolicBp": 123,
"pulse": 123,
"temperature": 123,
"waistCircumference": 123
}
],
"medications": [
{
"name": "<string>",
"amount": 123,
"unit": "<string>",
"frequency": "<string>",
"quantity": 123,
"comment": "<string>",
"administrationLocation": "<string>"
}
],
"recentCharges": [
{
"id": "<string>",
"total": 123,
"totalOutstanding": 123,
"status": "<string>",
"description": "<string>",
"createdDate": "<string>",
"items": [
{
"quantity": 123,
"price": 123,
"name": "<string>",
"description": "<string>",
"discountAmount": 123
}
],
"payments": [
{}
]
}
],
"recentForms": [
{
"submissionDate": "<string>",
"isCompleted": true,
"name": "<string>"
}
],
"quickNotes": [
{
"note": "<string>",
"createdDate": "<string>",
"eventId": "<string>"
}
],
"tenant": {
"name": "<string>",
"clinicType": "DEFAULT",
"timezone": "<string>"
}
},
"modelName": "gemini-2.5-flash-lite",
"useStructuredOutput": true,
"conversationHistory": [
{
"role": "user",
"content": "<string>",
"timestamp": "<string>",
"files": [
{
"name": "<string>",
"size": 123,
"type": "<string>",
"data": "<string>"
}
]
}
],
"files": [
{
"name": "<string>",
"size": 123,
"type": "<string>",
"data": "<string>"
}
]
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}The tenant you are making this request on behalf of
Your api key
Request schema for generating patient summary.
Patient context from frontend
Show child attributes
Model to use for generation
Whether to request structured JSON output
Previous conversation messages for context
Show child attributes
File attachments for the current request
Show child attributes
Successful Response