Retrieving consultation data
This guide explains how to retrieve consultation data after a patient has completed an AI-assisted interview. You can access encounter metadata and download PDF reports.
Prerequisites
Before you begin, make sure you have:
- Completed the authentication flow and obtained a valid
id_token - The
readscope granted to your OAuth application - Created an invitation and had a patient complete a consultation (see Generating a consultation link)
Overview
After a patient completes a consultation, you can:
View all consultations for your organization
Retrieve metadata about a specific consultation
Get a PDF summary of the consultation
Understanding encounters
An encounter represents a completed or in-progress patient consultation. Each encounter contains:
| Field | Description |
|---|---|
id |
Unique identifier for the encounter |
type |
The encounter type (currently AI_CONSULTATION) |
status |
Current status: ONGOING, FINISHED, or ABANDONED |
modality |
How the patient interacted: SPEECH or TEXT |
locale |
The language used during the consultation |
createdAt |
Timestamp when the encounter started |
Encounter statuses
ONGOING
The patient is currently in the consultation.
FINISHED
The patient completed all questions.
ABANDONED
The patient left before completing the consultation.
Regardless of the encounter status, you will be able to retrieve the corresponding information. Some information, such as the transcript and report, will be partial while the encounter is still ongoing.
List all encounters
Retrieve all encounters for your organization.
Endpoint
GET https://api.mindoo.ai/encounter
Authorization: Bearer <ID_TOKEN>
Example request
curl -X GET https://api.mindoo.ai/encounter \
-H "Authorization: Bearer <ID_TOKEN>"
Response
[
{
"id": "enc123abc456def789ghi012",
"type": "AI_CONSULTATION",
"status": "FINISHED",
"modality": "SPEECH",
"locale": "en-US",
"createdAt": "2025-01-15T11:00:00.000Z"
},
{
"id": "enc789xyz123abc456def012",
"type": "AI_CONSULTATION",
"status": "ONGOING",
"modality": "TEXT",
"locale": "nl-NL",
"createdAt": "2025-01-15T11:30:00.000Z"
}
]
Get a specific encounter
Retrieve details about a specific encounter using its ID.
Endpoint
GET https://api.mindoo.ai/encounter/{id}
Authorization: Bearer <ID_TOKEN>
Example request
curl -X GET https://api.mindoo.ai/encounter/<ENCOUNTER_ID> \
-H "Authorization: Bearer <ID_TOKEN>"
Response
{
"id": "enc123abc456def789ghi012",
"type": "AI_CONSULTATION",
"status": "FINISHED",
"modality": "SPEECH",
"locale": "en-US",
"createdAt": "2025-01-15T11:00:00.000Z"
}
Finding the encounter ID
There are two ways to find the encounter ID for a consultation:
From the invitation
After a patient starts a consultation, the invitation's encounterId field is populated:
curl -X GET https://api.mindoo.ai/ai-consultation-invitation/<INVITATION_ID> \
-H "Authorization: Bearer <ID_TOKEN>"
Response:
{
"id": "abc123def456ghi789jkl012",
"agentId": "o7v29mgicb8mhhm9k7dw73iq",
"invitationUrl": "https://app.mindoo.ai/consult/abc123def456ghi789jkl012",
"encounterId": "enc123abc456def789ghi012",
"redirectUponCompletionUrl": "https://your-website.com/consultation-complete",
"createdAt": "2025-01-15T10:35:00.000Z"
}
The encounterId is null until the patient opens the invitation link and starts the consultation.
From the encounter list
If you provided an externalId when creating the invitation, you can use it to correlate encounters with your internal records by listing all encounters and matching them.
Download the report
You can download a PDF report summarizing the consultation.
Endpoint
GET https://api.mindoo.ai/report/{id}
Authorization: Bearer <ID_TOKEN>
The {id} parameter is the encounter ID.
Example request
curl -X GET https://api.mindoo.ai/report/<ENCOUNTER_ID> \
-H "Authorization: Bearer <ID_TOKEN>" \
-o report.pdf
Response
The response is a PDF file (application/pdf) containing:
- Patient information (if provided when creating the invitation)
- Summary of the consultation
- Key findings and symptoms reported
- Relevant medical history discussed
Delete an encounter
Remove an encounter and its associated data.
Endpoint
DELETE https://api.mindoo.ai/encounter/{id}
Authorization: Bearer <ID_TOKEN>
Example request
curl -X DELETE https://api.mindoo.ai/encounter/<ENCOUNTER_ID> \
-H "Authorization: Bearer <ID_TOKEN>"
A successful deletion returns a 204 No Content response.
Deleting an encounter permanently removes all associated data, including the report. This action cannot be undone.
Typical integration workflow
Here's a typical workflow for integrating consultation data into your system:
Create an invitation
Create an invitation with an externalId matching your patient record.
Send the invitation link
Share the invitationUrl with the patient via SMS, email, or your portal.
Poll the invitation
Periodically check the invitation to see if encounterId is populated.
Check the encounter status
Poll the encounter until its status changes to FINISHED.
Download the report
Fetch the PDF report and store it in your system.
Clean up (optional)
Delete the invitation and encounter from Mindoo if needed.