API reference
UnicareOS and its applications expose REST endpoints over HTTPS. Requests and responses are JSON.
The API is being finalised. Endpoints, parameters and responses on this page are examples; the published API is authoritative.
- Base URL
https://api.unicaremind.com/v1- Format
- JSON, UTF-8
- Auth
- Bearer API Key
https://api.unicaremind.com/v1Authentication
Send your API key in the request header. Create keys in the console under Settings → API Keys and use them only on the server.
Every call is written to the audit record under the key's workspace.
Authorization: Bearer $UNICARE_API_KEYErrors
Errors return the matching HTTP status and a JSON body with code and message.
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | Missing or malformed parameters. |
| 401 | unauthorized | Invalid or revoked API key. |
| 403 | policy_denied | The policy gate denied the call. |
| 422 | validation_failed | The output failed validation and policy requires blocking. |
| 429 | rate_limited | Too many requests. |
| 500 | internal_error | Server error; contact us with the trace_id. |
{
"code": "policy_denied",
"message": "This model is not authorised for the use case",
"trace_id": "uc-51c0-9a2e-03fd"
}POST/governance/check
Governance check
Runs the policy gate, source tracing and validation on AI-generated text and returns a decision with a traceable trace_id.
Body parameters
scenestring · requiredUse case, such as
discharge_summaryorprescription.outputobject · requiredThe output to check; must include
text.inputobjectReferences to the inputs used, for source tracing.
sourcesarrayAdditional source document IDs.
curl https://api.unicaremind.com/v1/governance/check \
-H "Authorization: Bearer $UNICARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scene": "discharge_summary",
"output": { "text": "Discharge orders: continue oral medication, outpatient follow-up." }
}'
resp = requests.post(
f"{BASE_URL}/governance/check",
headers=HEADERS,
json={
"scene": "discharge_summary",
"output": {"text": "Discharge orders: continue oral medication, outpatient follow-up."},
},
)
{
"trace_id": "uc-7f3a-e19c-42b0",
"decision": "needs_review",
"checks": [
{ "gate": "policy", "status": "passed" },
{ "gate": "validation", "status": "flagged",
"message": "No follow-up date in discharge orders" }
]
}GET/audit/records/{trace_id}
Audit record
Returns the full record of one call by trace_id: use case, policy version, sources, checks and who confirmed it.
Path parameters
trace_idstring · requiredThe trace ID returned by the governance check.
curl https://api.unicaremind.com/v1/audit/records/uc-7f3a-e19c-42b0 \
-H "Authorization: Bearer $UNICARE_API_KEY"{
"trace_id": "uc-7f3a-e19c-42b0",
"scene": "discharge_summary",
"policy_version": "2.3",
"sources": ["clinic_note", "imaging", "orders"],
"confirmed_by": "attending",
"confirmed_at": "2026-11-06T09:42:00+08:00",
"digest": "sha256:9c41...e07b"
}POST/apps/drg/pre-audit
DRG pre-audit
Pre-audits a case before it goes to the insurer: front-page checks, grouping prediction and cost deviation.
Body parameters
case_idstring · requiredHospital case number.
front_pageobject · requiredFront-page fields: principal and secondary diagnoses, procedures.
feesarrayItemised charges for cost-structure analysis.
{
"case_id": "2381",
"score": 86,
"group": { "status": "grouped", "weight": "normal" },
"cost_deviation": 0.084,
"issues": [
{ "level": "high", "message": "Secondary diagnosis missing, may affect CC/MCC" },
{ "level": "medium", "message": "Principal diagnosis and procedure site differ" }
]
}POST/apps/emr-qc/check
Record QC
Runs format and content checks on a medical record and pins each issue to its section. This module is open source on GitHub.
Body parameters
document_typestring · requiredDocument type, such as
discharge_summary.contentobject · requiredRecord content, organised by section.
rulesarrayRule sets to apply; defaults to
["format", "content"].
{
"score": 91,
"issues": [
{ "type": "format", "section": "progress_note",
"message": "First progress note later than 8 hours" },
{ "type": "content", "section": "discharge_orders",
"message": "Discharge orders lack a follow-up date" }
]
}