← 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
| Name | In | Type | Required | Description |
|---|
review_state | query | string | no | |
status | query | string | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-accessRequest emergency access (API-001; F001)
Operation ID: requestAccess
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/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 | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | domain_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) | |
429 | Rate limited | — |
503 | dependency_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
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/emergency-access/{id}Case with history, review and escalations (API-002)
Operation ID: getCase
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | A value that is not a UUID is 404 not_found |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
429 | Rate limited | — |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | section_not_in_scope, grant_terminated or grant_expired (each denied attempt is recorded) | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/{id}/terminateTerminate a grant (F003)
Operation ID: terminateGrant
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | version_conflict (details.current_version) or illegal_transition (already terminated) | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/{id}/reviewRetrospective review (API-003; F002)
Operation ID: reviewCase
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | separation_of_duties: a clinician cannot review their own access | — |
404 | Not found / out of scope | — |
409 | version_conflict, illegal_transition (not awaiting review) or grant_still_active | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/{id}/remediateRemediate a violation and close
Operation ID: remediateCase
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | version_conflict or illegal_transition (only a recorded violation can be remediated) | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/maintenance/expire-sweepTerminate grants past their time limit
Operation ID: expireSweep
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/maintenance/drain-outboxDrain outbox (no sink => nothing marked delivered)
Operation ID: drainOutbox
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency 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
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/emergency-access/policyRead policy (unconfigured = fail closed)
Operation ID: readPolicy
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/policyWrite policy
Operation ID: writePolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency 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
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/emergency-access/report-catalogReport catalog
Operation ID: reportCatalog
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/emergency-access/reports/{reportId}Run report
Operation ID: runReport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003" | yes | |
facility | query | string | no | uuid |
reviewer | query | string | no | uuid |
actor | query | string | no | uuid |
status | query | string | no | pending|reviewed|justified|violation|remediated|closed |
period_from | query | string | no | YYYY-MM-DD |
period_to | query | string | no | YYYY-MM-DD |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/emergency-access/reports/{reportId}/exportCreate signed single-use export
Operation ID: createExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003" | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/emergency-access/exports/{token}Download export (owner only, single use, 5 min)
Operation ID: fetchExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK: 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
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied (default deny) or domain denial | — |
404 | Not found / out of scope | — |
410 | export_expired or export_consumed | |
429 | Rate limited | — |
500 | export_integrity_failed | |
503 | Dependency unavailable (fails closed) | — |
Other operations
GET/health/ohn-17Liveness incl. DB and dependency modes
Operation ID: health
Responses
| Code | Description | Media type |
|---|
200 | ok: {status, module, dependencies: {ohn06, ohn20}} with the mode of each dependency (synthetic, unconfigured or live) | — |
503 | unavailable | — |
Schemas
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
details | any | no | |
EmergencyRequest
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | yes | |
facility_id | string (uuid) | yes | |
clinician_id | string (uuid) | yes | Must equal the authenticated clinician |
clinical_emergency | string | yes | |
requested_sections | array of string | yes | |
requested_duration_minutes | integer | yes | |
Review
| Name | Type | Required | Description |
|---|
review_outcome | "justified" | "violation" | yes | |
justification_adequacy | "adequate" | "inadequate" | yes | |
evidence_refs | string (uuid) | yes | |
remediation | string | no | Optional narrative, trimmed, 10..8192 characters |
expected_version | integer | yes | |
Terminate
| Name | Type | Required | Description |
|---|
termination_reason | string | yes | |
expected_version | integer | yes | Grant version |
Disclosure
| Name | Type | Required | Description |
|---|
section | string | yes | |
Policy
| Name | Type | Required | Description |
|---|
max_duration_minutes | integer | null | yes | |
review_deadline_hours | integer | null | yes | |
allowed_sections | array of string | yes | |
approval_reference | string | yes | |
JurisdictionSettings
| Name | Type | Required | Description |
|---|
prehospital_break_glass_enabled | boolean | yes | Ambulance crews may use break-glass before reaching hospital in this jurisdiction. Default false. |
legal_basis_reference | string | null | no | Reference of the jurisdiction's legal decision; required when switching on. |
expected_version | integer | yes | 0 when the jurisdiction has no setting yet. |
ExportCommand
| Name | Type | Required | Description |
|---|
format | "csv" | "pdf" | yes | |
filters | ReportFilters | no | |
Report
Tabular report; at most 100 rows per page, next_cursor continues. Identifiers and codes only: no clinical narrative.
| Name | Type | Required | Description |
|---|
report_id | "OHN-17-R001" | "OHN-17-R002" | "OHN-17-R003" | no | |
title | string | no | |
columns | array of any | no | |
rows | array of any | no | |
summary | object | no | |
state | "rendered" | "no_authorized_data" | no | |
generated_at | string (date-time) | no | |
next_cursor | string | null | no | |
ReportFilters
| Name | Type | Required | Description |
|---|
facility | string (uuid) | no | |
reviewer | string (uuid) | no | |
actor | string (uuid) | no | |
status | "pending" | "reviewed" | "justified" | "violation" | "remediated" | "closed" | no | |
period_from | string | no | |
period_to | string | no | |