API reference

UnicareOS and its applications expose REST endpoints over HTTPS. Requests and responses are JSON.

Example content

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
Base URL
https://api.unicaremind.com/v1

Authentication

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.

Header
Authorization: Bearer $UNICARE_API_KEY

Errors

Errors return the matching HTTP status and a JSON body with code and message.

StatuscodeMeaning
400invalid_requestMissing or malformed parameters.
401unauthorizedInvalid or revoked API key.
403policy_deniedThe policy gate denied the call.
422validation_failedThe output failed validation and policy requires blocking.
429rate_limitedToo many requests.
500internal_errorServer error; contact us with the trace_id.
403 Forbidden
{
  "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 · required

    Use case, such as discharge_summary or prescription.

  • outputobject · required

    The output to check; must include text.

  • inputobject

    References to the inputs used, for source tracing.

  • sourcesarray

    Additional 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." }
  }'
200 OK
{
  "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 · required

    The trace ID returned by the governance check.

cURL
curl https://api.unicaremind.com/v1/audit/records/uc-7f3a-e19c-42b0 \
  -H "Authorization: Bearer $UNICARE_API_KEY"
200 OK
{
  "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 · required

    Hospital case number.

  • front_pageobject · required

    Front-page fields: principal and secondary diagnoses, procedures.

  • feesarray

    Itemised charges for cost-structure analysis.

200 OK
{
  "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 · required

    Document type, such as discharge_summary.

  • contentobject · required

    Record content, organised by section.

  • rulesarray

    Rule sets to apply; defaults to ["format", "content"].

200 OK
{
  "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" }
  ]
}