API
API reference
Every endpoint, parameter, schema and example of the AI Medical Intake API, generated from the OpenAPI description.
Introduction
The API is organised around sessions. It accepts and returns JSON over HTTPS, authenticates with a bearer key, and reports errors as problem documents with a stable code.
This reference is generated from the OpenAPI 3.1.0 description (Partner API 1.0.0), which you can import into your own tooling. Times are RFC 3339, always in UTC with Z, ids are opaque strings, and clients must ignore fields they do not recognise.
- POST
/v1/sessionsCreate a session - GET
/v1/sessionsList sessions - GET
/v1/sessions/{id}Retrieve a session - DELETE
/v1/sessions/{id}Delete a session - POST
/v1/sessions/{id}/transcriptSubmit the intake transcript - POST
/v1/sessions/{id}/ambient-noteSubmit the visit transcript for an ambient note - GET
/v1/sessions/{id}/resultRetrieve the result - GET
/v1/usageList usage records
https://api.aimedintake.com/v1curl https://api.aimedintake.com/v1/sessions \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY"The session object
A session is one intake interview or one documented visit. Its status moves from created to processing and ends in completed, failed, expired or deleted. See Sessions and call setup.
Attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": "visit-000481",
"status": "completed",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": "2027-01-12T13:09:02Z",
"completed_at": "2027-01-12T13:09:40Z",
"updated_at": "2027-01-12T13:09:40Z",
"purge_at": "2027-02-11T13:09:02Z",
"end_reason": "normal_completion",
"error": null,
"deleted": null
}Create a session
POST/v1/sessions
Creates a session, or returns the existing one for the same external_ref.
The call is idempotent on external_ref. Repeating it while the session is still created reissues fresh credentials and revokes the previous upload token, which covers a lost response or an expired voice secret. In any other status the session is returned without credentials.
AuthorizationSecret key with scope sessions:write
Request body
external_refstringrequiredYour opaque reference, unique per session. It is the idempotency key for this call. Do not put personal data in it.
languageenumrequiredInterview and documentation language. Limited to the languages enabled for your organization.
modeenumDefaults to
intake.device_typeenumDefaults to
other.tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.
Responses
- 200A session with this
external_refalready exists. Credentials are included only while its status iscreated.Response attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
createdbooleantruewhen this call created the session,falsewhen it already existed.voiceobjectoptionalPresent when
modeisintakeandstatusiscreated.Child attributes
providerstringThe realtime voice provider the browser connects to.
ws_urlstringWebSocket URL to open from the browser. The pinned voice model is part of the URL.
client_secretstringShort-lived secret for this one call. Pass it as the WebSocket subprotocol
xai-client-secret.<client_secret>.client_secret_expires_atinteger or nullUnix seconds after which the secret can no longer open a connection, or
nullwhen the provider reports no expiry.session_configobjectThe conversation configuration. Send it to the voice provider unchanged, as described in the browser voice connection guide.
Child attributes
modelstringThe pinned voice model.
instructionsstringThe interview instructions, including your organization's assistant name and additional instructions.
voicestringThe voice used for the session language.
sample_ratenumberPCM16 mono sample rate in both directions.
turn_detectionobjectChild attributes
typestringidle_timeout_msinteger or nullsilence_duration_msintegerSilence that ends a patient turn. Pinned at or below 500 ms, so the silence a client sends when the patient presses Stop mid-sentence is long enough to end the turn.
transcriptionobjectChild attributes
modelstringlanguage_hintstringBCP 47 hint for speech recognition.
keytermsarray of strings
greeting_textstringThe localized opening, which discloses that the assistant is an AI and asks for consent. Speak it first, verbatim.
toolsarray of objectsFunction tools the assistant may call. Contains the
hangUptool that ends the interview.
ambientobjectoptionalPresent when
modeisambientandstatusiscreated.Child attributes
stream_urlstringWebSocket URL for the live visit audio. It carries a ticket in its query string that is bound to this session and expires within 60 seconds. Treat the whole URL as a secret and never log it.
expires_attimestampWhen the ticket in
stream_urlstops opening new connections.
upload_tokenstringoptionalSingle-use token for submitting the transcript, valid until
upload_expires_at. Present whenstatusiscreated. Each call returns a fresh token and revokes the previous one.
- 201A new session was created.
Response attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
createdbooleantruewhen this call created the session,falsewhen it already existed.voiceobjectoptionalPresent when
modeisintakeandstatusiscreated.Child attributes
providerstringThe realtime voice provider the browser connects to.
ws_urlstringWebSocket URL to open from the browser. The pinned voice model is part of the URL.
client_secretstringShort-lived secret for this one call. Pass it as the WebSocket subprotocol
xai-client-secret.<client_secret>.client_secret_expires_atinteger or nullUnix seconds after which the secret can no longer open a connection, or
nullwhen the provider reports no expiry.session_configobjectThe conversation configuration. Send it to the voice provider unchanged, as described in the browser voice connection guide.
Child attributes
modelstringThe pinned voice model.
instructionsstringThe interview instructions, including your organization's assistant name and additional instructions.
voicestringThe voice used for the session language.
sample_ratenumberPCM16 mono sample rate in both directions.
turn_detectionobjectChild attributes
typestringidle_timeout_msinteger or nullsilence_duration_msintegerSilence that ends a patient turn. Pinned at or below 500 ms, so the silence a client sends when the patient presses Stop mid-sentence is long enough to end the turn.
transcriptionobjectChild attributes
modelstringlanguage_hintstringBCP 47 hint for speech recognition.
keytermsarray of strings
greeting_textstringThe localized opening, which discloses that the assistant is an AI and asks for consent. Speak it first, verbatim.
toolsarray of objectsFunction tools the assistant may call. Contains the
hangUptool that ends the interview.
ambientobjectoptionalPresent when
modeisambientandstatusiscreated.Child attributes
stream_urlstringWebSocket URL for the live visit audio. It carries a ticket in its query string that is bound to this session and expires within 60 seconds. Treat the whole URL as a secret and never log it.
expires_attimestampWhen the ticket in
stream_urlstops opening new connections.
upload_tokenstringoptionalSingle-use token for submitting the transcript, valid until
upload_expires_at. Present whenstatusiscreated. Each call returns a fresh token and revokes the previous one.
- 400The body is not valid JSON.
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 409The reference was already used with a different
languageormode. - 413The body is larger than 1 MiB.
- 415The body is not
application/json. - 422The request failed validation, or the language or mode is not enabled for your organization.
- 429The key is over its rate limit.
- 502The voice provider could not issue credentials. Retry the same request.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl https://api.aimedintake.com/v1/sessions \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_ref": "visit-000481",
"language": "en",
"mode": "intake",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
}
}'{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": "visit-000481",
"status": "created",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": null,
"completed_at": null,
"updated_at": "2027-01-12T13:02:11Z",
"purge_at": null,
"end_reason": null,
"error": null,
"deleted": null,
"created": true,
"voice": {
"provider": "xai",
"ws_url": "wss://api.x.ai/v1/realtime?model=grok-voice-3.0",
"client_secret": "xai-realtime-client-secret-EXAMPLE",
"client_secret_expires_at": 1799759231,
"session_config": {
"model": "grok-voice-3.0",
"instructions": "You are Ana, an AI intake assistant for your care team. Ask one question at a time…",
"voice": "eve",
"sample_rate": 24000,
"turn_detection": {
"type": "server_vad",
"idle_timeout_ms": null,
"silence_duration_ms": 500
},
"transcription": {
"model": "grok-transcribe",
"language_hint": "en",
"keyterms": [
"hypertension",
"metformin",
"shortness of breath"
]
},
"greeting_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?",
"tools": [
{
"type": "function",
"name": "hangUp",
"description": "End the interview after the final spoken statement.",
"parameters": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"enum": [
"initial_refusal",
"normal_completion",
"patient_stop",
"emergency"
]
}
},
"required": [
"reason"
],
"additionalProperties": false
}
}
]
}
},
"upload_token": "upl_3kTq8ZxV1mN0pLr7EXAMPLE"
}{
"id": "ses_01JDKB7M2X",
"object": "session",
"external_ref": "visit-000482",
"status": "created",
"mode": "ambient",
"language": "en",
"device_type": "web",
"tags": {},
"created_at": "2027-01-12T14:00:05Z",
"upload_expires_at": "2027-01-13T14:00:05Z",
"accepted_at": null,
"completed_at": null,
"updated_at": "2027-01-12T14:00:05Z",
"purge_at": null,
"end_reason": null,
"error": null,
"deleted": null,
"created": true,
"ambient": {
"stream_url": "wss://api.aimedintake.com/api/ambient/stream?session_id=ambient-01JDKB7M2X&language=en&ticket=EXAMPLE_TICKET",
"expires_at": "2027-01-12T14:01:05Z"
},
"upload_token": "upl_9bWc2HsY6dQ4tGf1EXAMPLE"
}{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": "visit-000481",
"status": "processing",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": "2027-01-12T13:09:02Z",
"completed_at": null,
"updated_at": "2027-01-12T13:09:02Z",
"purge_at": "2027-02-11T13:09:02Z",
"end_reason": "normal_completion",
"error": null,
"deleted": null,
"created": false
}List sessions
GET/v1/sessions
Lists your sessions for dashboards and synchronisation, including tombstones of deleted sessions.
Results are ordered by ascending (updated_at, id). updated_at advances on every change: acceptance, completion, failure, expiry, deletion and purge. A session that changes while you page can appear again, so upsert by id and keep the row with the latest updated_at. Deleted sessions stay listed as tombstones for 90 days.
AuthorizationSecret key with scope records:read
Query parameters
updated_sincetimestampInclusive lower bound on
updated_at.statusarray of stringsReturn only sessions in this status. Repeat the parameter to match several.
external_refstringExact match on your reference. Cannot be combined with
after.limitintegerPage size.
afterstringOpaque cursor taken from
next_cursor. Exclusive, and bound to the filters it was issued with.
Responses
- 200A page of sessions.
Response attributes
dataarray of objectsChild attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
has_morebooleannext_cursorstring or nullPass as
afterto fetch the next page.nullon the last page.
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 422A parameter failed validation, or the cursor was issued for different filters.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl -G https://api.aimedintake.com/v1/sessions \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY" \
-d updated_since=2027-01-12T00:00:00Z \
-d status=completed \
-d status=failed{
"data": [
{
"id": "ses_01JDK9W5RT",
"object": "session",
"external_ref": "visit-000479",
"status": "failed",
"mode": "intake",
"language": "es",
"device_type": "mobile",
"tags": {},
"created_at": "2027-01-12T11:40:00Z",
"upload_expires_at": "2027-01-13T11:40:00Z",
"accepted_at": "2027-01-12T11:52:18Z",
"completed_at": null,
"updated_at": "2027-01-12T12:01:44Z",
"purge_at": "2027-02-11T11:52:18Z",
"end_reason": "disconnected",
"error": {
"code": "pipeline_timeout"
},
"deleted": null
},
{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": "visit-000481",
"status": "completed",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": "2027-01-12T13:09:02Z",
"completed_at": "2027-01-12T13:09:40Z",
"updated_at": "2027-01-12T13:09:40Z",
"purge_at": "2027-02-11T13:09:02Z",
"end_reason": "normal_completion",
"error": null,
"deleted": null
}
],
"has_more": true,
"next_cursor": "eyJ1IjoiMjAyNy0wMS0xMlQxMzowOTo0MFoiLCJpIjoic2VzXzAxSkRLOFozUTQifQ"
}Retrieve a session
GET/v1/sessions/{id}
Returns the session object. Use it to read the current status; fetch the clinical content from the result endpoint.
AuthorizationSecret key with scope records:read
Path parameters
idstringrequiredThe session id.
Responses
- 200The session.
Response attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 404No such session in your organization.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl https://api.aimedintake.com/v1/sessions/ses_01JDK8Z3Q4 \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY"{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": "visit-000481",
"status": "completed",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {
"site": "clinic-03"
},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": "2027-01-12T13:09:02Z",
"completed_at": "2027-01-12T13:09:40Z",
"updated_at": "2027-01-12T13:09:40Z",
"purge_at": "2027-02-11T13:09:02Z",
"end_reason": "normal_completion",
"error": null,
"deleted": null
}{
"id": "ses_01JDK9W5RT",
"object": "session",
"external_ref": "visit-000479",
"status": "failed",
"mode": "intake",
"language": "es",
"device_type": "mobile",
"tags": {},
"created_at": "2027-01-12T11:40:00Z",
"upload_expires_at": "2027-01-13T11:40:00Z",
"accepted_at": "2027-01-12T11:52:18Z",
"completed_at": null,
"updated_at": "2027-01-12T12:01:44Z",
"purge_at": "2027-02-11T11:52:18Z",
"end_reason": "disconnected",
"error": {
"code": "pipeline_timeout"
},
"deleted": null
}Delete a session
DELETE/v1/sessions/{id}
Erases the session's clinical data: the transcript and every result. The reference and tags are cleared and the session becomes a tombstone.
Deletion is idempotent; repeating it returns the same body. It ends any processing in flight, and no result is ever published afterwards. A session.deleted webhook is sent.
AuthorizationSecret key with scope sessions:write
Path parameters
idstringrequiredThe session id.
Responses
- 202The session was deleted.
Response attributes
idstringSession id, prefixed
ses_.objectstringAlways
session.external_refstring or nullYour reference for the session.
nullafter deletion.statusenumLifecycle status of a session.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
device_typeenumWhere the session runs.
tagsmap of stringsUp to 10 key-value pairs for your own filtering and reporting. Keys match
^[a-z0-9_]{1,32}$; values are strings of at most 64 characters. Do not put personal data in tags.created_attimestampWhen the session was created.
upload_expires_attimestampDeadline for submitting the transcript, fixed when the session is created. Reissuing credentials does not extend it. A session with no accepted transcript by then becomes
expired.accepted_attimestamp or nullWhen the transcript was accepted.
nulluntil then.completed_attimestamp or nullWhen the result first became available.
nullif the session never completed. Kept on the tombstone after deletion.updated_attimestampAdvances on every change to the session. The sort key for listing.
purge_attimestamp or nullWhen the clinical data is deleted automatically. Set when the transcript is accepted and present from then on;
nulluntil then. A tombstone keeps this and its other timestamps as they were.end_reasonenum or nullWhy the interview ended. Reported by your client with the transcript and recorded as stated, not verified.
nulluntil a transcript is accepted,nullagain after deletion, and alwaysnullfor ambient sessions. A value such asemergencyis information about the person, so treat it as you treat clinical data.errorobject or nullSet when
statusisfailed, otherwisenull.Child attributes
codeenumWhy a session failed.
deletedobject or nullSet when
statusisdeleted, otherwisenull.Child attributes
attimestampWhen the clinical data was deleted.
reasonenumerasurefor your deletion request,retentionfor the automatic purge.
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 404No such session in your organization.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl -X DELETE https://api.aimedintake.com/v1/sessions/ses_01JDK8Z3Q4 \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY"{
"id": "ses_01JDK8Z3Q4",
"object": "session",
"external_ref": null,
"status": "deleted",
"mode": "intake",
"language": "en",
"device_type": "kiosk",
"tags": {},
"created_at": "2027-01-12T13:02:11Z",
"upload_expires_at": "2027-01-13T13:02:11Z",
"accepted_at": "2027-01-12T13:09:02Z",
"completed_at": "2027-01-12T13:09:40Z",
"updated_at": "2027-01-19T09:15:00Z",
"purge_at": "2027-02-11T13:09:02Z",
"end_reason": null,
"error": null,
"deleted": {
"at": "2027-01-19T09:15:00Z",
"reason": "erasure"
}
}Submit the intake transcript
POST/v1/sessions/{id}/transcript
For mode=intake. Submits the call transcript and starts processing.
Authenticate with your secret key, or with the session's single-use upload token so a kiosk or browser can upload directly. The joined transcript text must be between 10 and 50,000 characters. A session accepts exactly one transcript. Sending the same body again with a secret key returns the original 202 and starts no new job, even after upload_expires_at; a different body returns 409 transcript_already_accepted. The one exception is a deleted session: a valid secret-key replay then returns 409 session_closed, the accepted body included, while the tombstone exists (90 days) and 404 not_found after that, while a consumed upload token still returns 401 invalid_upload_token at authentication. The upload token is consumed on acceptance, so any repeat sent with it returns 401 invalid_upload_token, whatever the body.
Browsers on origins registered for your organization may call this endpoint directly: the API answers the CORS preflight for Authorization and Content-Type, and exposes Retry-After to the page.
AuthorizationSecret key with scope sessions:write, or the session's upload token
Path parameters
idstringrequiredThe session id.
Request body
utterancesarray of objectsrequiredThe conversation in spoken order.
Child attributes
speakerenumrequiredtextstringrequiredWhat was said. Not blank.
start_msinteger or nullMilliseconds from the start of the call.
end_msinteger or nullMilliseconds from the start of the call. Not before
start_ms.
ended_attimestampWhen the call ended.
end_reasonenumWhy the call ended. Send the reason the assistant gave when it ended the interview,
disconnectedwhen the call dropped, orother. Defaults toother. Together with the number of patient utterances it decides whether the session is billable.
Responses
- 202The transcript was accepted and processing has started.
Response attributes
idstringThe session id.
statusstringtranscript_digeststringSHA-256 over the canonical form (RFC 8785) of the request body. Identifies the accepted transcript.
accepted_attimestamp
- 400The body is not valid JSON.
- 401The key is missing or invalid, or the upload token is expired, already used or bound to another session.
- 403The key does not carry the scope this endpoint requires.
- 404No such session in your organization.
- 409A different transcript was already accepted, or the session accepts no further upload (it was deleted, or no transcript was accepted before
upload_expires_at). Branch on the problem code. A 409 whose code cannot be read or is not one of these is final, but says nothing about an earlier upload: keep the body for staff and do not resubmit automatically. - 413The body is larger than 1 MiB.
- 415The body is not
application/json. - 422The transcript failed validation, or the session is not an intake session.
validation_failedtranscript_too_shorttranscript_too_longwrong_mode - 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl https://api.aimedintake.com/v1/sessions/ses_01JDK8Z3Q4/transcript \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"utterances": [
{
"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
},
{
"speaker": "patient",
"text": "Yes, that is fine.",
"start_ms": 6900,
"end_ms": 8100
},
{
"speaker": "assistant",
"text": "Thank you. What brings you in today?",
"start_ms": 8600,
"end_ms": 10900
},
{
"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
}
],
"ended_at": "2027-01-12T13:08:55Z",
"end_reason": "normal_completion"
}'{
"id": "ses_01JDK8Z3Q4",
"status": "processing",
"transcript_digest": "sha256:e94ada0c075c47abfa26f36d58e4b2bbf6e6c0fa225991e3d273fe744359ecdf",
"accepted_at": "2027-01-12T13:09:02Z"
}Submit the visit transcript for an ambient note
POST/v1/sessions/{id}/ambient-note
For mode=ambient. Submits the speaker-labelled visit transcript and starts drafting the clinical note.
Utterance ids are yours: every statement in the note cites ids of utterances that exist in this transcript. Whether a cited utterance supports the statement is for the clinician to assess. Authentication and replay behaviour are the same as for the intake transcript: a same-body repeat returns the original 202 with a secret key unless the session was deleted, and 401 invalid_upload_token with the consumed upload token. The same CORS rule applies.
AuthorizationSecret key with scope sessions:write, or the session's upload token
Path parameters
idstringrequiredThe session id.
Request body
utterancesarray of objectsrequiredChild attributes
idstringrequiredYour id for the utterance, unique within the request. Note statements cite it as evidence.
speakerenumrequiredtextstringrequiredstart_msintegerrequiredend_msintegerrequired
Responses
- 202The transcript was accepted and the note is being drafted.
Response attributes
idstringThe session id.
statusstringtranscript_digeststringSHA-256 over the canonical form (RFC 8785) of the request body. Identifies the accepted transcript.
accepted_attimestamp
- 400The body is not valid JSON.
- 401The key is missing or invalid, or the upload token is expired, already used or bound to another session.
- 403The key does not carry the scope this endpoint requires.
- 404No such session in your organization.
- 409A different transcript was already accepted, or the session accepts no further upload (it was deleted, or no transcript was accepted before
upload_expires_at). Branch on the problem code. A 409 whose code cannot be read or is not one of these is final, but says nothing about an earlier upload: keep the body for staff and do not resubmit automatically. - 413The body is larger than 1 MiB.
- 415The body is not
application/json. - 422The transcript failed validation, or the session is not an ambient session.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl https://api.aimedintake.com/v1/sessions/ses_01JDKB7M2X/ambient-note \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"utterances": [
{
"id": "u1",
"speaker": "clinician",
"text": "What brings you in today?",
"start_ms": 0,
"end_ms": 1800
},
{
"id": "u2",
"speaker": "patient",
"text": "My throat has been sore for three days and I had a fever last night.",
"start_ms": 2300,
"end_ms": 6900
},
{
"id": "u3",
"speaker": "clinician",
"text": "Your temperature is 38.1 and your throat is red with swollen tonsils. I would like to do a rapid strep test.",
"start_ms": 41000,
"end_ms": 48600
}
]
}'{
"id": "ses_01JDKB7M2X",
"status": "processing",
"transcript_digest": "sha256:666f51d50214a51436bbc54ff82be74a4917edb45990c4605f2b11f445dbc81a",
"accepted_at": "2027-01-12T14:21:30Z"
}Retrieve the result
GET/v1/sessions/{id}/result
Returns the result of a completed session: the transcript with speakers and timestamps, the summary, decision support and code suggestions, or the clinical note for an ambient session.
The result exists only while the session is completed. Every other status answers with a problem that says why, so you can branch on code.
AuthorizationSecret key with scope records:read
Path parameters
idstringrequiredThe session id.
Responses
- 200The result.
Response attributes
sessionstringThe session id.
statusstringmodeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.languageenumInterview and documentation language. Limited to the languages enabled for your organization.
generated_attimestampWhen the result was generated.
transcript_sourcestringThe transcript is the one your client submitted.
transcriptarray of objectsThe transcript in spoken order.
Child attributes
idstringUtterance id. Assigned by the API (
utt_…) for intake sessions; your own ids for ambient sessions.seqintegerPosition in spoken order, starting at 1.
speakerenumtextstringstart_msinteger or nullnullwhen not supplied.end_msinteger or nullnullwhen not supplied.
summaryobject or nullThe clinical summary of an intake interview.
nullfor ambient sessions.Child attributes
textstringMarkdown-formatted text, written in English for clinical use.
decision_supportobject or nullConsiderations for the clinician.
nullwhen decision support is turned off for your organization, and for ambient sessions.Child attributes
textstringMarkdown-formatted text, written in English for clinical use.
code_suggestionsarray of objectsSuggested diagnosis codes, best match first. Empty for ambient sessions, whose suggestions are inside
ambient_note.Child attributes
systemenumThe code system.
codestringdisplaystringThe official description of the code.
scorenumberRelevance of the code to the conversation. Higher is closer.
ambient_noteobject or nullThe drafted clinical note.
nullfor intake sessions.Child attributes
subjectivearray of objectsChild attributes
textstringevidencearray of stringsIds of the utterances the statement cites. Never empty.
objectivearray of objectsChild attributes
textstringevidencearray of stringsIds of the utterances the statement cites. Never empty.
assessmentarray of objectsChild attributes
textstringevidencearray of stringsIds of the utterances the statement cites. Never empty.
planarray of objectsChild attributes
textstringevidencearray of stringsIds of the utterances the statement cites. Never empty.
patient_summarystringA plain-language summary of the visit for the patient, in the session language.
code_suggestionsarray of objectsChild attributes
systemenumThe code system.
codestringdisplaystringThe official description of the code.
scorenumberRelevance of the code to the conversation. Higher is closer.
dropped_linesintegerNumber of drafted statements removed because they cited no utterance of the transcript, or stated a number or dose that the cited utterances do not contain.
model_idsmap of stringsOpaque identifiers of the model versions that produced each part of the result, for your audit trail.
pipeline_versionstringOpaque version of the processing pipeline.
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 404The session does not exist, or it has not finished processing yet.
- 409The session failed or expired, so it will never have a result.
- 410The result was removed, by your deletion request or at the end of the retention period.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl https://api.aimedintake.com/v1/sessions/ses_01JDK8Z3Q4/result \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY"{
"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"
}{
"session": "ses_01JDKB7M2X",
"status": "completed",
"mode": "ambient",
"language": "en",
"generated_at": "2027-01-12T14:21:52Z",
"transcript_source": "client",
"transcript": [
{
"id": "u1",
"seq": 1,
"speaker": "clinician",
"text": "What brings you in today?",
"start_ms": 0,
"end_ms": 1800
},
{
"id": "u2",
"seq": 2,
"speaker": "patient",
"text": "My throat has been sore for three days and I had a fever last night.",
"start_ms": 2300,
"end_ms": 6900
},
{
"id": "u3",
"seq": 3,
"speaker": "clinician",
"text": "Your temperature is 38.1 and your throat is red with swollen tonsils. I would like to do a rapid strep test.",
"start_ms": 41000,
"end_ms": 48600
}
],
"summary": null,
"decision_support": null,
"code_suggestions": [],
"ambient_note": {
"subjective": [
{
"text": "Sore throat for three days with fever last night.",
"evidence": [
"u2"
]
}
],
"objective": [
{
"text": "Temperature 38.1 °C. Pharynx erythematous with swollen tonsils.",
"evidence": [
"u3"
]
}
],
"assessment": [
{
"text": "Acute pharyngitis; streptococcal infection to be excluded.",
"evidence": [
"u2",
"u3"
]
}
],
"plan": [
{
"text": "Rapid strep test.",
"evidence": [
"u3"
]
}
],
"patient_summary": "You came in with a sore throat and fever. Your clinician examined your throat and discussed doing a rapid strep test.",
"code_suggestions": [
{
"system": "icd10cm",
"code": "J02.9",
"display": "Acute pharyngitis, unspecified",
"score": 0.86
}
],
"dropped_lines": 0
},
"model_ids": {
"note": "note-2026-10"
},
"pipeline_version": "2026.11.2"
}List usage records
GET/v1/usage
Lists usage records, one per completed session, ordered by (completed_at, session).
from and to form the half-open interval [from, to) on completed_at and may span at most 93 days. Only records with billable: true are charged. An intake session is not billable when its end_reason is initial_refusal or emergency, or patient_stop with fewer than 3 patient utterances; sessions of test organizations are never billable. A completed ambient session is charged only in a live organization. Usage records carry no clinical content and no end reason, and they are kept after the session's clinical data is deleted.
AuthorizationSecret key with scope usage:read
Query parameters
fromtimestamprequiredStart of the interval, inclusive.
totimestamprequiredEnd of the interval, exclusive. At most 93 days after
from.limitintegerPage size.
afterstringOpaque cursor taken from
next_cursor. Exclusive, and bound to thefromandtoit was issued with.
Responses
- 200A page of usage records.
Response attributes
dataarray of objectsChild attributes
idstringUsage record id, prefixed
usg_.sessionstringThe session the record belongs to.
modeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.completed_attimestampunitsobjectUnits of use. One session per record.
Child attributes
sessionsnumber
billablebooleanWhether the session is charged. Only records with
billableset totrueare charged.not_billable_reasonenum or nullWhy the session is not charged;
nullwhen it is billable.ended_earlyapplies to intake only and covers an interview that ended at the consent question, was cut short for an emergency, or was stopped by the patient with fewer than 3 patient utterances. The record does not say which.test_organizationmarks test usage, for both modes.
has_morebooleannext_cursorstring or null
- 401The key is missing, malformed or revoked.
- 403The key does not carry the scope this endpoint requires.
- 422The interval is missing, inverted or longer than 93 days, or the cursor was issued for a different interval.
- 429The key is over its rate limit.
- 5XXAn unexpected failure on our side. Retry with backoff. If the failure happens before the API can answer, the body may not be a problem document.
curl -G https://api.aimedintake.com/v1/usage \
-H "Authorization: Bearer $AIMEDINTAKE_API_KEY" \
-d from=2027-01-01T00:00:00Z \
-d to=2027-02-01T00:00:00Z{
"data": [
{
"id": "usg_01JDKD0TZ7",
"session": "ses_01JDK8Z3Q4",
"mode": "intake",
"completed_at": "2027-01-12T13:09:40Z",
"units": {
"sessions": 1
},
"billable": true,
"not_billable_reason": null
},
{
"id": "usg_01JDKF3N8A",
"session": "ses_01JDKEW1C6",
"mode": "intake",
"completed_at": "2027-01-12T13:41:07Z",
"units": {
"sessions": 1
},
"billable": false,
"not_billable_reason": "ended_early"
},
{
"id": "usg_01JDKG8Q2D",
"session": "ses_01JDKFZ7M9",
"mode": "intake",
"completed_at": "2027-01-12T13:58:22Z",
"units": {
"sessions": 1
},
"billable": false,
"not_billable_reason": "ended_early"
},
{
"id": "usg_01JDKH5T4E",
"session": "ses_01JDKB7M2X",
"mode": "ambient",
"completed_at": "2027-01-12T14:21:52Z",
"units": {
"sessions": 1
},
"billable": true,
"not_billable_reason": null
}
],
"has_more": false,
"next_cursor": null
}{
"data": [
{
"id": "usg_01JDKJ2V6F",
"session": "ses_01JDKHX3N1",
"mode": "intake",
"completed_at": "2027-01-12T15:02:10Z",
"units": {
"sessions": 1
},
"billable": false,
"not_billable_reason": "test_organization"
},
{
"id": "usg_01JDKK7W8G",
"session": "ses_01JDKJR5P3",
"mode": "ambient",
"completed_at": "2027-01-12T15:30:44Z",
"units": {
"sessions": 1
},
"billable": false,
"not_billable_reason": "test_organization"
}
],
"has_more": false,
"next_cursor": null
}Webhook events
Events are sent as a signed POST to your registered HTTPS endpoint. They carry no transcript or result text and no external_ref. See Webhooks for verification and retries.
session.completedSent when the result of a session is available. Fetch it withGET /sessions/{id}/result.session.failedSent when processing has failed for good. A failed session is final.session.deletedSent when a deletion request is accepted. Retention purges send no event.
Headers
webhook-idstringrequiredThe event id. Stable across retries.
webhook-timestampstringrequiredUnix seconds of this delivery attempt.
webhook-signaturestringrequiredOne or more space-separated signatures of the form
v1,<base64>.
Body
idstringEvent id, prefixed
evt_. Equal to thewebhook-idheader.typeenumcreated_attimestampsessionstringThe session the event is about.
dataobjectChild attributes
When status is completed
statusstringmodeenumintakeis a voice intake interview with the patient.ambientdocuments a clinician-patient visit.
When status is failed
statusstringerror_codeenumWhy a session failed.
When status is deleted
statusstringreasonstring
{
"id": "evt_01JDKD0V8N",
"type": "session.completed",
"created_at": "2027-01-12T13:09:41Z",
"session": "ses_01JDK8Z3Q4",
"data": {
"status": "completed",
"mode": "intake"
}
}{
"id": "evt_01JDKA4H6C",
"type": "session.failed",
"created_at": "2027-01-12T12:01:44Z",
"session": "ses_01JDK9W5RT",
"data": {
"status": "failed",
"error_code": "pipeline_timeout"
}
}{
"id": "evt_01JE3QX2P9",
"type": "session.deleted",
"created_at": "2027-01-19T09:15:00Z",
"session": "ses_01JDK8Z3Q4",
"data": {
"status": "deleted",
"reason": "erasure"
}
}