curl --request POST \
--url https://api.decodahealth.com/ai/patient/qa \
--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>",
"content": "<string>"
}
],
"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>"
}
},
"question": "<string>",
"patientId": "<string>",
"modelName": "gemini-2.5-flash-lite",
"useStructuredOutput": false,
"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>"
}
],
"chatId": "<string>",
"threadId": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Answer questions about a patient. Automatically saves chat history after streaming completes.
curl --request POST \
--url https://api.decodahealth.com/ai/patient/qa \
--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>",
"content": "<string>"
}
],
"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>"
}
},
"question": "<string>",
"patientId": "<string>",
"modelName": "gemini-2.5-flash-lite",
"useStructuredOutput": false,
"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>"
}
],
"chatId": "<string>",
"threadId": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}The tenant you are making this request on behalf of
Your api key
Request schema for answering patient questions.
Patient context from frontend
Show child attributes
Question to answer
Patient ID
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
Chat history ID (generated on frontend)
Thread ID for conversation grouping
Successful Response