Guides
Results
The transcript with speakers and timestamps, the clinical summary, decision support and diagnosis code suggestions.
A completed session has one result. For an intake interview it contains the transcript, a clinical summary, decision support and diagnosis code suggestions. For an ambient session it contains the transcript and the clinical note.
Fetching a result
Fetch the result from your server, with a key that has the records:read scope, after you receive session.completed. Use the session id from the verified event, branch on mode, and write the result to your protected record store rather than printing it.
curl "https://api.aimedintake.com/v1/sessions/$SESSION_ID/result" \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY"import os
import requests
API = "https://api.aimedintake.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['AIMEDINTAKE_API_KEY']}"}
def problem_code(response):
"""The problem code, or the HTTP status when the body is not a problem document."""
try:
return response.json()["code"]
except (ValueError, KeyError, TypeError):
return f"http_{response.status_code}"
def store_result(session_id):
"""Call with the session id from a verified session.completed event."""
response = requests.get(f"{API}/sessions/{session_id}/result", headers=HEADERS, timeout=30)
if response.status_code == 410:
return # deleted or purged before it was fetched: there is nothing to store
if not response.ok:
raise RuntimeError(f"No result: {problem_code(response)}")
result = response.json()
# Write to your protected record store. Never print or log clinical output.
if result["mode"] == "ambient":
records.save_note(session_id, result["ambient_note"], result["transcript"])
else:
records.save_intake(
session_id,
summary=result["summary"]["text"],
decision_support=(result["decision_support"] or {}).get("text"),
code_suggestions=result["code_suggestions"],
transcript=result["transcript"],
)const API = 'https://api.aimedintake.com/v1';
const headers = {
Authorization: `Bearer ${process.env.AIMEDINTAKE_API_KEY}`,
'Content-Type': 'application/json',
};
/** The problem code, or the HTTP status when the body is not a problem document. */
async function problemCode(response: Response): Promise<string> {
try {
return (await response.json()).code ?? `http_${response.status}`;
} catch {
return `http_${response.status}`;
}
}
/** Call with the session id from a verified session.completed event. */
async function storeResult(sessionId: string): Promise<void> {
const response = await fetch(`${API}/sessions/${sessionId}/result`, { headers });
if (response.status === 410) return; // deleted or purged before it was fetched: nothing to store
if (!response.ok) throw new Error(`No result: ${await problemCode(response)}`);
const result = await response.json();
// Write to your protected record store. Never print or log clinical output.
if (result.mode === 'ambient') {
await records.saveNote(sessionId, result.ambient_note, result.transcript);
} else {
await records.saveIntake(sessionId, {
summary: result.summary.text,
decisionSupport: result.decision_support?.text ?? null,
codeSuggestions: result.code_suggestions,
transcript: result.transcript,
});
}
}{
"session": "ses_01JDK8Z3Q4",
"status": "completed",
"mode": "intake",
"language": "en",
"generated_at": "2027-01-12T13:09:40Z",
"transcript_source": "client",
"transcript": [
{
"id": "utt_0001",
"seq": 1,
"speaker": "assistant",
"text": "Hello, I am Ana, an AI assistant with your care team. I would like to ask a few questions before your visit. Is that okay?",
"start_ms": 0,
"end_ms": 6200
},
{
"id": "utt_0002",
"seq": 2,
"speaker": "patient",
"text": "Yes, that is fine.",
"start_ms": 6900,
"end_ms": 8100
},
{
"id": "utt_0003",
"seq": 3,
"speaker": "assistant",
"text": "Thank you. What brings you in today?",
"start_ms": 8600,
"end_ms": 10900
},
{
"id": "utt_0004",
"seq": 4,
"speaker": "patient",
"text": "I have had a tight feeling in my chest since yesterday evening, mostly when I climb stairs.",
"start_ms": 11800,
"end_ms": 17400
}
],
"summary": {
"text": "**Chief complaint:** Chest tightness since yesterday evening.\n\n**History:** Exertional, mostly on climbing stairs. No further history was collected."
},
"decision_support": {
"text": "**Considerations for the clinician:** Exertional chest tightness of recent onset warrants prompt assessment, including an ECG."
},
"code_suggestions": [
{
"system": "icd10cm",
"code": "R07.89",
"display": "Other chest pain",
"score": 0.84
},
{
"system": "icd10cm",
"code": "R07.9",
"display": "Chest pain, unspecified",
"score": 0.82
}
],
"ambient_note": null,
"model_ids": {
"summary": "summary-2026-10",
"analysis": "analysis-2026-10"
},
"pipeline_version": "2026.11.2"
}The result is generated once and does not change. Fetch it, store what you need, and read from your own copy afterwards; the API keeps it only until the session’s purge_at.
Transcript
[
{
"id": "utt_0001",
"seq": 1,
"speaker": "assistant",
"text": "Hello, I am Ana, an AI assistant with your care team. I would like to ask a few questions before your visit. Is that okay?",
"start_ms": 0,
"end_ms": 6200
},
{
"id": "utt_0002",
"seq": 2,
"speaker": "patient",
"text": "Yes, that is fine.",
"start_ms": 6900,
"end_ms": 8100
}
]| Field | Description |
|---|---|
id | Utterance id. Assigned by the API (utt_0001, utt_0002, …) for intake sessions. For ambient sessions these are the ids you submitted. |
seq | Position in spoken order, starting at 1. |
speaker | assistant or patient for intake; clinician, patient or unknown for ambient. |
text | What was said, as submitted. |
start_ms, end_ms | Milliseconds from the start of the call. null when you did not supply them. |
transcript_source is always client: the transcript is the one your client submitted, returned with ids and sequence numbers. Audio is not stored by AI Medical Intake.
Summary
{
"text": "**Chief complaint:** Chest tightness since yesterday evening.\n\n**History:** Exertional, mostly on climbing stairs. No further history was collected."
}summary.text is a clinical summary of the interview, written for the clinician who sees the patient next. It is Markdown, and it is written in English whatever the interview language, so that one clinical team can read every result; the transcript keeps the original language. Render it with a Markdown renderer that escapes raw HTML.
Decision support
{
"text": "**Considerations for the clinician:** Exertional chest tightness of recent onset warrants prompt assessment, including an ECG."
}decision_support.text offers considerations for the clinician, such as points to explore and findings that deserve attention, in Markdown and in English. It is an aid to a qualified professional, never a diagnosis and never shown to the patient.
Decision support is an organization setting. When it is off, the analysis is not run and decision_support is null; write your client to accept that.
Code suggestions
[
{
"system": "icd10cm",
"code": "R07.89",
"display": "Other chest pain",
"score": 0.84
},
{
"system": "icd10cm",
"code": "R07.9",
"display": "Chest pain, unspecified",
"score": 0.82
}
]| Field | Description |
|---|---|
system | The code system. icd10cm (ICD-10-CM). |
code | The code. |
display | The official description of the code. |
score | Relevance to the conversation, from 0 to 1. Higher is closer. Use it to order suggestions, not as a probability. |
Suggestions are ordered best match first and are found by matching the clinical content of the conversation against the full code set. They are candidates for a coder or clinician to accept or reject. The list can be empty when the conversation contains nothing codable.
Provenance
{
"generated_at": "2027-01-12T13:09:40Z",
"model_ids": {
"summary": "summary-2026-10",
"analysis": "analysis-2026-10"
},
"pipeline_version": "2026.11.2"
}Every result records when it was generated, an identifier for the model version behind each part, and the version of the processing pipeline. Treat model_ids values and pipeline_version as opaque strings (the values above are illustrative) and store them with the result, so that you can later show exactly what produced a given piece of text.
When there is no result
The result endpoint answers 200 only for a completed session. Otherwise it returns a problem that tells you why:
| Status | Code | Session status | What to do |
|---|---|---|---|
| 404 | result_not_ready | created or processing | Wait for the webhook. |
| 409 | session_failed | failed | Final. The problem carries error_code. |
| 409 | session_expired | expired | Final. No transcript arrived. |
| 410 | deleted | deleted | You deleted the session. |
| 410 | purged | deleted | The retention period ended. |
| 404 | not_found | No such session in your organization. |
{
"type": "https://aimedintake.com/docs/errors#session_failed",
"title": "Session failed",
"status": 409,
"code": "session_failed",
"detail": "Processing failed and will not be retried.",
"request_id": "req_01JDKD2J5Z",
"error_code": "pipeline_timeout"
}