Suki Medical Form Templates
List Suki-defined medical form templates available for Form filling sessions
curl --request GET \
--url https://sdp.suki.ai/api/v1/info/suki-medical-form-templates \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/info/suki-medical-form-templates"
headers = {"sdp_suki_token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {sdp_suki_token: '<api-key>'}};
fetch('https://sdp.suki.ai/api/v1/info/suki-medical-form-templates', 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/info/suki-medical-form-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/info/suki-medical-form-templates"
req, _ := http.NewRequest("GET", 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.get("https://sdp.suki.ai/api/v1/info/suki-medical-form-templates")
.header("sdp_suki_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/info/suki-medical-form-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["sdp_suki_token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"form_templates": [
{
"description": "Standard vitals collection template for adult patients.",
"name": "Adult Vitals",
"template_id": "019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0",
"type": "VITALS_ASSESSMENT",
"schema": {
"items": [
{
"code": "Q003",
"id": "respiratory_pattern",
"kind": "field",
"options": [
{
"code": null,
"display": "Regular"
},
{
"code": null,
"display": "Shallow"
}
],
"pattern": "",
"question": "Respiratory Pattern / Effort",
"type": "radio"
}
]
}
}
]
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}Code examples
sdp.suki-stage.com 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
from typing import Any, TypedDict, cast
import requests
BASE_URL = "https://sdp.suki-stage.com"
class MedicalFormTemplate(TypedDict, total=False):
description: str
name: str
schema: Any
template_id: str
type: str
class GetSukiFormTemplatesResponse(TypedDict):
form_templates: list[MedicalFormTemplate]
class ApiHttpError(RuntimeError):
"""Wrong HTTP status; OpenAPI errors usually include JSON with message + code."""
def __init__(self, status: int, url: str, detail: str) -> None:
super().__init__(f"HTTP {status} {url}: {detail}")
self.status = status
self.url = url
def _get_expect_json_object(url: str, headers: dict[str, str], expect_status: int) -> dict[str, Any]:
r = requests.get(url, headers=headers, timeout=60)
if r.status_code == expect_status:
data = r.json()
if isinstance(data, dict):
return data
raise ApiHttpError(expect_status, url, "response JSON was not an object")
detail = ""
try:
err = r.json()
if isinstance(err, dict) and isinstance(err.get("message"), str):
detail = err["message"]
except ValueError:
detail = (r.text or "")[:500]
raise ApiHttpError(r.status_code, url, detail or "(no body)")
def get_suki_medical_form_templates(suki_token: str) -> GetSukiFormTemplatesResponse:
"""GET /api/v1/info/suki-medical-form-templates (sdp_suki_token header required). HTTP 200."""
url = f"{BASE_URL}/api/v1/info/suki-medical-form-templates"
data = _get_expect_json_object(url, {"sdp_suki_token": suki_token, "sdp_provider_id": "<sdp_provider_id>"}, 200)
ft = data.get("form_templates")
if not isinstance(ft, list):
raise ValueError(f"{url}: 200 response missing form_templates array")
return cast(GetSukiFormTemplatesResponse, {"form_templates": ft})
if __name__ == "__main__":
try:
out = get_suki_medical_form_templates("YOUR_SUKI_TOKEN")
print(len(out["form_templates"]))
except (ApiHttpError, ValueError) as e:
print(e)
const BASE_URL = "https://sdp.suki-stage.com";
type MedicalFormTemplate = {
description?: string;
name?: string;
schema?: unknown;
template_id?: string;
type?: string;
};
type GetSukiFormTemplatesResponse = {
form_templates: MedicalFormTemplate[];
};
class ApiHttpError extends Error {
status: number;
url: string;
constructor(status: number, url: string, detail: string) {
super(`HTTP ${status} ${url}: ${detail}`);
this.status = status;
this.url = url;
}
}
async function getExpectJsonObject(url: string, headers: Record<string, string>, expectStatus: number) {
const res = await fetch(url, { method: "GET", headers });
const text = await res.text();
const json = text ? JSON.parse(text) : {};
if (res.status !== expectStatus) {
const msg = typeof (json as any)?.message === "string" ? (json as any).message : text?.slice(0, 500) || "(no body)";
throw new ApiHttpError(res.status, url, msg);
}
if (json && typeof json === "object" && !Array.isArray(json)) return json as Record<string, unknown>;
throw new ApiHttpError(res.status, url, "response JSON was not an object");
}
export async function getSukiMedicalFormTemplates(sukiToken: string): Promise<GetSukiFormTemplatesResponse> {
const url = `${BASE_URL}/api/v1/info/suki-medical-form-templates`;
const data = await getExpectJsonObject(url, { sdp_suki_token: sukiToken, sdp_provider_id: "<sdp_provider_id>" }, 200);
const ft = data.form_templates;
if (!Array.isArray(ft)) {
throw new Error(`${url}: 200 response missing form_templates array`);
}
return { form_templates: ft as MedicalFormTemplate[] };
}
// Example usage
const out = await getSukiMedicalFormTemplates("YOUR_SUKI_TOKEN");
console.log(out.form_templates.length);
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"
Response
Request succeeded.
Response body for the /info/suki-medical-form-templates endpoint
List of Suki-defined medical form templates
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://sdp.suki.ai/api/v1/info/suki-medical-form-templates \
--header 'sdp_suki_token: <sdp_suki_token>' \
--header 'sdp_provider_id: <sdp_provider_id>'import requests
url = "https://sdp.suki.ai/api/v1/info/suki-medical-form-templates"
headers = {"sdp_suki_token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {sdp_suki_token: '<api-key>'}};
fetch('https://sdp.suki.ai/api/v1/info/suki-medical-form-templates', 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/info/suki-medical-form-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/info/suki-medical-form-templates"
req, _ := http.NewRequest("GET", 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.get("https://sdp.suki.ai/api/v1/info/suki-medical-form-templates")
.header("sdp_suki_token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/info/suki-medical-form-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["sdp_suki_token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"form_templates": [
{
"description": "Standard vitals collection template for adult patients.",
"name": "Adult Vitals",
"template_id": "019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0",
"type": "VITALS_ASSESSMENT",
"schema": {
"items": [
{
"code": "Q003",
"id": "respiratory_pattern",
"kind": "field",
"options": [
{
"code": null,
"display": "Regular"
},
{
"code": null,
"display": "Shallow"
}
],
"pattern": "",
"question": "Respiratory Pattern / Effort",
"type": "radio"
}
]
}
}
]
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}