OHN-45 Cryptographic Trust Services
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-45/api/openapi.yaml- Servers
https://opeshealthnetwork.com- Authentication
bearerAuth: http bearer (JWT)
Contracts are written in English.
Synthetic-ready trust service contracts. Production use requires accepted OHN-01/OHN-38/OHN-16 integrations and security authorization.
Operations
- Other operations (17)
Other operations
GET/api/ohn/v1/crypto/health
Operation ID: ohn45_health
Responses
| Code | Description | Media type |
|---|---|---|
200 | Service health | application/json: object |
POST/api/ohn/v1/crypto/auth/token
Available only outside production when OHN45_SYNTHETIC_AUTH=true.
Operation ID: ohn45_issueSyntheticToken
Request body (required)
application/json:SyntheticTokenCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Synthetic token | application/json: post-api-ohn-v1-crypto-auth-token.response-200 |
404 | Non-disclosing not-found response | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
POST/api/ohn/v1/crypto/keys/register
Operation ID: ohn45_registerKey
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:KeyRegistrationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Key registered in requested state | application/json: KeyView |
400 | Malformed request | application/json: Error |
401 | Unauthenticated | application/json: Error |
403 | Default-deny policy refusal | application/json: Error |
409 | Stale version or idempotency conflict | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
429 | Retry after the stated window | application/json: Error |
503 | Dependency unavailable; no fabricated success | application/json: Error |
GET/api/ohn/v1/crypto/certificates
Read-only, jurisdiction-wide list of certificates/keys other modules may reference (OHN-30 insurer endpoints). Active keys only; label, purpose, owner organisation, expiry (certificate expiry, else activation + rotation interval). Never the KMS/HSM reference or the key owner. Roles key_custodian, security_officer, and certificate_reader (gateway service tokens only, token_use=service, purpose certificate_reference; it can read nothing else). Audited.
Operation ID: ohn45_listCertificates
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
purpose | query | string | no | |
include_inactive | query | boolean | no | staff roles only |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Certificates | application/json: get-api-ohn-v1-crypto-certificates.response-200 |
401 | Unauthenticated | application/json: Error |
403 | Default-deny policy refusal | application/json: Error |
422 | Malformed purpose | — |
GET/api/ohn/v1/crypto/key-status
Operation ID: ohn45_getKeyStatus
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string (uuid) | no | |
page_size | query | integer | no | |
service_id | query | string (uuid) | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Scoped key status and operational evidence | application/json: KeyStatusResponse |
401 | Unauthenticated | application/json: Error |
403 | Default-deny policy refusal | application/json: Error |
429 | Retry after the stated window | application/json: Error |
503 | Dependency unavailable; no fabricated success | application/json: Error |
POST/api/ohn/v1/crypto/artifacts
Operation ID: ohn45_registerArtifact
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ArtifactCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Artifact reference created | application/json: ArtifactView |
422 | Field or domain validation failed | application/json: Error |
GET/api/ohn/v1/crypto/signaturesSigned items of the organisation with their last check (F003 chooses from it). Never the content, the signature value or the public key.
Operation ID: ohn45_listSignedItems
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Signed items | application/json: SignedItemList |
401 | Unauthenticated | application/json: Error |
403 | Default-deny policy refusal | application/json: Error |
POST/api/ohn/v1/crypto/signatures
Operation ID: ohn45_registerSignature
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:SignatureCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Public signature evidence registered | application/json: SignatureView |
404 | Non-disclosing not-found response | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
POST/api/ohn/v1/crypto/signatures/verify
Operation ID: ohn45_verifySignature
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:SignatureVerificationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Real verification result; no artifact or public key content returned | application/json: VerificationView |
404 | Non-disclosing not-found response | application/json: Error |
409 | Stale version or idempotency conflict | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
POST/api/ohn/v1/crypto/keys/rotate
Operation ID: ohn45_rotateKey
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:KeyRotationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Dual-approved rollover created | application/json: WorkflowView |
404 | Non-disclosing not-found response | application/json: Error |
409 | Stale version or idempotency conflict | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
POST/api/ohn/v1/crypto/keys/revoke
Operation ID: ohn45_revokeKey
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:KeyRevocationCommand
Responses
POST/api/ohn/v1/crypto/workflows/{id}/transitions
Operation ID: ohn45_transitionWorkflow
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:WorkflowTransitionCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Transition committed | application/json: WorkflowView |
404 | Non-disclosing not-found response | application/json: Error |
409 | Stale version or idempotency conflict | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
GET/api/ohn/v1/crypto/rotationsPlanned key rotations with who asked, both named approvers, their decisions and whether the caller must decide (P004).
Operation ID: ohn45_listRotations
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Rotations | application/json: RotationList |
401 | Unauthenticated | application/json: Error |
403 | Default-deny policy refusal | application/json: Error |
POST/api/ohn/v1/crypto/rotations/{id}/approvalsA named approver records their own decision once (approved or rejected, reason 10-4096). The requester and anyone not named are refused (403). One refusal closes the rotation as rejected and the old key is active again. The rollover cannot leave rotation_due before both approved (transition answers 422 approvals_pending).
Operation ID: ohn45_decideRotation
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:RotationApprovalCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Decision recorded | application/json: post-api-ohn-v1-crypto-rotations-id-approvals.response-201 |
403 | Default-deny policy refusal | application/json: Error |
404 | Non-disclosing not-found response | application/json: Error |
409 | Stale version or idempotency conflict | application/json: Error |
422 | Field or domain validation failed | application/json: Error |
GET/api/ohn/v1/crypto/reports/{id}
Operation ID: ohn45_getReport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | "OHN-45-R001" | "OHN-45-R002" | "OHN-45-R003" | yes | |
service_id | query | string (uuid) | no | |
period_from | query | string (date-time) | no | |
period_to | query | string (date-time) | no |
Responses
POST/api/ohn/v1/crypto/reports/{id}/export
Operation ID: ohn45_createExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | "OHN-45-R001" | "OHN-45-R002" | "OHN-45-R003" | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ExportCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Signed one-time five-minute retrieval created | application/json: ExportReceipt |
403 | Default-deny policy refusal | application/json: Error |
503 | Dependency unavailable; no fabricated success | application/json: Error |
GET/api/ohn/v1/crypto/exports/{token}
Operation ID: ohn45_downloadExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Signed private export; single successful download only | text/csv: stringapplication/pdf: string |
404 | Non-disclosing not-found response | application/json: Error |
Schemas
SignedItemList
| Name | Type | Required | Description |
|---|---|---|---|
total | integer | yes | |
data | array of SignedItemList.data.item | yes |
RotationApprovalCommand
| Name | Type | Required | Description |
|---|---|---|---|
decision | "approved" | "rejected" | yes | |
reason | string | yes |
RotationDetail
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
key_ref | string (uuid) | yes | |
new_key_ref | string (uuid) | yes | |
planned_cutover_at | string (date-time) | yes | |
rollback_plan | string | no | |
state | "rotation_due" | "new_key_generated" | "consumers_migrated" | "old_deactivated" | "verified" | "rejected" | yes | |
version | integer | yes | |
created_at | string (date-time) | no | |
requested_by | string | null (uuid) | no | |
approval_status | "pending" | "approved" | "rejected" | yes | |
awaiting_my_decision | boolean | yes | |
approvals | array of RotationDetail.approvals.item | yes |
RotationList
| Name | Type | Required | Description |
|---|---|---|---|
total | integer | yes | |
data | array of RotationDetail | yes |
Uuid
string (uuid)
Error
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
message | string | no | |
details | object | no |
Receipt
KeyRegistrationCommand
KeyRotationCommand
key_ref differs from new_key_ref; approvers are distinct and exclude the requesting operator.
SignatureVerificationCommand
KeyRevocationCommand
ArtifactCommand
| Name | Type | Required | Description |
|---|---|---|---|
artifact_type | "signed_export" | "clinical_document" | "certificate" | yes | |
content_base64 | string | yes |
SignatureCommand
WorkflowTransitionCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
to_state | string | yes | |
evidence_ref | Uuid | yes | |
reason | string | yes |
ExportCommand
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
service_id | Uuid | no | |
period_from | string (date-time) | no | |
period_to | string (date-time) | no |
SyntheticTokenCommand
KeyView
KeyStatusResponse
| Name | Type | Required | Description |
|---|---|---|---|
data | array of KeyView | yes | |
next_cursor | string | null (uuid) | yes | |
page_size | integer | yes | |
summary | object | yes | |
rotations | array of object | yes | |
verifications | array of object | yes | |
leases | array of object | yes | |
workflows | array of object | yes | |
provenance | object | yes |
ArtifactView
| Name | Type | Required | Description |
|---|---|---|---|
id | Uuid | no | |
artifact_type | string | no | |
created_at | string (date-time) | no |
SignatureView
VerificationView
WorkflowView
Report
| Name | Type | Required | Description |
|---|---|---|---|
report_id | "OHN-45-R001" | "OHN-45-R002" | "OHN-45-R003" | yes | |
data | array of object | yes | |
metrics | object | yes | |
provenance | object | yes |
ExportReceipt
| Name | Type | Required | Description |
|---|---|---|---|
receipt | Receipt | yes | |
retrieval | ExportReceipt.retrieval | yes | |
signature | ExportReceipt.signature | yes |
post-api-ohn-v1-crypto-auth-token.response-200 defined inline
| Name | Type | Required | Description |
|---|---|---|---|
access_token | string | yes |
get-api-ohn-v1-crypto-certificates.response-200 defined inline
| Name | Type | Required | Description |
|---|---|---|---|
data | array of get-api-ohn-v1-crypto-certificates.response-200.data.item | yes | |
total | integer | yes | |
generated_at | string (date-time) | yes |
get-api-ohn-v1-crypto-certificates.response-200.data.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
label | string | yes | |
key_purpose | string | yes | |
service_id | string (uuid) | yes | |
organization_id | string (uuid) | yes | |
status | string | yes | |
expires_at | string | null (date-time) | yes | |
expired | boolean | yes | |
rotation_due | boolean | yes |
post-api-ohn-v1-crypto-rotations-id-approvals.response-201 defined inline
| Name | Type | Required | Description |
|---|---|---|---|
rotation | RotationDetail | yes | |
decision | "approved" | "rejected" | yes | |
state | string | yes | |
version | integer | yes | |
receipt | object | yes |
SignedItemList.data.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
artifact_ref | string (uuid) | yes | |
artifact_type | "signed_export" | "clinical_document" | "certificate" | yes | |
artifact_created_at | string (date-time) | no | |
trusted_signer_ref | string (uuid) | yes | |
algorithm | "Ed25519" | yes | |
signed_at | string (date-time) | yes | |
checks | integer | yes | |
last_check | null | SignedItemList.data.item.last_check.option-2 | yes |
SignedItemList.data.item.last_check.option-2 defined inline
| Name | Type | Required | Description |
|---|---|---|---|
result | "valid" | "invalid" | no | |
failure_cause | string | null | no | |
purpose | string | no | |
verified_at | string (date-time) | no |
RotationDetail.approvals.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
approver_id | string (uuid) | no | |
decision | "approved" | "rejected" | null | no | |
reason | string | null | no | |
decided_at | string | null (date-time) | no |
ExportReceipt.retrieval defined inline
| Name | Type | Required | Description |
|---|---|---|---|
path | string | yes | |
expires_at | string (date-time) | yes |
ExportReceipt.signature defined inline
| Name | Type | Required | Description |
|---|---|---|---|
algorithm | "HMAC-SHA256" | yes | |
value | string | yes | |
key_ref | string | yes |