E/M Coding Session Management
Generate E/M Codes
Start a standalone E/M coding session from partner-supplied note sections and optional clinical context
Listen to this pageabout 2 min
POST
/
api
/
v1
/
em-codes
Generates E/M codes for a note, outside of an ambient session.
curl --request POST \
--url https://sdp.suki.ai/api/v1/em-codes \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <api-key>' \
--data '
{
"sections": [
{
"content": {
"text": "Patient presents with headache.",
"type": "TEXT"
},
"loinc": "10164-2"
}
],
"diagnoses": {
"values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
]
},
"encounter": {
"csn": "CSN-12345",
"date_of_service": "2026-01-01",
"total_time_minutes": 35,
"visit_type": "ESTABLISHED_PATIENT"
},
"patient": {
"dob": "2000-01-01",
"insurance": {
"coverages": [
{
"eligibility_status": "Eligible",
"insurance_payer_name_raw": "AETNA",
"insurance_product_type_raw": "PPO",
"insurance_type_raw": "Commercial",
"sequence_number": "1"
}
]
},
"mrn": "MRN-12345",
"patient_type": "ESTABLISHED_PATIENT",
"sex": "male"
},
"provider": {
"first_name": "Jane",
"last_name": "Doe",
"npi": "1234567893",
"speciality": "CARDIOLOGY"
}
}
'import requests
url = "https://sdp.suki.ai/api/v1/em-codes"
payload = {
"sections": [
{
"content": {
"text": "Patient presents with headache.",
"type": "TEXT"
},
"loinc": "10164-2"
}
],
"diagnoses": { "values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
] },
"encounter": {
"csn": "CSN-12345",
"date_of_service": "2026-01-01",
"total_time_minutes": 35,
"visit_type": "ESTABLISHED_PATIENT"
},
"patient": {
"dob": "2000-01-01",
"insurance": { "coverages": [
{
"eligibility_status": "Eligible",
"insurance_payer_name_raw": "AETNA",
"insurance_product_type_raw": "PPO",
"insurance_type_raw": "Commercial",
"sequence_number": "1"
}
] },
"mrn": "MRN-12345",
"patient_type": "ESTABLISHED_PATIENT",
"sex": "male"
},
"provider": {
"first_name": "Jane",
"last_name": "Doe",
"npi": "1234567893",
"speciality": "CARDIOLOGY"
}
}
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({
sections: [
{
content: {text: 'Patient presents with headache.', type: 'TEXT'},
loinc: '10164-2'
}
],
diagnoses: {
values: [
{
codes: [{code: '30422', description: 'Essential hypertension', type: 'IMO'}],
diagnosis_note: 'Hypertension'
}
]
},
encounter: {
csn: 'CSN-12345',
date_of_service: '2026-01-01',
total_time_minutes: 35,
visit_type: 'ESTABLISHED_PATIENT'
},
patient: {
dob: '2000-01-01',
insurance: {
coverages: [
{
eligibility_status: 'Eligible',
insurance_payer_name_raw: 'AETNA',
insurance_product_type_raw: 'PPO',
insurance_type_raw: 'Commercial',
sequence_number: '1'
}
]
},
mrn: 'MRN-12345',
patient_type: 'ESTABLISHED_PATIENT',
sex: 'male'
},
provider: {
first_name: 'Jane',
last_name: 'Doe',
npi: '1234567893',
speciality: 'CARDIOLOGY'
}
})
};
fetch('https://sdp.suki.ai/api/v1/em-codes', 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/em-codes",
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([
'sections' => [
[
'content' => [
'text' => 'Patient presents with headache.',
'type' => 'TEXT'
],
'loinc' => '10164-2'
]
],
'diagnoses' => [
'values' => [
[
'codes' => [
[
'code' => '30422',
'description' => 'Essential hypertension',
'type' => 'IMO'
]
],
'diagnosis_note' => 'Hypertension'
]
]
],
'encounter' => [
'csn' => 'CSN-12345',
'date_of_service' => '2026-01-01',
'total_time_minutes' => 35,
'visit_type' => 'ESTABLISHED_PATIENT'
],
'patient' => [
'dob' => '2000-01-01',
'insurance' => [
'coverages' => [
[
'eligibility_status' => 'Eligible',
'insurance_payer_name_raw' => 'AETNA',
'insurance_product_type_raw' => 'PPO',
'insurance_type_raw' => 'Commercial',
'sequence_number' => '1'
]
]
],
'mrn' => 'MRN-12345',
'patient_type' => 'ESTABLISHED_PATIENT',
'sex' => 'male'
],
'provider' => [
'first_name' => 'Jane',
'last_name' => 'Doe',
'npi' => '1234567893',
'speciality' => 'CARDIOLOGY'
]
]),
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/em-codes"
payload := strings.NewReader("{\n \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\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/em-codes")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/em-codes")
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 \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "123dfg-456dfg-789dfg-012dfg"
}{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 500,
"message": "internal server error"
}Use this API to start a standalone E/M coding session with clinical note content from your application. Send the note sections you have, and Suki returns an E/M coding
session_id.
E/M code generation runs asynchronously. Check the status using Get E/M coding status, then retrieve the results with Get E/M codes. If you have configured a Webhook, you can receive a notification when generation completes instead.
The sections field is required and must contain at least one section with text, while patient, provider, encounter, and diagnoses details are optional. A diagnosis is a problem already on the chart, so when you send ICD-10 or IMO, Suki uses that problem together with the note when it recommends the E/M code.
The returned
session_id identifies an E/M coding session, not an ambient session. Use it only with the E/M coding status and retrieval endpoints.To generate E/M codes as part of an ambient visit, pass
artifacts: ["EM_CODES"] to Create ambient session instead. See Add E/M codes to an ambient visit.Request body fields
| Field | Type | Details |
|---|---|---|
sections | array | Required Note sections to code from. Each item needs loinc and content. At least one section must carry text. content.type supports TEXT only. |
patient | object | Optional dob (YYYY-MM-DD), sex, patient_type (NEW_PATIENT / ESTABLISHED_PATIENT), mrn (up to 64 characters), and insurance.coverages[]. |
provider | object | Optional first_name, last_name, npi (up to 64 characters), and speciality. |
encounter | object | Optional date_of_service (YYYY-MM-DD, not in the future), total_time_minutes (greater than 0 for time-based coding), csn (up to 64 characters), and visit_type. |
diagnoses | object | Optional Problems already on the chart, as values[] with one code and a description, where Suki uses ICD-10 and IMO with the note when it recommends the E/M code, accepts SNOMED without using it, and rejects HCC because that type is not valid. |
Code examples
The code examples below use placeholders and the production host
sdp.suki.ai only as examples.
For credentials, base URLs, where to run Python or TypeScript, CORS, and cURL, refer to Using code examples in your integration in the API Reference Guidelines.- Python
- TypeScript
import json
import requests
BASE_URL = "https://sdp.suki.ai"
url = f"{BASE_URL}/api/v1/em-codes"
headers = {
"sdp_suki_token": "<sdp_suki_token>",
"sdp_provider_id": "<sdp_provider_id>", # required for single_auth partners
"Content-Type": "application/json",
}
payload = {
"sections": [
{
"loinc": "10164-2",
"content": {
"type": "TEXT",
"text": "Patient presents with headache. Continues lisinopril for hypertension.",
},
}
],
"patient": {
"dob": "1952-03-15",
"sex": "female",
"patient_type": "ESTABLISHED_PATIENT",
"mrn": "MRN-12345",
"insurance": {
"coverages": [
{
"sequence_number": "1",
"insurance_type_raw": "Commercial",
"insurance_product_type_raw": "PPO",
"insurance_payer_name_raw": "AETNA",
"eligibility_status": "Eligible",
}
]
},
},
"provider": {
"first_name": "Jane",
"last_name": "Doe",
"npi": "1234567893",
"speciality": "INTERNAL_MEDICINE",
},
"encounter": {
"date_of_service": "2026-01-15",
"total_time_minutes": 35,
"visit_type": "ESTABLISHED_PATIENT",
"csn": "CSN-12345",
},
"diagnoses": {
"values": [
{
"codes": [
{
"type": "ICD10",
"code": "I10",
"description": "Essential (primary) hypertension",
}
]
}
]
},
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.status_code)
print(response.json())
const BASE_URL = "https://sdp.suki.ai";
const url = `${BASE_URL}/api/v1/em-codes`;
const headers: Record<string, string> = {
sdp_suki_token: "<sdp_suki_token>",
sdp_provider_id: "<sdp_provider_id>", // required for single_auth partners
"Content-Type": "application/json",
};
const payload = {
sections: [
{
loinc: "10164-2",
content: {
type: "TEXT",
text: "Patient presents with headache. Continues lisinopril for hypertension.",
},
},
],
patient: {
dob: "1952-03-15",
sex: "female",
patient_type: "ESTABLISHED_PATIENT",
mrn: "MRN-12345",
insurance: {
coverages: [
{
sequence_number: "1",
insurance_type_raw: "Commercial",
insurance_product_type_raw: "PPO",
insurance_payer_name_raw: "AETNA",
eligibility_status: "Eligible",
},
],
},
},
provider: {
first_name: "Jane",
last_name: "Doe",
npi: "1234567893",
speciality: "INTERNAL_MEDICINE",
},
encounter: {
date_of_service: "2026-01-15",
total_time_minutes: 35,
visit_type: "ESTABLISHED_PATIENT",
csn: "CSN-12345",
},
diagnoses: {
values: [
{
codes: [
{
type: "ICD10",
code: "I10",
description: "Essential (primary) hypertension",
},
],
},
],
},
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload),
});
console.log(response.status, await response.json());
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.
Example:
"provider-123"
Body
application/json
Note sections and optional patient, provider, encounter, and diagnosis context for standalone E/M code generation.
Note sections to code from; at least one must carry content text.
Show child attributes
Show child attributes
(Optional) Diagnoses for the encounter.
Show child attributes
Show child attributes
(Optional)
Show child attributes
Show child attributes
(Optional)
Show child attributes
Show child attributes
(Optional)
Show child attributes
Show child attributes
Response
Success Response
E/M coding session ID; use for the status and retrieval APIs.
Example:
"123dfg-456dfg-789dfg-012dfg"
Last modified on November 5, 2026
Was this page helpful?
Generates E/M codes for a note, outside of an ambient session.
curl --request POST \
--url https://sdp.suki.ai/api/v1/em-codes \
--header 'Content-Type: application/json' \
--header 'sdp_suki_token: <api-key>' \
--data '
{
"sections": [
{
"content": {
"text": "Patient presents with headache.",
"type": "TEXT"
},
"loinc": "10164-2"
}
],
"diagnoses": {
"values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
]
},
"encounter": {
"csn": "CSN-12345",
"date_of_service": "2026-01-01",
"total_time_minutes": 35,
"visit_type": "ESTABLISHED_PATIENT"
},
"patient": {
"dob": "2000-01-01",
"insurance": {
"coverages": [
{
"eligibility_status": "Eligible",
"insurance_payer_name_raw": "AETNA",
"insurance_product_type_raw": "PPO",
"insurance_type_raw": "Commercial",
"sequence_number": "1"
}
]
},
"mrn": "MRN-12345",
"patient_type": "ESTABLISHED_PATIENT",
"sex": "male"
},
"provider": {
"first_name": "Jane",
"last_name": "Doe",
"npi": "1234567893",
"speciality": "CARDIOLOGY"
}
}
'import requests
url = "https://sdp.suki.ai/api/v1/em-codes"
payload = {
"sections": [
{
"content": {
"text": "Patient presents with headache.",
"type": "TEXT"
},
"loinc": "10164-2"
}
],
"diagnoses": { "values": [
{
"codes": [
{
"code": "30422",
"description": "Essential hypertension",
"type": "IMO"
}
],
"diagnosis_note": "Hypertension"
}
] },
"encounter": {
"csn": "CSN-12345",
"date_of_service": "2026-01-01",
"total_time_minutes": 35,
"visit_type": "ESTABLISHED_PATIENT"
},
"patient": {
"dob": "2000-01-01",
"insurance": { "coverages": [
{
"eligibility_status": "Eligible",
"insurance_payer_name_raw": "AETNA",
"insurance_product_type_raw": "PPO",
"insurance_type_raw": "Commercial",
"sequence_number": "1"
}
] },
"mrn": "MRN-12345",
"patient_type": "ESTABLISHED_PATIENT",
"sex": "male"
},
"provider": {
"first_name": "Jane",
"last_name": "Doe",
"npi": "1234567893",
"speciality": "CARDIOLOGY"
}
}
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({
sections: [
{
content: {text: 'Patient presents with headache.', type: 'TEXT'},
loinc: '10164-2'
}
],
diagnoses: {
values: [
{
codes: [{code: '30422', description: 'Essential hypertension', type: 'IMO'}],
diagnosis_note: 'Hypertension'
}
]
},
encounter: {
csn: 'CSN-12345',
date_of_service: '2026-01-01',
total_time_minutes: 35,
visit_type: 'ESTABLISHED_PATIENT'
},
patient: {
dob: '2000-01-01',
insurance: {
coverages: [
{
eligibility_status: 'Eligible',
insurance_payer_name_raw: 'AETNA',
insurance_product_type_raw: 'PPO',
insurance_type_raw: 'Commercial',
sequence_number: '1'
}
]
},
mrn: 'MRN-12345',
patient_type: 'ESTABLISHED_PATIENT',
sex: 'male'
},
provider: {
first_name: 'Jane',
last_name: 'Doe',
npi: '1234567893',
speciality: 'CARDIOLOGY'
}
})
};
fetch('https://sdp.suki.ai/api/v1/em-codes', 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/em-codes",
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([
'sections' => [
[
'content' => [
'text' => 'Patient presents with headache.',
'type' => 'TEXT'
],
'loinc' => '10164-2'
]
],
'diagnoses' => [
'values' => [
[
'codes' => [
[
'code' => '30422',
'description' => 'Essential hypertension',
'type' => 'IMO'
]
],
'diagnosis_note' => 'Hypertension'
]
]
],
'encounter' => [
'csn' => 'CSN-12345',
'date_of_service' => '2026-01-01',
'total_time_minutes' => 35,
'visit_type' => 'ESTABLISHED_PATIENT'
],
'patient' => [
'dob' => '2000-01-01',
'insurance' => [
'coverages' => [
[
'eligibility_status' => 'Eligible',
'insurance_payer_name_raw' => 'AETNA',
'insurance_product_type_raw' => 'PPO',
'insurance_type_raw' => 'Commercial',
'sequence_number' => '1'
]
]
],
'mrn' => 'MRN-12345',
'patient_type' => 'ESTABLISHED_PATIENT',
'sex' => 'male'
],
'provider' => [
'first_name' => 'Jane',
'last_name' => 'Doe',
'npi' => '1234567893',
'speciality' => 'CARDIOLOGY'
]
]),
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/em-codes"
payload := strings.NewReader("{\n \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\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/em-codes")
.header("sdp_suki_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/em-codes")
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 \"sections\": [\n {\n \"content\": {\n \"text\": \"Patient presents with headache.\",\n \"type\": \"TEXT\"\n },\n \"loinc\": \"10164-2\"\n }\n ],\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 \"encounter\": {\n \"csn\": \"CSN-12345\",\n \"date_of_service\": \"2026-01-01\",\n \"total_time_minutes\": 35,\n \"visit_type\": \"ESTABLISHED_PATIENT\"\n },\n \"patient\": {\n \"dob\": \"2000-01-01\",\n \"insurance\": {\n \"coverages\": [\n {\n \"eligibility_status\": \"Eligible\",\n \"insurance_payer_name_raw\": \"AETNA\",\n \"insurance_product_type_raw\": \"PPO\",\n \"insurance_type_raw\": \"Commercial\",\n \"sequence_number\": \"1\"\n }\n ]\n },\n \"mrn\": \"MRN-12345\",\n \"patient_type\": \"ESTABLISHED_PATIENT\",\n \"sex\": \"male\"\n },\n \"provider\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"npi\": \"1234567893\",\n \"speciality\": \"CARDIOLOGY\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "123dfg-456dfg-789dfg-012dfg"
}{
"code": 400,
"message": "invalid request"
}{
"code": 401,
"message": "invalid token"
}{
"code": 500,
"message": "internal server error"
}