Skip to content

← All contracts

OHN-16 Authorization and Policy Decision Engine

Version
1.3.0
OpenAPI
3.1.0
Source in the repository
modules/OHN-16/api/openapi.yaml
Servers
https://opeshealthnetwork.com
Authentication
bearerAuth: http bearer (JWT)

Download the contract (YAML)

Contracts are written in English.

Deny-by-default policy decision point and policy release workflow. Built and tested with synthetic data. Real-patient use requires accepted OHN-01/05/06/15/38 integrations and the legal, privacy and safety authorizations named in governance/IMPLEMENTATION_AUTHORIZATION.md.

Operations

Decisions

OHN-16-API-001 and the decision explorer

GET/api/ohn/v1/access/decisions

Operation ID: ohn16_listDecisions

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
decisionquery"permit" | "deny" | "indeterminate"no
resource_typequerystringno
simulatedquery"true" | "false"no
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Page of decisions, newest first; patient references are masked
application/json: Page
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
POST/api/ohn/v1/access/decisions

Evaluates a request against the published policy and records the decision, obligations, workflow trail and audit receipt. A deny or indeterminate result is a successful evaluation (HTTP 200); a permit is HTTP 201. Callers must treat indeterminate as deny and must not cache decisions (cache.ttl_seconds is 0).

Operation ID: ohn16_decideAccess

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Denied or indeterminate
application/json: DecisionResult
201Permitted
application/json: DecisionResult
400Malformed request or missing Idempotency-Key
application/json: Error
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
503Database or dependency unavailable; nothing was changed
application/json: Error
GET/api/ohn/v1/access/decisions/{id}

Operation ID: ohn16_getDecision

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Decision with trace, obligations and workflow history
application/json: DecisionResult
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error

Policies

OHN-16-API-002, OHN-16-API-003 and the release workflow OHN-16-W001

GET/api/ohn/v1/policies

Operation ID: ohn16_listPolicies

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
statequery"draft" | "peer_review" | "simulation_passed" | "dual_approved" | "published" | "deprecated" | "revoked"no
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Page of policy bundles in the caller's jurisdiction and organization
application/json: Page
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
POST/api/ohn/v1/policies

Operation ID: ohn16_createPolicyDraft

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Draft created
application/json: BundleWithReceipt
400Malformed request or missing Idempotency-Key
application/json: Error
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
GET/api/ohn/v1/policies/{id}

Operation ID: ohn16_getPolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Bundle with rules and release history
application/json: Bundle
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
GET/api/ohn/v1/policies/{id}/diff

Operation ID: ohn16_diffPolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Rule and setting differences against the superseded or currently published bundle
application/json: object
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
POST/api/ohn/v1/policies/{id}/rules

Adds a rule to a draft. Only the author may edit; rules are immutable once the bundle leaves draft (also enforced by a database trigger).

Operation ID: ohn16_addPolicyRule

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Rule added
application/json: object
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/rules/{ruleId}/remove

Operation ID: ohn16_removePolicyRule

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
ruleIdpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Rule removed
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/submit

draft -> peer_review. Refused (422 domain_refusal) for a bundle without rules.

Operation ID: ohn16_submitPolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Submitted
application/json: BundleWithReceipt
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/run-fixtures

Runs every active fixture. In peer_review a clean run advances the bundle to simulation_passed and records the run as test evidence. Refused (422 negative_tests_missing) unless at least one fixture expects deny or indeterminate.

Operation ID: ohn16_runPolicyFixtures

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Run recorded
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/simulate

Evaluates a request against the named bundle in any state. Recorded with simulated=true; never creates a grant, exception or access.denied event.

Operation ID: ohn16_simulatePolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Simulated decision
application/json: DecisionResult
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
POST/api/ohn/v1/policies/{id}/approve

Records one of two approvals on a simulation_passed bundle. The author can never approve and one reviewer cannot give both (403 dual_control_violation).

Operation ID: ohn16_approvePolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Approval recorded
application/json: BundleWithReceipt
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/reject

Returns a bundle in review to draft and clears its evidence and approvals.

Operation ID: ohn16_rejectPolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Returned to draft
application/json: BundleWithReceipt
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/policies/{id}/publish

dual_approved -> published. The publisher restates the evidence; anything that differs from the recorded regression run and approvals is refused. The previous published bundle becomes deprecated and is recorded as rollback_ref. Emits policy.published and access.policy-version.changed through the transactional outbox.

Operation ID: ohn16_publishPolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Published; downstream delivery is pending confirmation
application/json: BundleWithReceipt
400Malformed request or missing Idempotency-Key
application/json: Error
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
503Database or dependency unavailable; nothing was changed
application/json: Error
POST/api/ohn/v1/policies/{id}/revoke

published -> revoked. Nothing replaces the bundle automatically, so every decision denies (no_published_policy) until another bundle is published.

Operation ID: ohn16_revokePolicy

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Revoked
application/json: BundleWithReceipt
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error

Fixtures

GET/api/ohn/v1/access/fixtures

Operation ID: ohn16_listFixtures

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Page of fixtures
application/json: Page
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
POST/api/ohn/v1/access/fixtures

Operation ID: ohn16_createFixture

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Fixture created
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/access/fixtures/{id}/retire

Operation ID: ohn16_retireFixture

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Fixture retired
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
GET/api/ohn/v1/access/fixture-runs

Operation ID: ohn16_listFixtureRuns

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
releasequerystringno
resource_typequerystringno
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Same content as report OHN-16-R002
application/json: Report
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error

Relationships

GET/api/ohn/v1/access/relationships

Operation ID: ohn16_listRelationships

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Page of relationship assertions; patient references are masked
application/json: Page
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
POST/api/ohn/v1/access/relationships

Registers a time-bounded clinical relationship (role relationship_registrar). Until OHN-06 integration this is the only source of relationship facts. The 201 body is the assertion (id, version, status, valid_from, expires_at, evidence_ref, asserted_by, receipt); a caller keeps id and version to revoke it. OHN-32 registers with its service identity as relationship_registrar (see its ADRs). 1.3.0 (owner decision 2026-11-29): role care_team_registrar, purpose relationship_registration, the OHN-61 triage service identity, in the organisation scope of the ticket's facility. It may register only relationship_type care_team (another type answers 403 forbidden, details.reason relationship_type_not_permitted) and only with expires_at at most 72 hours after valid_from (more answers 422 domain_validation_failed, details.fieldErrors.expires_at). It implies no other action (no decisions, no reads). OHN-61 registers one care_team assertion per receiving clinician, when the clinician takes up the ticket (call, start of consultation, handover acknowledgement, summary) or when the handover names them: actor_ref = the clinician's OHN-06 practitioner id (from their own token), patient_ref = the triage patient, facility_ref = the ticket's facility, evidence_ref = the OHN-61 ticket id, valid_from = now - 1 minute, expires_at = valid_from + the facility's OHN-61 care_team_relationship_hours (default 24). Audited here as relationship.register.

Operation ID: ohn16_registerRelationship

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Assertion registered
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/access/relationships/{id}/revoke

Revokes an assertion (role relationship_registrar; 1.3.0: also care_team_registrar, for assertions it registered itself only: asserted_by must be the caller, otherwise 404 not_found, never disclosing the assertion). expected_version is the assertion's current version; a second revoke answers 409 already_revoked, which a service caller such as OHN-61 treats as done. Audited as relationship.revoke.

Operation ID: ohn16_revokeRelationship

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Assertion revoked; later decisions deny with relationship_revoked
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error

Emergency

OHN-16-W003

GET/api/ohn/v1/access/emergency-exceptions

Operation ID: ohn16_listEmergencyExceptions

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Page of emergency exceptions
application/json: Page
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
POST/api/ohn/v1/access/emergency-exceptions/{id}/review

bounded_grant -> post_review. The reviewer must not be the person the grant was for.

Operation ID: ohn16_reviewEmergencyException

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200Review recorded
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error

Reports

GET/api/ohn/v1/access/reports/{reportId}

OHN-16-R001 decision distribution (filters country, facility, from, to, action), OHN-16-R002 authorization regression (release, resource_type), OHN-16-R003 privileged policy changes (from, to, author). A country other than the caller's returns no rows. Metric formulas are in modules/OHN-16/adr/0005-report-formulas.md.

Operation ID: ohn16_getReport

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003"yes
countryquerystring (uuid)no
facilityquerystring (uuid)no
fromquerystring (date-time)no
toquerystring (date-time)no
actionquerystringno
authorquerystring (uuid)no
releasequerystringno
resource_typequerystringno
cursorquerystringnoOpaque cursor from next_cursor.

Responses

CodeDescriptionMedia type
200Report
application/json: Report
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
POST/api/ohn/v1/access/reports/{reportId}/export

Creates a signed CSV or PDF export, audited, retrievable only by the same principal for five minutes.

Operation ID: ohn16_createExport

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003"yes
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Export ready
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
GET/api/ohn/v1/access/exports/{token}

Operation ID: ohn16_downloadExport

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200The export file; every download is audited
application/json: object
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
410Export link expired
application/json: Error
500Export failed its integrity check (export_integrity_failed)
application/json: Error

Support

GET/api/ohn/v1/access/vocabulary

Operation ID: ohn16_getVocabulary

Authentication: bearerAuth

Responses

CodeDescriptionMedia type
200Controlled vocabularies used by the forms (ADR-0001)
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
GET/api/ohn/v1/access/context

Operation ID: ohn16_getCallerContext

Authentication: bearerAuth

Responses

CodeDescriptionMedia type
200The caller's tenant, role and permitted actions
application/json: object
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
POST/api/ohn/v1/access/synthetic/actors

Seeds the OHN-05/06 test fake. Returns 404 unless the service runs with synthetic dependencies.

Operation ID: ohn16_seedSyntheticActor

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Fake actor stored in memory
application/json: object
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
POST/api/ohn/v1/access/synthetic/consents

Seeds the OHN-15 test fake. Returns 404 unless the service runs with synthetic dependencies.

Operation ID: ohn16_seedSyntheticConsent

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
201Fake consent stored in memory
application/json: object
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error

Marks

Enforcement of the watermark_export obligation: document marks (security watermark) for printouts and exports, and their public verification

POST/api/ohn/v1/access/marks

Asked before every printout or export. Evaluates an "export" of the named resource against the published policy and answers whether the security watermark is required: when the permit carries the obligation watermark_export, and also when the decision is deny or indeterminate or cannot be evaluated at all (fail closed). Only a permit without the obligation answers required=false. A required mark carries a verification code that /access/marks/verify resolves, an Ed25519 signature over the canonical payload, and the OHN-45 registration when OHN-45 answers. Facilities cannot switch the mark off. Roles: document_printer (purpose document_marking; actor and facility are the token's own) and policy_enforcement_point (purpose access_enforcement; marks a download on behalf of actor_ref at facility_ref, used by the platform export filter). 1.2.0 (2026-11-23): role inspection_printer (purpose inspection_marking), the read-only inspector's print-only grant, marks like a document_printer; its mark is always issued (basis inspection_copy when the policy would not require it) and the text ends with " · INSPECTION COPY". The enforcement point asks for the same with inspection_copy=true (the platform export filter does so for an inspector's download). The public verification answers inspection_copy.

Operation ID: ohn16_issueMark

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesSame key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409.

Request body (required)

Responses

CodeDescriptionMedia type
200No mark required (permit without watermark_export)
application/json: MarkResult
201Mark required and issued
application/json: MarkResult
401Missing, invalid or expired bearer token
application/json: Error
403Denied by role, purpose of use, tenant scope or dual control. The denial is audited.
application/json: Error
409Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made.
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error
POST/api/ohn/v1/access/marks/verify

Public check of the verification code printed in a security watermark (no sign-in, rate limited per address). Answers only what the paper shows: who printed it, the facility code, when, the channel and the title. result is valid (local signature and OHN-45 agree), unverified (recorded but unsigned, unregistered or OHN-45 unavailable) or invalid. Every check is recorded.

Operation ID: ohn16_verifyMark

Request body (required)

Responses

CodeDescriptionMedia type
200The recorded mark
application/json: MarkVerification
404Not found in the caller's scope (also returned for unknown routes)
application/json: Error
422Field validation failure or domain refusal; details names the fields
application/json: Error
429Per-principal rate limit exceeded
application/json: Error

Schemas

Error

Machine code in `error` (unauthenticated, forbidden, not_found, domain_validation_failed, invalid_filter, version_conflict, invalid_transition, dual_control_violation, conflict, idempotency_key_required, idempotency_key_reused, request_in_progress, rate_limited, dependency_unavailable, ...). The Java service answers application/problem+json and adds type, title, status, detail and trace_id.

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsanyno422 domain_validation_failed: {formErrors: string[], fieldErrors: {field: string[]}} (zod flatten, unknown keys are a form error); 422 invalid_filter: the same shape; 422 for a rule condition: {conditions: string[]}; 409 version_conflict: {current_version}; 409 invalid_transition: {state, allowed_from}; 503: none.

Decision

"permit" | "deny" | "indeterminate"

BundleState

"draft" | "peer_review" | "simulation_passed" | "dual_approved" | "published" | "deprecated" | "revoked"

ResourceType

"patient_record" | "clinical_document" | "observation" | "medication" | "encounter" | "consent_record" | "patient_export" | "search_index" | "policy_bundle" | "jurisdiction_config" | "audit_log" | "report_export"

Action

"read" | "create" | "update" | "delete" | "export" | "search" | "share"

Purpose

"treatment" | "payment" | "operations" | "public_health" | "research" | "patient_access" | "emergency_treatment" | "administration"

PolicyEffect

"permit" | "deny" | "emergency_permit"

ObligationType

"audit_access" | "mask_fields" | "notify_patient" | "require_post_review" | "limit_scope" | "watermark_export"

Receipt

NameTypeRequiredDescription
receipt_idstring (uuid)yes
committed_atstring (date-time)yes
aggregate_idstring (uuid)yes
aggregate_typestringyes
versionintegeryes
status"committed" | "denied" | "pending"yes

Page

NameTypeRequiredDescription
itemsarray of objectyes
next_cursorstring | nullyes

ApprovalCommand

NameTypeRequiredDescription
expected_versionintegeryes
commentstringno

ExceptionReviewCommand

NameTypeRequiredDescription
expected_versionintegeryes
outcome"justified" | "not_justified"yes
reasonstringyes

ExportCommand

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersobjectno

SyntheticActorCommand

NameTypeRequiredDescription
actor_refstring (uuid)yes
rolesarray of stringyes
facility_refsarray of string (uuid)yes
status"active" | "suspended"no

SyntheticConsentCommand

NameTypeRequiredDescription
patient_refstring (uuid)yes
purposePurposeyes
status"granted" | "withdrawn" | "unknown"yes

MarkCommand

NameTypeRequiredDescription
channel"print" | "csv" | "pdf" | "json"yes
resource_typeResourceTypeyes
resource_refstring (uuid)yes
patient_refstring (uuid)no
purposePurposeyes
facility_codestringnoThe OHN-05 facility code printed in the mark
document_titlestringno
document_sha256stringno
actor_refstring (uuid)nopolicy_enforcement_point only (required there); a document_printer is always the token subject.
actor_namestringnopolicy_enforcement_point only; a document_printer's name is the attested display_name of the token.
facility_refstring (uuid)nopolicy_enforcement_point only (required there); a document_printer is always marked at the token's organization.
inspection_copybooleannopolicy_enforcement_point only (1.2.0): the download is a read-only inspector's copy; the mark is always issued and says INSPECTION COPY

MarkResult

NameTypeRequiredDescription
requiredbooleanyes
basis"policy_obligation" | "fail_closed" | "no_obligation" | "inspection_copy"yes
basis_reasonstringno
decisionstring | nullno
decision_idstring | null (uuid)no
receiptReceiptno
event_idstring (uuid)no
markMarkResult.markno

MarkVerifyCommand

NameTypeRequiredDescription
codestringyes

MarkVerification

NameTypeRequiredDescription
codestringyes
result"valid" | "unverified" | "invalid"yes
signature"verified_by_ohn45" | "signed_not_registered" | "registry_unavailable" | "unsigned" | "invalid"yes
printed_bystringno
facility_codestring | nullno
printed_atstring (date-time)no
channel"print" | "csv" | "pdf" | "json"no
document_titlestring | nullno
copybooleanno
messagestringno

DecisionRequest

OHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data.

NameTypeRequiredDescription
actor_refstring (uuid)yes
patient_refstring (uuid)no
resource_refstring (uuid)yes
resource_typeResourceTypeyes
actionActionyes
facility_refstring (uuid)yesA claim until the directory confirms the affiliation.
purposePurposeyes
relationship_evidencestring (uuid)no
resource_facility_refstring (uuid)no
emergencyDecisionRequest.emergencyno

DecisionResult

NameTypeRequiredDescription
idstring (uuid)yes
decisionDecisionyes
reason_codestringyes
simulatedbooleanyes
patient_ref_maskedstring | nullyesLast four characters only.
policy_bundle_idstring | null (uuid)yes
policy_versionstring | nullyes
matched_rule_idstring | null (uuid)yes
failed_clausestring | nullyes
obligationsarray of DecisionResult.obligations.itemyes
tracearray of DecisionResult.trace.itemno
workflow_state"authenticated" | "context_resolved" | "country_policy_applied" | "permit_or_deny" | "obligations_recorded"yes
emergency_exception_idstring | null (uuid)no
grant_expires_atstring | null (date-time)yes
receiptReceiptno
event_idstring | null (uuid)no
cacheDecisionResult.cacheno

BundleCreateCommand

NameTypeRequiredDescription
namestringyes
revisionstringyes
change_summarystringyes
emergency_grant_minutesintegernoNo default. When absent
consent_required_for_phibooleanno
clone_fromstring (uuid)no

RuleCommand

OHN-16-F001

NameTypeRequiredDescription
jurisdiction_idstring (uuid)yesMust equal the authenticated jurisdiction.
resource_typeResourceTypeyes
actionActionyes
purposePurposeyes
subject_conditionstringyesCondition language of ADR-0002.
resource_conditionstringyes
policy_effectPolicyEffectyes
obligationsarray of RuleCommand.obligations.itemno
expected_versionintegeryes

PublishCommand

OHN-16-F003

NameTypeRequiredDescription
policy_bundle_idstring (uuid)yes
revisionstringyes
test_evidence_refstring (uuid)yes
reviewer_astring (uuid)yes
reviewer_bstring (uuid)yes
effective_atstring (date-time)yesBetween the second approval and now; scheduled activation is not supported.
expected_versionintegeryes

VersionedCommand

NameTypeRequiredDescription
expected_versionintegeryes

ReasonedCommand

NameTypeRequiredDescription
expected_versionintegeryes
reasonstringyes

RelationshipCommand

NameTypeRequiredDescription
actor_refstring (uuid)yes
patient_refstring (uuid)yes
facility_refstring (uuid)yes
relationship_type"treating" | "consulting" | "care_team" | "administrative"yes
valid_fromstring (date-time)yes
expires_atstring (date-time)yesMust be after valid_from. Relationships are always time-bounded.
evidence_refstring (uuid)yes

FixtureCommand

NameTypeRequiredDescription
namestringyes
requestDecisionRequestyesOHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data.
contextFixtureCommand.contextyes
expected_decisionDecisionyes

Bundle

NameTypeRequiredDescription
idstring (uuid)yes
stateBundleStateyes
versionintegeryes
rulesarray of objectno
historyarray of objectno

BundleWithReceipt

NameTypeRequiredDescription
idstring (uuid)yes
stateBundleStateyes
versionintegeryes
rulesarray of objectno
historyarray of objectno
receiptReceiptyes
event_idsarray of string (uuid)no
delivery"pending_downstream_confirmation"no

Report

NameTypeRequiredDescription
report_id"OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003"yes
columnsarray of stringyes
rowsarray of objectyes
next_cursorstring | nullyes
summaryobjectyes
state"rendered" | "no_authorized_data"yes
generated_atstring (date-time)yes

MarkResult.mark defined inline

NameTypeRequiredDescription
idstring (uuid)yes
verify_codestringyes
verify_pathstringyes
channel"print" | "csv" | "pdf" | "json"yes
printed_bystringyes
facility_codestring | nullno
printed_atstring (date-time)yes
textstringyes"Printed by <name>, <facility code>, <date-time> · COPY · Verify <code>"
signature"unsigned" | "signed_not_registered" | "signed_and_registered"yes

DecisionRequest.emergency defined inline

NameTypeRequiredDescription
reasonstringyes

DecisionResult.obligations.item defined inline

NameTypeRequiredDescription
typeObligationTypeyes
parametersobjectyes

DecisionResult.trace.item defined inline

NameTypeRequiredDescription
stepstringyes
outcome"ok" | "deny" | "indeterminate" | "info"yes
detailstringyes

DecisionResult.cache defined inline

NameTypeRequiredDescription
ttl_seconds0yes

RuleCommand.obligations.item defined inline

NameTypeRequiredDescription
typeObligationTypeyes
parametersobjectno

FixtureCommand.context defined inline

NameTypeRequiredDescription
jurisdiction"active" | "unavailable"no
actorobject | nullyes
relationshipobject | nullyes
consent"granted" | "withdrawn" | "unknown" | "unavailable"yes