← All contracts
OHN-42 Sensitive Data Segmentation
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-42/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 (sensitive_data_governance). Anything unlabeled, pending or unpolicied is withheld.
Operations
OHN-42
GET/classification/decisionsDecisions (status, resource_ref)
Operation ID: listDecisions
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
status | query | string | no | |
resource_ref | query | string (uuid) | 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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/decisionsClassify a resource against published policies (API-001; W001)
Operation ID: classify
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/decisions/{id}Decision with history
Operation ID: getDecision
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/decisions/{id}/reviewClinical review of a held decision (not the classifier)
Operation ID: reviewDecision
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/labelsLabels in force (status, patient_ref)
Operation ID: listLabels
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
status | query | string | no | |
patient_ref | query | string (uuid) | 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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/classification/labels/{id}Label inspector for a resource ref
Operation ID: getLabel
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/classification/policiesSensitivity policies (API-002)
Operation ID: listPolicies
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
resource_category | 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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/policiesDraft a sensitivity policy (F001)
Operation ID: createPolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/policies/{id}One policy
Operation ID: getPolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/policies/{id}/publishPublish a policy (author cannot publish; API-003)
Operation ID: publishPolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/evaluationsEvaluate/enforce disclosure for resources (F002; W002)
Operation ID: evaluate
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/exceptionsExceptions (state, sensitivity_type)
Operation ID: listExceptions
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
sensitivity_type | 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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/exceptionsRequest a time-bounded exception (F003; W003)
Operation ID: requestException
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/exceptions/{id}Exception with reviews and history
Operation ID: getException
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/exceptions/{id}/reviewsReview an exception; needs one approval per reviewer role
Operation ID: reviewException
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/exceptions/{id}/revokeRevoke an approved exception (privacy officer)
Operation ID: revokeException
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/settingsRead settings (unset = fail closed)
Operation ID: readSettings
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/settingsWrite settings
Operation ID: writeSettings
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/code-lists/{list}Read code list
Operation ID: listCodes
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
list | path | "resource_category" | "sensitivity_label" | "requester_role" | "purpose" | "exception_basis" | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/code-lists/{list}Upsert code list entries
Operation ID: upsertCodes
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
list | path | "resource_category" | "sensitivity_label" | "requester_role" | "purpose" | "exception_basis" | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/maintenance/expire-sweepRecord expiry of approved exceptions 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, patient out of scope, or separation of duties | — |
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/classification/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, patient out of scope, or separation of duties | — |
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/classification/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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/classification/reports/{reportId}Run report
Operation ID: runReport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-42-R001" | "OHN-42-R002" | "OHN-42-R003" | yes | |
purpose | query | string | no | |
label | query | string | no | |
status | query | string | no | |
source | query | string | no | |
period_from | query | string | no | |
period_to | 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, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/classification/reports/{reportId}/exportCreate signed single-use export
Operation ID: createExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-42-R001" | "OHN-42-R002" | "OHN-42-R003" | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
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/classification/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 | application/json: object
|
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, patient out of scope, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
Other operations
GET/health/ohn-42Liveness incl. DB and dependency modes
Operation ID: health
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
503 | unavailable | — |
Schemas
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
details | any | no | |
Policy
| Name | Type | Required | Description |
|---|
resource_category | string | yes | |
sensitivity_label | string | yes | |
matching_criteria | string | yes | JSON: {"codes":["system|code"],"code_prefixes":["system|prefix"]}; at least one entry |
purpose_limitations | string | yes | JSON: {"allowed_purposes":[...],"allowed_roles":[...],"on_restricted":"redact"|"deny"}; empty lists mean nobody |
policy_version | string | yes | |
Publish
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
reason | string | yes | |
Classify
| Name | Type | Required | Description |
|---|
resource_ref | string (uuid) | yes | |
resource_category | string | yes | |
source_system | string | yes | |
patient_ref | string (uuid) | no | |
codes | array of string | yes | |
ReviewDecision
| Name | Type | Required | Description |
|---|
labels | array of string | yes | |
reason | string | yes | |
expected_version | integer | yes | |
Evaluation
| Name | Type | Required | Description |
|---|
patient_ref | string (uuid) | yes | |
requester_role | string | yes | |
purpose | string | yes | |
requested_categories | array of string | no | |
mode | "preview" | "enforce" | no | enforce returns only allowed_resource_refs; no counts, labels or reasons, never cacheable |
resources | array of string (uuid) | yes | |
ExceptionRequest
| Name | Type | Required | Description |
|---|
patient_ref | string (uuid) | yes | |
sensitivity_type | string | yes | |
exception_basis | string | yes | |
requester_role | string | yes | |
purpose | string | yes | |
resource_refs | array of string (uuid) | yes | |
reason | string | yes | |
expires_at | string (date-time) | yes | Must be in the future and within the configured maximum; no indefinite exceptions |
ExceptionReview
| Name | Type | Required | Description |
|---|
decision | "approve" | "deny" | yes | |
reason | string | yes | |
expected_version | integer | yes | |
ExceptionRevoke
| Name | Type | Required | Description |
|---|
reason | string | yes | |
expected_version | integer | yes | |
Settings
| Name | Type | Required | Description |
|---|
default_label | string | null | yes | |
max_exception_days | integer | null | yes | |
approval_reference | string | yes | |
ExportCommand
| Name | Type | Required | Description |
|---|
format | "csv" | "pdf" | yes | |
filters | object | no | Report filters (purpose, label, status, source, period_from, period_to); unknown keys are refused with 422 |
Report
| Name | Type | Required | Description |
|---|
report_id | "OHN-42-R001" | "OHN-42-R002" | "OHN-42-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 | |
CodeListUpsert.entries.item defined inline
| Name | Type | Required | Description |
|---|
code | string | yes | |
label_en | string | yes | |
label_fr | string | yes | |
active | boolean | no | |