User Preferences
Update user personalization preferences for clinical note generation
curl --request PATCH \
--url https://sdp.suki.ai/api/v1/user/preferences \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/user/preferences"
payload = { "personalization_preference": {
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE"
}
],
"verbosity": "CONCISE"
} }
headers = {
"sdp_suki_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {sdp_suki_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
personalization_preference: {section_format: [{loinc: '10164-2', style: 'NARRATIVE'}], verbosity: 'CONCISE'}
})
};
fetch('https://sdp.suki.ai/api/v1/user/preferences', 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/user/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'personalization_preference' => [
'section_format' => [
[
'loinc' => '10164-2',
'style' => 'NARRATIVE'
]
],
'verbosity' => 'CONCISE'
]
]),
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/user/preferences"
payload := strings.NewReader("{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sdp.suki.ai/api/v1/user/preferences")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/user/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["sdp_suki_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}"
response = http.request(request)
puts response.read_body{
"preference": {
"personalization_preference": {
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE"
}
],
"verbosity": "CONCISE"
}
}
}{
"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"
}PATCH request, you only need to send the fields you want to change./end endpoint).This ensures the user’s preferences are applied before content is generated. However, you can call this endpoint at any time to update the settings.Code examples
- Python
- TypeScript
import requests
url = "https://sdp.suki-stage.com/api/v1/user/preferences"
headers = {
"sdp_suki_token": "<sdp_suki_token>",
"sdp_provider_id": "<sdp_provider_id>",
"Content-Type": "application/json"
}
payload = {
"personalization_preference": {
"verbosity": "CONCISE", # Options: CONCISE, BALANCED, DETAILED
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE" # Options: NARRATIVE, BULLETED
}
]
}
}
response = requests.patch(url, json=payload, headers=headers)
if response.status_code == 200:
data = response.json()
print("Preferences updated successfully")
print(f"Updated preferences: {data}")
else:
print(f"Failed to update preferences: {response.status_code}")
print(response.json())
const response = await fetch('https://sdp.suki-stage.com/api/v1/user/preferences', {
method: 'PATCH',
headers: {
'sdp_suki_token': '<sdp_suki_token>',
'sdp_provider_id': '<sdp_provider_id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
personalization_preference: {
verbosity: 'CONCISE', // Options: CONCISE, BALANCED, DETAILED
section_format: [
{
loinc: '10164-2',
style: 'NARRATIVE' // Options: NARRATIVE, BULLETED
}
]
}
})
});
if (response.ok) {
const data = await response.json();
console.log('Preferences updated successfully');
console.log('Updated preferences:', data);
} else {
const error = await response.json();
console.error(`Failed to update preferences: ${response.status}`, error);
}
Authorizations
Suki access token for the authenticated provider. Obtain this by calling Login or Register with a valid partner_token. Pass the suki_token value from the JSON response as the sdp_suki_token header on REST requests and non-browser WebSocket upgrades. Browser WebSocket clients pass the token in Sec-WebSocket-Protocol instead. Tokens expire after one hour; call Login again to refresh.
Headers
Optional - Stable identifier for the active provider. Omit for standard partners whose partner_token identifies the user. Required for Bearer partners and Single Auth Token authentication where multiple providers share one partner_token. Use the same provider_id you sent on Login or Register.
"provider-123"
Body
Personalization settings to create or update for the authenticated user.
Optional - Personalization settings such as note verbosity and section format.
Show child attributes
Show child attributes
Response
Request succeeded.
Response body for the /user/preferences endpoint
Updated user preference settings
Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://sdp.suki.ai/api/v1/user/preferences \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/user/preferences"
payload = { "personalization_preference": {
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE"
}
],
"verbosity": "CONCISE"
} }
headers = {
"sdp_suki_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {sdp_suki_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
personalization_preference: {section_format: [{loinc: '10164-2', style: 'NARRATIVE'}], verbosity: 'CONCISE'}
})
};
fetch('https://sdp.suki.ai/api/v1/user/preferences', 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/user/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'personalization_preference' => [
'section_format' => [
[
'loinc' => '10164-2',
'style' => 'NARRATIVE'
]
],
'verbosity' => 'CONCISE'
]
]),
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/user/preferences"
payload := strings.NewReader("{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sdp.suki.ai/api/v1/user/preferences")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/user/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["sdp_suki_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personalization_preference\": {\n \"section_format\": [\n {\n \"loinc\": \"10164-2\",\n \"style\": \"NARRATIVE\"\n }\n ],\n \"verbosity\": \"CONCISE\"\n }\n}"
response = http.request(request)
puts response.read_body{
"preference": {
"personalization_preference": {
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE"
}
],
"verbosity": "CONCISE"
}
}
}{
"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"
}