Create Ambient Session
Initialize a new Ambient session for patient encounter documentation
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/create \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>' \
--data '{
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"encounter_id": "123dfg-456dfg-789dfg-012dfg"
}'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/create"
payload = {
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"emr_encounter_id": "123dfg-456dfg-789dfg-012dfg",
"encounter_id": "123dfg-456dfg-789dfg-012dfg"
}
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({
ambient_session_id: '123dfg-456dfg-789dfg-012dfg',
emr_encounter_id: '123dfg-456dfg-789dfg-012dfg',
encounter_id: '123dfg-456dfg-789dfg-012dfg'
})
};
fetch('https://sdp.suki.ai/api/v1/ambient/session/create', 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/create",
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([
'ambient_session_id' => '123dfg-456dfg-789dfg-012dfg',
'emr_encounter_id' => '123dfg-456dfg-789dfg-012dfg',
'encounter_id' => '123dfg-456dfg-789dfg-012dfg'
]),
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/create"
payload := strings.NewReader("{\n \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\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/create")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/create")
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 \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\n}"
response = http.request(request)
puts response.read_body{
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"note_id": "123dfg-456dfg-789dfg-012dfg"
}{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 500,
"message": "internal server error"
}- Multiple input types: You can now generate a clinical note from live audio, a pre-recorded WAV file, or a completed transcript. Set the input type when you create the session. See Session input types, Get audio file upload URL, and Submit transcript input for details.
- Note identifier in the create response: The response now returns
note_id. Use this identifier with note-level Ambient APIs and save it for subsequent re-ambient workflows.composition_idis deprecated but remains available for backward compatibility. It returns the same value asnote_id. - E/M Coding: You can now request E/M codes for an ambient visit. Pass
artifacts: ["EM_CODES"], provide the patient and visit details in session context, and retrieve the recommended codes after the session completes. See E/M Coding.
ambient_session_id: Identifies the individual ambient session. Use it for session-level operations such as setting context, streaming audio, checking processing status, and retrieving session content.note_id: Identifies the clinical note associated with the session. Save this value and use it as the path parameter when calling note-level Ambient APIs.
Use the note identifier
Store thenote_id returned by the create response. Pass it as the path parameter when retrieving note content, context, or structured data.
| API | Purpose |
|---|---|
| Get note content | Retrieve the clinical note content. |
| Get note context | Retrieve the context associated with the note. |
| Get note structured data | Retrieve the note’s structured data. |
composition_id is deprecated. It returns the same value as note_id and remains available so existing integrations that read composition_id continue to work. Use note_id in new integrations.- To design your ambient workflow, handle identifiers, and provide the fields required for interoperability, refer to Create an ambient session.
- To choose when to use live audio, a WAV upload, or completed transcript text, refer to Session input types.
Request body fields
All request body fields are optional. You can create an ambient session with an empty JSON body. If you do not provideambient_session_id, Suki generates one and returns it in the response.
If you omit input_type, the session defaults to stream, which uses live WebSocket audio.
Use the following fields to configure the session, associate it with a patient visit, choose how to provide the conversation, or request additional outputs.
| Field | Type | Details |
|---|---|---|
ambient_session_id | string (UUID or non-UUID, up to 36 characters) | Optional Identifies the ambient session. If you provide a value, Suki uses it as the session ID. If omitted, Suki generates the ID and returns it in the response. |
input_type | string (stream, audio_file, or transcript) | Optional Specifies how the conversation is provided to the session. Omit this field or set it to stream for live WebSocket audio, then explicitly end the session. Set it to audio_file to upload one WAV file using Get audio file upload URL. Set it to transcript to submit completed transcript text using Submit transcript input. Send input_type in the JSON request body only. Query parameters are ignored. The input type cannot be changed after the session is created. |
emr_encounter_id | string (UUID or non-UUID, up to 36 characters) | Optional Identifies the patient visit in the partner’s EMR or EHR. Use this identifier to associate ambient sessions across modalities with the same patient visit for interoperability. |
encounter_id | string (up to 255 characters) | Optional Groups ambient sessions that belong to the same clinical note for re-ambient workflows. Provide this value when creating the first session and reuse it when creating subsequent sessions for the same note. If you did not provide it during the first create request, use the returned note_id as the encounter_id in subsequent requests. This field is not returned in the create response. There is no separate note_id request field. See How re-ambient works. |
artifacts | array of strings | Optional Specifies additional outputs to generate with the clinical note. Pass ["EM_CODES"] to request E/M Coding for the visit. EM_CODES is currently the only supported value. Provide patient and visit details in session context, then retrieve the recommended codes from structured data or the Session E/M codes endpoint. |
Choose an input type
Setinput_type based on how you provide the conversation to Suki. Each input type determines how Suki receives the data, when processing starts, and whether you need to explicitly end the session.
input_type | What you provide | When processing starts | Do you need to end the session? |
|---|---|---|---|
stream (default) | Live audio through the Audio streaming endpoint. | After you call End ambient session. | Yes. |
audio_file | One WAV file uploaded using a Presigned upload URL. | After the file is successfully uploaded through a PUT request. | No. |
transcript | Completed transcript text submitted through the Transcript input endpoint. | After the transcript is successfully submitted. | No. |
Retrieve session results
Once processing starts, the remaining workflow is the same for all three input types:- Check processing status by polling the status endpoint or receiving a webhook.
- Retrieve the clinical note content, transcript, and structured data.
- For
streamandaudio_file, you can retrieve the recording. - For
transcript, recording retrieval returns 404 because the session was created from transcript text rather than an audio recording.
How re-ambient works
Re-ambient lets you create a new ambient session that continues an existing clinical note instead of creating a new note. To associate the new session with the existing note, pass the appropriate identifier in theencounter_id field when creating the re-ambient session.
Choose the identifier for re-ambient
The Create ambient session request does not have a separatenote_id field for re-ambient. Instead, use encounter_id to identify the note that the new session should continue.
The value you provide depends on whether you included encounter_id when creating the original ambient session.
| Original Create ambient session request | Value to pass in encounter_id for re-ambient |
|---|---|
Included encounter_id | Reuse the same encounter_id value. |
Did not include encounter_id | Use the note_id returned in the original create response. |
- Use
encounter_idin the re-ambient create request. Choose its value based on how you created the original session. - Save the
note_idreturned by the create response. It identifies the clinical note and is also the path parameter for note-level Ambient APIs.
Recording and request timing
Keep the following requirements in mind when creating ambient sessions:- Minimum recording duration: Record for at least 1 minute. Shorter recordings may not contain enough information to create a clinical note, and Suki may skip note generation.
- Cross-modality interoperability: To continue the same note across modalities, reuse the existing
emr_encounter_idwhen creating the session. It accepts a UUID or non-UUID value of up to 36 characters. - Delay between create requests: Wait at least 1 second between create requests that share the same
emr_encounter_id. Concurrent or back-to-back requests may return a conflict.
Code examples
- Python
- TypeScript
import json
import requests
BASE_URL = "https://sdp.suki.ai"
CREATE_SESSION_URL = f"{BASE_URL}/api/v1/ambient/session/create"
# 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. Omit a field by leaving the value as None.
# All request body fields are optional. Suki generates values you omit.
# Optional body fields: ambient_session_id, input_type, emr_encounter_id, encounter_id, artifacts.
# Pass emr_encounter_id for cross-modality Ambient interoperability.
# input_type: omit or "stream" (live audio), "audio_file" (WAV upload), or "transcript".
ambient_session_id = None # Optional UUID for this Ambient session
input_type = None # Optional: "stream", "audio_file", or "transcript"
emr_encounter_id = None # EMR encounter id (UUID or non-UUID, at most 36 characters)
encounter_id = None # Optional; reuse later for re-ambient
artifacts = None # Optional: e.g. ["EM_CODES"] for E/M Coding
headers = {
"sdp_suki_token": sdp_suki_token,
"sdp_provider_id": sdp_provider_id,
"Content-Type": "application/json",
}
payload = {}
if ambient_session_id:
payload["ambient_session_id"] = ambient_session_id
if input_type:
payload["input_type"] = input_type
if emr_encounter_id:
payload["emr_encounter_id"] = emr_encounter_id
if encounter_id:
payload["encounter_id"] = encounter_id
if artifacts:
payload["artifacts"] = artifacts
response = requests.post(
CREATE_SESSION_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 == 201:
created_ambient_session_id = response_body["ambient_session_id"]
note_id = response_body["note_id"]
print("ambient_session_id:", created_ambient_session_id)
print("note_id:", note_id)
print(
"Use ambient_session_id for session APIs "
"(context, status, content; stream, file-upload, or transcript-input by input_type)."
)
print(
"Use note_id for note-level Ambient APIs "
"(note content, note context, note structured data)."
)
else:
print("Create Ambient session 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";
const CREATE_SESSION_URL = `${BASE_URL}/api/v1/ambient/session/create`;
// 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. Omit a field by leaving the value undefined.
// All request body fields are optional. Suki generates values you omit.
// Optional body fields: ambient_session_id, input_type, emr_encounter_id, encounter_id, artifacts.
// Pass emr_encounter_id for cross-modality Ambient interoperability.
// input_type: omit or "stream" (live audio), "audio_file" (WAV upload), or "transcript".
const ambientSessionId: string | undefined = undefined; // Optional UUID for this Ambient session
const inputType: "stream" | "audio_file" | "transcript" | undefined = undefined;
const emrEncounterId: string | undefined = undefined; // EMR encounter id (UUID or non-UUID, at most 36 characters)
const encounterId: string | undefined = undefined; // Optional; reuse later for re-ambient
const artifacts: string[] | undefined = undefined; // Optional: e.g. ["EM_CODES"] for E/M Coding
type CreateAmbientSessionRequest = {
ambient_session_id?: string;
input_type?: "stream" | "audio_file" | "transcript";
emr_encounter_id?: string;
encounter_id?: string;
artifacts?: string[];
};
type CreateAmbientSessionResponse = {
ambient_session_id: string;
note_id: string;
};
type ApiErrorResponse = {
code?: number;
message?: string;
};
const payload: CreateAmbientSessionRequest = {};
if (ambientSessionId) {
payload.ambient_session_id = ambientSessionId;
}
if (inputType) {
payload.input_type = inputType;
}
if (emrEncounterId) {
payload.emr_encounter_id = emrEncounterId;
}
if (encounterId) {
payload.encounter_id = encounterId;
}
if (artifacts) {
payload.artifacts = artifacts;
}
const response = await fetch(CREATE_SESSION_URL, {
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: CreateAmbientSessionResponse | ApiErrorResponse | unknown;
try {
responseBody = responseText ? JSON.parse(responseText) : {};
} catch {
console.error("Response was not JSON:");
console.error(responseText);
throw new Error("Create Ambient session returned non-JSON response");
}
console.log("HTTP status:", response.status);
console.log("Response body:", JSON.stringify(responseBody, null, 2));
if (response.status === 201) {
const session = responseBody as CreateAmbientSessionResponse;
console.log("ambient_session_id:", session.ambient_session_id);
console.log("note_id:", session.note_id);
console.log(
"Use ambient_session_id for session APIs (context, status, content; stream, file-upload, or transcript-input by input_type)."
);
console.log(
"Use note_id for note-level Ambient APIs (note content, note context, note structured data)."
);
} else {
const error = responseBody as ApiErrorResponse;
console.error("Create Ambient session failed.");
console.error("code:", error.code);
console.error("message:", error.message);
}
Endpoint reference
Authorizations
Headers
Body
Session identifiers for Ambient session create. Pass emr_encounter_id for cross-modality interoperability and encounter_id to group re-ambient sessions for one note. If the first create omitted encounter_id, pass the returned note_id as the encounter_id value on later creates.
Optional for standalone sessions - Visit interop key for interoperability. Accepts a UUID or non-UUID value, at most 36 characters. One EMR encounter can contain multiple notes. Required for cross-modality Ambient workflows.
36"123dfg-456dfg-789dfg-012dfg"
Optional - Groups re-ambient sessions for one note. Pass it on the first session and reuse the same value on later creates. If the first create omitted it, pass the returned note_id as this field's value for re-ambient. There is no separate note_id request field. Up to 255 characters. Create does not return this field.
"123dfg-456dfg-789dfg-012dfg"
Optional - How you send visit content into this session. Omit or set stream for live WebSocket audio (default). Set audio_file to upload one pre-recorded WAV. Set transcript to submit finished transcript text. Send this field in the JSON body only. Query params are ignored. Fixed for the life of the session.
stream, audio_file, transcript "stream"
Response
Resource created successfully.
Identifiers returned after Ambient session create.
ID of the clinical note for this session. Use it as the note_id path parameter on note-level Ambient APIs (note content, note context, note structured data). If the first create omitted encounter_id, pass this value as the encounter_id field on later creates to re-ambient the same note.
"123dfg-456dfg-789dfg-012dfg"
Was this page helpful?
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/create \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>' \
--data '{
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"encounter_id": "123dfg-456dfg-789dfg-012dfg"
}'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/create"
payload = {
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"emr_encounter_id": "123dfg-456dfg-789dfg-012dfg",
"encounter_id": "123dfg-456dfg-789dfg-012dfg"
}
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({
ambient_session_id: '123dfg-456dfg-789dfg-012dfg',
emr_encounter_id: '123dfg-456dfg-789dfg-012dfg',
encounter_id: '123dfg-456dfg-789dfg-012dfg'
})
};
fetch('https://sdp.suki.ai/api/v1/ambient/session/create', 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/create",
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([
'ambient_session_id' => '123dfg-456dfg-789dfg-012dfg',
'emr_encounter_id' => '123dfg-456dfg-789dfg-012dfg',
'encounter_id' => '123dfg-456dfg-789dfg-012dfg'
]),
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/create"
payload := strings.NewReader("{\n \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\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/create")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/create")
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 \"ambient_session_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"emr_encounter_id\": \"123dfg-456dfg-789dfg-012dfg\",\n \"encounter_id\": \"123dfg-456dfg-789dfg-012dfg\"\n}"
response = http.request(request)
puts response.read_body{
"ambient_session_id": "123dfg-456dfg-789dfg-012dfg",
"note_id": "123dfg-456dfg-789dfg-012dfg"
}{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 500,
"message": "internal server error"
}