Ambient Session Management
End Ambient Session
Complete Ambient session and trigger clinical note generation
Listen to this pageabout 1 min
POST
/
api
/
v1
/
ambient
/
session
/
{ambient_session_id}
/
end
cURL
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/end \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end"
headers = {"sdp_suki_token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {sdp_suki_token: '<api-key>'}};
fetch('https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end', 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}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("sdp_suki_token", "<api-key>")
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}/end")
.header("sdp_suki_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["sdp_suki_token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}Use this endpoint to end an and trigger the generation process.
Ending an ambient session closes that recording so Suki can process it. It does not close the patient . Create another ambient session for the same encounter when the visit needs more capture.
If you get a
skipped status, it means that the note was not generated because the conversation was empty or the session was too short.-
When building the Stop Ambient flow, send
RU9G, end the session, and then poll for the final status. For guidance on what your UI should show at each step, see End the ambient recording. - For a request-level example of ending an Ambient session after streaming, refer to End Ambient after streaming guide.
Code examples
- Python
- TypeScript
import requests
ambient_session_id = "123dfg-456dfg-789dfg-012dfg"
url = f"https://sdp.suki-stage.com/api/v1/ambient/session/{ambient_session_id}/end"
headers = {
"sdp_suki_token": "<sdp_suki_token>",
"sdp_provider_id": "<sdp_provider_id>"
}
response = requests.post(url, headers=headers)
if response.status_code == 200:
print("Session ended successfully. Clinical note generation triggered.")
else:
print(f"Failed to end session: {response.status_code}")
print(response.json())
const ambientSessionId = '123dfg-456dfg-789dfg-012dfg';
const response = await fetch(
`https://sdp.suki-stage.com/api/v1/ambient/session/${ambientSessionId}/end`,
{
method: 'POST',
headers: {
'sdp_suki_token': '<sdp_suki_token>',
'sdp_provider_id': '<sdp_provider_id>'
}
}
);
if (response.ok) {
console.log('Session ended successfully. Clinical note generation triggered.');
} else {
const error = await response.json();
console.error(`Failed to end session: ${response.status}`, error);
}
Authorizations
Headers
Path Parameters
Response
Request succeeded.
Last modified on November 5, 2026
Was this page helpful?
cURL
curl --request POST \
--url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/end \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end"
headers = {"sdp_suki_token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {sdp_suki_token: '<api-key>'}};
fetch('https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end', 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}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("sdp_suki_token", "<api-key>")
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}/end")
.header("sdp_suki_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["sdp_suki_token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}