Skip to content

← All contracts

OHN-17 Emergency Access and Break Glass

Version
1.1.0
OpenAPI
3.1.0
Source in the repository
modules/OHN-17/api/openapi.json
Servers
https://opeshealthnetwork.com/api/ohn/v1
Authentication
bearer: http bearer

Download the contract (JSON)

Contracts are written in English.

Base path /api/ohn/v1. Every POST requires Idempotency-Key; mutations use expected_version. Routes default-deny on role AND purpose (emergency_access). Break glass is fail closed: without a configured jurisdiction policy, or with an unreachable licence or patient check, nothing is granted. Pre-hospital break-glass (1.1.0, owner decision 2026-11-23): an ambulance crew's token carries purpose prehospital_emergency_access; its requests are refused with 403 prehospital_break_glass_disabled unless the jurisdiction's setting prehospital_break_glass_enabled is on (off by default in every jurisdiction). Only role jurisdiction_policy_steward with purpose jurisdiction_emergency_policy switches it (POST /emergency-access/jurisdiction-settings, legal basis reference required to switch on); every change is audited and recorded append-only. When on, the normal rules apply unchanged (reason, time limit, disclosure log, events, mandatory retrospective review); the case carries access_context prehospital.

Operations

OHN-17

GET/emergency-accessReview queue / own cases (review_state, status, cursor)

Operation ID: listCases

Authentication: bearer

Parameters

NameInTypeRequiredDescription
review_statequerystringno
statusquerystringno
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-accessRequest emergency access (API-001; F001)

Operation ID: requestAccess

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (denied_by_policy) or clinician_mismatch; prehospital_break_glass_disabled when an ambulance crew asks and the jurisdiction has not switched pre-hospital break-glass on—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422domain_validation_failed; policy_not_configured, patient_context_missing, or a denied case (clinician_license_inactive, clinician_membership_expired, sections_outside_policy, duration_exceeds_policy; details.case_id)
application/json: Error
429Rate limited—
503dependency_unavailable: OHN-06 clinician standing or OHN-03 patient lookup is unconfigured or down; nothing is granted—
GET/emergency-access/activeActive grants

Operation ID: activeGrants

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/{id}Case with history, review and escalations (API-002)

Operation ID: getCase

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesA value that is not a UUID is 404 not_found

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/{id}/disclosuresRecord a section read under the grant (denied if out of scope or expired)

Operation ID: recordDisclosure

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403section_not_in_scope, grant_terminated or grant_expired (each denied attempt is recorded)—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/{id}/terminateTerminate a grant (F003)

Operation ID: terminateGrant

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409version_conflict (details.current_version) or illegal_transition (already terminated)
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/{id}/reviewRetrospective review (API-003; F002)

Operation ID: reviewCase

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403separation_of_duties: a clinician cannot review their own access—
404Not found / out of scope—
409version_conflict, illegal_transition (not awaiting review) or grant_still_active
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/{id}/remediateRemediate a violation and close

Operation ID: remediateCase

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409version_conflict or illegal_transition (only a recorded violation can be remediated)
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/maintenance/expire-sweepTerminate grants past their time limit

Operation ID: expireSweep

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/maintenance/drain-outboxDrain outbox (no sink => nothing marked delivered)

Operation ID: drainOutbox

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/request-optionsWhat a clinician may request under the current rules (allowed sections, maximum duration; no approval reference)

Operation ID: readRequestOptions

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/policyRead policy (unconfigured = fail closed)

Operation ID: readPolicy

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/policyWrite policy

Operation ID: writePolicy

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/jurisdiction-settingsPer-jurisdiction settings: pre-hospital break-glass switch (no setting = off). Steward and emergency reviewer

Operation ID: readJurisdictionSettings

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/jurisdiction-settingsSwitch pre-hospital break-glass on or off (jurisdiction_policy_steward only; audited)

Operation ID: writeJurisdictionSettings

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/report-catalogReport catalog

Operation ID: reportCatalog

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/reports/{reportId}Run report

Operation ID: runReport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003"yes
facilityquerystringnouuid
reviewerquerystringnouuid
actorquerystringnouuid
statusquerystringnopending|reviewed|justified|violation|remediated|closed
period_fromquerystringnoYYYY-MM-DD
period_toquerystringnoYYYY-MM-DD
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/emergency-access/reports/{reportId}/exportCreate signed single-use export

Operation ID: createExport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003"yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
409Version conflict, illegal transition or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/emergency-access/exports/{token}Download export (owner only, single use, 5 min)

Operation ID: fetchExport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200OK: the export file as an attachment (Content-Type text/csv; charset=utf-8 or application/pdf; single use, 5 minutes, owner only)
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied (default deny) or domain denial—
404Not found / out of scope—
410export_expired or export_consumed
application/json: Error
429Rate limited—
500export_integrity_failed
application/json: Error
503Dependency unavailable (fails closed)—

Other operations

GET/health/ohn-17Liveness incl. DB and dependency modes

Operation ID: health

Responses

CodeDescriptionMedia type
200ok: {status, module, dependencies: {ohn06, ohn20}} with the mode of each dependency (synthetic, unconfigured or live)—
503unavailable—

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsanyno

EmergencyRequest

NameTypeRequiredDescription
patient_idstring (uuid)yes
facility_idstring (uuid)yes
clinician_idstring (uuid)yesMust equal the authenticated clinician
clinical_emergencystringyes
requested_sectionsarray of stringyes
requested_duration_minutesintegeryes

Review

NameTypeRequiredDescription
review_outcome"justified" | "violation"yes
justification_adequacy"adequate" | "inadequate"yes
evidence_refsstring (uuid)yes
remediationstringnoOptional narrative, trimmed, 10..8192 characters
expected_versionintegeryes

Remediate

NameTypeRequiredDescription
remediationstringyes
expected_versionintegeryes

Terminate

NameTypeRequiredDescription
termination_reasonstringyes
expected_versionintegeryesGrant version

Disclosure

NameTypeRequiredDescription
sectionstringyes

Policy

NameTypeRequiredDescription
max_duration_minutesinteger | nullyes
review_deadline_hoursinteger | nullyes
allowed_sectionsarray of stringyes
approval_referencestringyes

JurisdictionSettings

NameTypeRequiredDescription
prehospital_break_glass_enabledbooleanyesAmbulance crews may use break-glass before reaching hospital in this jurisdiction. Default false.
legal_basis_referencestring | nullnoReference of the jurisdiction's legal decision; required when switching on.
expected_versionintegeryes0 when the jurisdiction has no setting yet.

ExportCommand

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersReportFiltersno

Report

Tabular report; at most 100 rows per page, next_cursor continues. Identifiers and codes only: no clinical narrative.

NameTypeRequiredDescription
report_id"OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003"no
titlestringno
columnsarray of anyno
rowsarray of anyno
summaryobjectno
state"rendered" | "no_authorized_data"no
generated_atstring (date-time)no
next_cursorstring | nullno

ReportFilters

NameTypeRequiredDescription
facilitystring (uuid)no
reviewerstring (uuid)no
actorstring (uuid)no
status"pending" | "reviewed" | "justified" | "violation" | "remediated" | "closed"no
period_fromstringno
period_tostringno