Seed Ambient Session Context
Provide clinical context and patient information for Ambient session
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/context \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>' \
--data '{
"diagnoses": {
"values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
]
},
"emr": {
"target_emr": "ATHENA"
},
"orders": {
"medication_orders": {
"values": [
{
"dosage": {
"quantity": 1,
"raw_value": "1 tablet",
"unit": "TAB"
},
"drug_name": "Acetaminophen 500mg Tab",
"duration_in_days": 7,
"end_date": "2026-01-08T00:00:00Z",
"format": {
"raw_value": "Tablet"
},
"frequency": {
"raw_value": "once daily",
"structured_value": "ONE_A_DAY"
},
"instructions": "Take with food",
"linked_diagnosis_codes": [
{
"code": "I10",
"type": "ICD10"
}
],
"medication_code": {
"code": "860975",
"type": "RXCUI"
},
"medication_timing": {
"raw_value": "morning",
"structured_value": "IN_THE_MORNING"
},
"metadata": {
"encounter_relation": "CURRENT_ENCOUNTER",
"origin": "SUKI_AMBIENT"
},
"number_of_refills": 3,
"quantity_dispensed": "1 box",
"route": {
"raw_value": "Oral"
},
"start_date": "2026-01-01T00:00:00Z",
"status": "ACTIVE",
"strength": {
"raw_value": "500mg"
}
}
]
}
},
"patient": {
"dob": "2000-01-01",
"sex": "male"
},
"provider": {
"role": "ATTENDING",
"specialty": "CARDIOLOGY"
},
"sections": [
{
"loinc": "10164-2"
}
],
"visit": {
"chief_complaint": "Headache",
"encounter_type": "AMBULATORY",
"reason_for_visit": "Follow-up for migraines",
"visit_type": "ESTABLISHED_PATIENT"
}
}'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context"
payload = {
"diagnoses": { "values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
] },
"emr": { "target_emr": "ATHENA" },
"orders": { "medication_orders": { "values": [
{
"dosage": {
"quantity": 1,
"raw_value": "1 tablet",
"unit": "TAB"
},
"drug_name": "Acetaminophen 500mg Tab",
"duration_in_days": 7,
"end_date": "2026-01-08T00:00:00Z",
"format": { "raw_value": "Tablet" },
"frequency": {
"raw_value": "once daily",
"structured_value": "ONE_A_DAY"
},
"instructions": "Take with food",
"linked_diagnosis_codes": [
{
"code": "I10",
"type": "ICD10"
}
],
"medication_code": {
"code": "860975",
"type": "RXCUI"
},
"medication_timing": {
"raw_value": "morning",
"structured_value": "IN_THE_MORNING"
},
"metadata": {
"encounter_relation": "CURRENT_ENCOUNTER",
"origin": "SUKI_AMBIENT"
},
"number_of_refills": 3,
"quantity_dispensed": "1 box",
"route": { "raw_value": "Oral" },
"start_date": "2026-01-01T00:00:00Z",
"status": "ACTIVE",
"strength": { "raw_value": "500mg" }
}
] } },
"patient": {
"dob": "2000-01-01",
"sex": "male"
},
"provider": {
"role": "ATTENDING",
"specialty": "CARDIOLOGY"
},
"sections": [{ "loinc": "10164-2" }],
"visit": {
"chief_complaint": "Headache",
"encounter_type": "AMBULATORY",
"reason_for_visit": "Follow-up for migraines",
"visit_type": "ESTABLISHED_PATIENT"
}
}
headers = {
"sdp_suki_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {sdp_suki_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
diagnoses: {
values: [
{
codes: [{code: '30422', description: 'Essential hypertension', type: 'IMO'}],
diagnosis_note: 'Hypertension'
}
]
},
emr: {target_emr: 'ATHENA'},
orders: {
medication_orders: {
values: [
{
dosage: {quantity: 1, raw_value: '1 tablet', unit: 'TAB'},
drug_name: 'Acetaminophen 500mg Tab',
duration_in_days: 7,
end_date: '2026-01-08T00:00:00Z',
format: {raw_value: 'Tablet'},
frequency: {raw_value: 'once daily', structured_value: 'ONE_A_DAY'},
instructions: 'Take with food',
linked_diagnosis_codes: [{code: 'I10', type: 'ICD10'}],
medication_code: {code: '860975', type: 'RXCUI'},
medication_timing: {raw_value: 'morning', structured_value: 'IN_THE_MORNING'},
metadata: {encounter_relation: 'CURRENT_ENCOUNTER', origin: 'SUKI_AMBIENT'},
number_of_refills: 3,
quantity_dispensed: '1 box',
route: {raw_value: 'Oral'},
start_date: '2026-01-01T00:00:00Z',
status: 'ACTIVE',
strength: {raw_value: '500mg'}
}
]
}
},
patient: {dob: '2000-01-01', sex: 'male'},
provider: {role: 'ATTENDING', specialty: 'CARDIOLOGY'},
sections: [{loinc: '10164-2'}],
visit: {
chief_complaint: 'Headache',
encounter_type: 'AMBULATORY',
reason_for_visit: 'Follow-up for migraines',
visit_type: 'ESTABLISHED_PATIENT'
}
})
};
fetch('https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'diagnoses' => [
'values' => [
[
'codes' => [
[
'code' => '30422',
'description' => 'Essential hypertension',
'type' => 'IMO'
]
],
'diagnosis_note' => 'Hypertension'
]
]
],
'emr' => [
'target_emr' => 'ATHENA'
],
'orders' => [
'medication_orders' => [
'values' => [
[
'dosage' => [
'quantity' => 1,
'raw_value' => '1 tablet',
'unit' => 'TAB'
],
'drug_name' => 'Acetaminophen 500mg Tab',
'duration_in_days' => 7,
'end_date' => '2026-01-08T00:00:00Z',
'format' => [
'raw_value' => 'Tablet'
],
'frequency' => [
'raw_value' => 'once daily',
'structured_value' => 'ONE_A_DAY'
],
'instructions' => 'Take with food',
'linked_diagnosis_codes' => [
[
'code' => 'I10',
'type' => 'ICD10'
]
],
'medication_code' => [
'code' => '860975',
'type' => 'RXCUI'
],
'medication_timing' => [
'raw_value' => 'morning',
'structured_value' => 'IN_THE_MORNING'
],
'metadata' => [
'encounter_relation' => 'CURRENT_ENCOUNTER',
'origin' => 'SUKI_AMBIENT'
],
'number_of_refills' => 3,
'quantity_dispensed' => '1 box',
'route' => [
'raw_value' => 'Oral'
],
'start_date' => '2026-01-01T00:00:00Z',
'status' => 'ACTIVE',
'strength' => [
'raw_value' => '500mg'
]
]
]
]
],
'patient' => [
'dob' => '2000-01-01',
'sex' => 'male'
],
'provider' => [
'role' => 'ATTENDING',
'specialty' => 'CARDIOLOGY'
],
'sections' => [
[
'loinc' => '10164-2'
]
],
'visit' => [
'chief_complaint' => 'Headache',
'encounter_type' => 'AMBULATORY',
'reason_for_visit' => 'Follow-up for migraines',
'visit_type' => 'ESTABLISHED_PATIENT'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"sdp_suki_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context"
payload := strings.NewReader("{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("sdp_suki_token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["sdp_suki_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}patient_id, name, dob, and sex. Web SDK needs these fields to show the patient profile. Refer to Use ambient across modalities for more details.- details (e.g., specialty and role).
- Patient and visit information.
- A list of codes for the clinical sections you want to generate.
- Existing with their associated medical codes.
- EMR context, including target EMR, when you need EMR-specific behavior (for example order submission rules).
- Orders context (medication orders), including structured medication orders for active medications and related metadata.
Codes section to provide additional context for a session, such as medical codes for a diagnosis.Field validation and constraints
-
Character Limits: Ensure the
chief_complaintandreason_for_visitfields do not exceed 255 characters. -
Enumerated Values: Use only the predefined string values for
visit_type,encounter_type, andprovider_role. -
EMR Selection: You must set
emr.target_emrto one of the following:ATHENA,EPIC, orCERNER.
Medication order requirements
When you sendorders.medication_orders.values, include the following required properties for each object:
- Drug Information: Provide both the
drug_nameand amedication_code. - Coding Systems: For
medication_code, specify thecodeand set thetypetoRXCUIorNDC. - Order Status: Set the
statustoACTIVE,DISCONTINUED, orREFILLED. - Metadata: Include the
metadataobject with a requiredoriginofEMRorSUKI_AMBIENT.
origin to EMR, you must also set metadata.encounter_relation to either CURRENT_ENCOUNTER or PRIOR_ENCOUNTER.linked_diagnosis_codes match a diagnosis already provided in the diagnoses section.
Use the same coding system for both to allow the service to validate the link.Code examples
- Python
- TypeScript
import json
import requests
BASE_URL = "https://sdp.suki.ai"
# From Create Ambient Session response
ambient_session_id = "<ambient_session_id>"
# Get sdp_suki_token from Login: POST /api/v1/auth/login
sdp_suki_token = "<sdp_suki_token>"
# Required for single_auth partners
sdp_provider_id = "<sdp_provider_id>"
# Set these from your system
patient_id = "<patient_id>"
patient_given_name = "<patient_given_name>"
patient_family_name = "<patient_family_name>"
patient_dob = "<patient_dob>" # YYYY-MM-DD
patient_sex = "<patient_sex>" # male | female | other | unknown
provider_specialty = "<provider_specialty>"
provider_role = "<provider_role>"
chief_complaint = "<chief_complaint>"
reason_for_visit = "<reason_for_visit>"
encounter_type = "<encounter_type>"
visit_type = "<visit_type>"
section_loinc_codes = ["<loinc_code>"]
diagnosis_code = "<diagnosis_code>"
diagnosis_code_type = "<diagnosis_code_type>" # for example ICD10
diagnosis_description = "<diagnosis_description>"
diagnosis_note = "<diagnosis_note>"
target_emr = "<target_emr>" # ATHENA | EPIC | CERNER
drug_name = "<drug_name>"
medication_code = "<medication_code>"
medication_code_type = "<medication_code_type>" # RXCUI | NDC
medication_status = "<medication_status>" # ACTIVE | DISCONTINUED | REFILLED
medication_origin = "<medication_origin>" # EMR | SUKI_AMBIENT
medication_instructions = "<medication_instructions>"
url = f"{BASE_URL}/api/v1/ambient/session/{ambient_session_id}/context"
headers = {
"sdp_suki_token": sdp_suki_token,
"sdp_provider_id": sdp_provider_id,
"Content-Type": "application/json",
}
payload = {
"provider": {
"specialty": provider_specialty,
"provider_role": provider_role,
},
"patient": {
"patient_id": patient_id,
"name": {
"given": [patient_given_name],
"family": patient_family_name,
},
"dob": patient_dob,
"sex": patient_sex,
},
"visit": {
"chief_complaint": chief_complaint,
"encounter_type": encounter_type,
"reason_for_visit": reason_for_visit,
"visit_type": visit_type,
},
"sections": [{"loinc": loinc} for loinc in section_loinc_codes],
"diagnoses": {
"values": [
{
"codes": [
{
"code": diagnosis_code,
"description": diagnosis_description,
"type": diagnosis_code_type,
}
],
"diagnosis_note": diagnosis_note,
}
]
},
"emr": {
"target_emr": target_emr,
},
"orders": {
"medication_orders": {
"values": [
{
"drug_name": drug_name,
"medication_code": {
"code": medication_code,
"type": medication_code_type,
},
"linked_diagnosis_codes": [
{
"code": diagnosis_code,
"type": diagnosis_code_type,
}
],
"metadata": {
"origin": medication_origin,
},
"status": medication_status,
"instructions": medication_instructions,
}
]
}
},
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print("HTTP status:", response.status_code)
try:
response_body = response.json()
except ValueError:
print("Response was not JSON:")
print(response.text)
raise SystemExit(1)
print("Response body:")
print(json.dumps(response_body, indent=2))
if response.status_code == 200:
print("Context seeded successfully.")
else:
print("Seed Ambient session context failed.")
if isinstance(response_body, dict):
print("code:", response_body.get("code"))
print("message:", response_body.get("message"))
const BASE_URL = "https://sdp.suki.ai";
// From Create Ambient Session response
const ambientSessionId = "<ambient_session_id>";
// Get sdp_suki_token from Login: POST /api/v1/auth/login
const sdpSukiToken = "<sdp_suki_token>";
// Required for single_auth partners
const sdpProviderId = "<sdp_provider_id>";
// Set these from your system
const patientId = "<patient_id>";
const patientGivenName = "<patient_given_name>";
const patientFamilyName = "<patient_family_name>";
const patientDob = "<patient_dob>"; // YYYY-MM-DD
const patientSex = "<patient_sex>"; // male | female | other | unknown
const providerSpecialty = "<provider_specialty>";
const providerRole = "<provider_role>";
const chiefComplaint = "<chief_complaint>";
const reasonForVisit = "<reason_for_visit>";
const encounterType = "<encounter_type>";
const visitType = "<visit_type>";
const sectionLoincCodes = ["<loinc_code>"];
const diagnosisCode = "<diagnosis_code>";
const diagnosisCodeType = "<diagnosis_code_type>"; // for example ICD10
const diagnosisDescription = "<diagnosis_description>";
const diagnosisNote = "<diagnosis_note>";
const targetEmr = "<target_emr>"; // ATHENA | EPIC | CERNER
const drugName = "<drug_name>";
const medicationCode = "<medication_code>";
const medicationCodeType = "<medication_code_type>"; // RXCUI | NDC
const medicationStatus = "<medication_status>"; // ACTIVE | DISCONTINUED | REFILLED
const medicationOrigin = "<medication_origin>"; // EMR | SUKI_AMBIENT
const medicationInstructions = "<medication_instructions>";
type ApiErrorResponse = {
code?: number;
message?: string;
};
const payload = {
provider: {
specialty: providerSpecialty,
provider_role: providerRole,
},
patient: {
patient_id: patientId,
name: {
given: [patientGivenName],
family: patientFamilyName,
},
dob: patientDob,
sex: patientSex,
},
visit: {
chief_complaint: chiefComplaint,
encounter_type: encounterType,
reason_for_visit: reasonForVisit,
visit_type: visitType,
},
sections: sectionLoincCodes.map((loinc) => ({ loinc })),
diagnoses: {
values: [
{
codes: [
{
code: diagnosisCode,
description: diagnosisDescription,
type: diagnosisCodeType,
},
],
diagnosis_note: diagnosisNote,
},
],
},
emr: {
target_emr: targetEmr,
},
orders: {
medication_orders: {
values: [
{
drug_name: drugName,
medication_code: {
code: medicationCode,
type: medicationCodeType,
},
linked_diagnosis_codes: [
{
code: diagnosisCode,
type: diagnosisCodeType,
},
],
metadata: {
origin: medicationOrigin,
},
status: medicationStatus,
instructions: medicationInstructions,
},
],
},
},
};
const response = await fetch(
`${BASE_URL}/api/v1/ambient/session/${ambientSessionId}/context`,
{
method: "POST",
headers: {
sdp_suki_token: sdpSukiToken,
sdp_provider_id: sdpProviderId,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
const responseText = await response.text();
let responseBody: ApiErrorResponse | Record<string, unknown> | unknown;
try {
responseBody = responseText ? JSON.parse(responseText) : {};
} catch {
console.error("Response was not JSON:");
console.error(responseText);
throw new Error("Seed Ambient session context returned non-JSON response");
}
console.log("HTTP status:", response.status);
console.log("Response body:", JSON.stringify(responseBody, null, 2));
if (response.status === 200) {
console.log("Context seeded successfully.");
} else {
const error = responseBody as ApiErrorResponse;
console.error("Seed Ambient session context failed.");
console.error("code:", error.code);
console.error("message:", error.message);
}
Authorizations
Suki access token (suki_token) from Login or Register. Expires after one hour.
Headers
Optional for standard partners.
Required for:
- Bearer authentication. Use the same
provider_idreturned by the Login or Register API. - Single Auth Token authentication. Include the same
provider_idon every request assdp_provider_id.
"provider-123"
Path Parameters
UUID for the ambient session. Use the ambient_session_id returned from Create Ambient Session, or the UUID you supplied in that request.
Body
Clinical context for the ambient session, including provider, patient, visit, sections, diagnoses, EMR, and medication orders.
Optional - Existing diagnoses and coded values to include in note generation.
Show child attributes
Show child attributes
Optional - EMR context, including the target EMR system.
Show child attributes
Show child attributes
Optional - Medication orders and related order context.
Show child attributes
Show child attributes
Optional - Patient demographics such as date of birth and sex.
Show child attributes
Show child attributes
Optional - Provider role and specialty for the session.
Show child attributes
Show child attributes
Optional - Information about the sections to be generated. If not provided, all supported note-sections will be generated.
Show child attributes
Show child attributes
Optional - Visit details such as chief complaint and encounter type.
Show child attributes
Show child attributes
Response
Was this page helpful?
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/context \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>' \
--data '{
"diagnoses": {
"values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
]
},
"emr": {
"target_emr": "ATHENA"
},
"orders": {
"medication_orders": {
"values": [
{
"dosage": {
"quantity": 1,
"raw_value": "1 tablet",
"unit": "TAB"
},
"drug_name": "Acetaminophen 500mg Tab",
"duration_in_days": 7,
"end_date": "2026-01-08T00:00:00Z",
"format": {
"raw_value": "Tablet"
},
"frequency": {
"raw_value": "once daily",
"structured_value": "ONE_A_DAY"
},
"instructions": "Take with food",
"linked_diagnosis_codes": [
{
"code": "I10",
"type": "ICD10"
}
],
"medication_code": {
"code": "860975",
"type": "RXCUI"
},
"medication_timing": {
"raw_value": "morning",
"structured_value": "IN_THE_MORNING"
},
"metadata": {
"encounter_relation": "CURRENT_ENCOUNTER",
"origin": "SUKI_AMBIENT"
},
"number_of_refills": 3,
"quantity_dispensed": "1 box",
"route": {
"raw_value": "Oral"
},
"start_date": "2026-01-01T00:00:00Z",
"status": "ACTIVE",
"strength": {
"raw_value": "500mg"
}
}
]
}
},
"patient": {
"dob": "2000-01-01",
"sex": "male"
},
"provider": {
"role": "ATTENDING",
"specialty": "CARDIOLOGY"
},
"sections": [
{
"loinc": "10164-2"
}
],
"visit": {
"chief_complaint": "Headache",
"encounter_type": "AMBULATORY",
"reason_for_visit": "Follow-up for migraines",
"visit_type": "ESTABLISHED_PATIENT"
}
}'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context"
payload = {
"diagnoses": { "values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
] },
"emr": { "target_emr": "ATHENA" },
"orders": { "medication_orders": { "values": [
{
"dosage": {
"quantity": 1,
"raw_value": "1 tablet",
"unit": "TAB"
},
"drug_name": "Acetaminophen 500mg Tab",
"duration_in_days": 7,
"end_date": "2026-01-08T00:00:00Z",
"format": { "raw_value": "Tablet" },
"frequency": {
"raw_value": "once daily",
"structured_value": "ONE_A_DAY"
},
"instructions": "Take with food",
"linked_diagnosis_codes": [
{
"code": "I10",
"type": "ICD10"
}
],
"medication_code": {
"code": "860975",
"type": "RXCUI"
},
"medication_timing": {
"raw_value": "morning",
"structured_value": "IN_THE_MORNING"
},
"metadata": {
"encounter_relation": "CURRENT_ENCOUNTER",
"origin": "SUKI_AMBIENT"
},
"number_of_refills": 3,
"quantity_dispensed": "1 box",
"route": { "raw_value": "Oral" },
"start_date": "2026-01-01T00:00:00Z",
"status": "ACTIVE",
"strength": { "raw_value": "500mg" }
}
] } },
"patient": {
"dob": "2000-01-01",
"sex": "male"
},
"provider": {
"role": "ATTENDING",
"specialty": "CARDIOLOGY"
},
"sections": [{ "loinc": "10164-2" }],
"visit": {
"chief_complaint": "Headache",
"encounter_type": "AMBULATORY",
"reason_for_visit": "Follow-up for migraines",
"visit_type": "ESTABLISHED_PATIENT"
}
}
headers = {
"sdp_suki_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {sdp_suki_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
diagnoses: {
values: [
{
codes: [{code: '30422', description: 'Essential hypertension', type: 'IMO'}],
diagnosis_note: 'Hypertension'
}
]
},
emr: {target_emr: 'ATHENA'},
orders: {
medication_orders: {
values: [
{
dosage: {quantity: 1, raw_value: '1 tablet', unit: 'TAB'},
drug_name: 'Acetaminophen 500mg Tab',
duration_in_days: 7,
end_date: '2026-01-08T00:00:00Z',
format: {raw_value: 'Tablet'},
frequency: {raw_value: 'once daily', structured_value: 'ONE_A_DAY'},
instructions: 'Take with food',
linked_diagnosis_codes: [{code: 'I10', type: 'ICD10'}],
medication_code: {code: '860975', type: 'RXCUI'},
medication_timing: {raw_value: 'morning', structured_value: 'IN_THE_MORNING'},
metadata: {encounter_relation: 'CURRENT_ENCOUNTER', origin: 'SUKI_AMBIENT'},
number_of_refills: 3,
quantity_dispensed: '1 box',
route: {raw_value: 'Oral'},
start_date: '2026-01-01T00:00:00Z',
status: 'ACTIVE',
strength: {raw_value: '500mg'}
}
]
}
},
patient: {dob: '2000-01-01', sex: 'male'},
provider: {role: 'ATTENDING', specialty: 'CARDIOLOGY'},
sections: [{loinc: '10164-2'}],
visit: {
chief_complaint: 'Headache',
encounter_type: 'AMBULATORY',
reason_for_visit: 'Follow-up for migraines',
visit_type: 'ESTABLISHED_PATIENT'
}
})
};
fetch('https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'diagnoses' => [
'values' => [
[
'codes' => [
[
'code' => '30422',
'description' => 'Essential hypertension',
'type' => 'IMO'
]
],
'diagnosis_note' => 'Hypertension'
]
]
],
'emr' => [
'target_emr' => 'ATHENA'
],
'orders' => [
'medication_orders' => [
'values' => [
[
'dosage' => [
'quantity' => 1,
'raw_value' => '1 tablet',
'unit' => 'TAB'
],
'drug_name' => 'Acetaminophen 500mg Tab',
'duration_in_days' => 7,
'end_date' => '2026-01-08T00:00:00Z',
'format' => [
'raw_value' => 'Tablet'
],
'frequency' => [
'raw_value' => 'once daily',
'structured_value' => 'ONE_A_DAY'
],
'instructions' => 'Take with food',
'linked_diagnosis_codes' => [
[
'code' => 'I10',
'type' => 'ICD10'
]
],
'medication_code' => [
'code' => '860975',
'type' => 'RXCUI'
],
'medication_timing' => [
'raw_value' => 'morning',
'structured_value' => 'IN_THE_MORNING'
],
'metadata' => [
'encounter_relation' => 'CURRENT_ENCOUNTER',
'origin' => 'SUKI_AMBIENT'
],
'number_of_refills' => 3,
'quantity_dispensed' => '1 box',
'route' => [
'raw_value' => 'Oral'
],
'start_date' => '2026-01-01T00:00:00Z',
'status' => 'ACTIVE',
'strength' => [
'raw_value' => '500mg'
]
]
]
]
],
'patient' => [
'dob' => '2000-01-01',
'sex' => 'male'
],
'provider' => [
'role' => 'ATTENDING',
'specialty' => 'CARDIOLOGY'
],
'sections' => [
[
'loinc' => '10164-2'
]
],
'visit' => [
'chief_complaint' => 'Headache',
'encounter_type' => 'AMBULATORY',
'reason_for_visit' => 'Follow-up for migraines',
'visit_type' => 'ESTABLISHED_PATIENT'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"sdp_suki_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context"
payload := strings.NewReader("{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("sdp_suki_token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["sdp_suki_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"diagnoses\": {\n \"values\": [\n {\n \"codes\": [\n {\n \"code\": \"30422\",\n \"description\": \"Essential hypertension\",\n \"type\": \"IMO\"\n }\n ],\n \"diagnosis_note\": \"Hypertension\"\n }\n ]\n },\n \"emr\": {\n \"target_emr\": \"ATHENA\"\n },\n \"orders\": {\n \"medication_orders\": {\n \"values\": [\n {\n \"dosage\": {\n \"quantity\": 1,\n \"raw_value\": \"1 tablet\",\n \"unit\": \"TAB\"\n },\n \"drug_name\": \"Acetaminophen 500mg Tab\",\n \"duration_in_days\": 7,\n \"end_date\": \"2026-01-08T00:00:00Z\",\n \"format\": {\n \"raw_value\": \"Tablet\"\n },\n \"frequency\": {\n \"raw_value\": \"once daily\",\n \"structured_value\": \"ONE_A_DAY\"\n },\n \"instructions\": \"Take with food\",\n \"linked_diagnosis_codes\": [\n {\n \"code\": \"I10\",\n \"type\": \"ICD10\"\n }\n ],\n \"medication_code\": {\n \"code\": \"860975\",\n \"type\": \"RXCUI\"\n },\n \"medication_timing\": {\n \"raw_value\": \"morning\",\n \"structured_value\": \"IN_THE_MORNING\"\n },\n \"metadata\": {\n \"encounter_relation\": \"CURRENT_ENCOUNTER\",\n \"origin\": \"SUKI_AMBIENT\"\n },\n \"number_of_refills\": 3,\n \"quantity_dispensed\": \"1 box\",\n \"route\": {\n \"raw_value\": \"Oral\"\n },\n \"start_date\": \"2026-01-01T00:00:00Z\",\n \"status\": \"ACTIVE\",\n \"strength\": {\n \"raw_value\": \"500mg\"\n }\n }\n ]\n }\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"role\": \"ATTENDING\",\n \"specialty\": \"CARDIOLOGY\"\n },\n \"sections\": [\n {\n \"loinc\": \"10164-2\"\n }\n ],\n \"visit\": {\n \"chief_complaint\": \"Headache\",\n \"encounter_type\": \"AMBULATORY\",\n \"reason_for_visit\": \"Follow-up for migraines\",\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n }\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}