Skip to content

← All contracts

OHN-24 Event and Subscription Infrastructure

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

Download the contract (JSON)

Contracts are written in English.

Transactional outbox, inbox deduplication, schema registry, subscriptions, webhook and pull delivery, controlled replay, dead letters. Default deny. Bearer authentication. Every POST needs an Idempotency-Key header (8-128 characters). Delivery is at least once.

Operations

Other operations

GET/subscriptionsList subscriptions

Operation ID: ohn-24_get_subscriptions

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statusquery"active" | "paused" | "revoked"no
cursorquerystringno

Responses

CodeDescriptionMedia type
200Page—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/subscriptionsCreate a subscription (F001)

Operation ID: ohn-24_post_subscriptions

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Created—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/subscriptions/simulatePermission simulator; persists nothing

Operation ID: ohn-24_post_subscriptions-simulate

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200deliver true/false with reason—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/subscriptions/{id}

Operation ID: ohn-24_get_subscriptions-id

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Subscription with history—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/subscriptions/{id}/transitionsPause, resume or revoke (revoked is final and cancels unfinished deliveries)

Operation ID: ohn-24_post_subscriptions-id-transitions

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/subscriptions/{id}/pullLease deliveries (event_subscriber of the subscriber organisation only)

Operation ID: ohn-24_post_subscriptions-id-pull

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
200Leased events: items[{delivery_id, lease_expires_at, event: envelope}] and subscription_status
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/deliveries/{id}/acknowledgeAcknowledge a leased delivery; repeating is harmless

Operation ID: ohn-24_post_deliveries-id-acknowledge

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Acknowledged—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/endpoints

Operation ID: ohn-24_get_endpoints

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/endpointsRegister a destination (HTTPS, public hosts only)

Operation ID: ohn-24_post_endpoints

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Created—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/event-schemas

Operation ID: ohn-24_get_event-schemas

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/event-schemasRegister a strict payload schema (root object, additionalProperties false)

Operation ID: ohn-24_post_event-schemas

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Created—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/eventsPublish an event (W001): schema check, inbox deduplication on (jurisdiction, source_system_id, source_event_id), event log, fan-out. 201 new, 200 duplicate, 409 source_event_conflict, 422 schema_not_registered

Operation ID: ohn-24_post_events

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Duplicate: original event returned—
201Accepted and persisted—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/events/deliveriesList deliveries

Operation ID: ohn-24_get_events-deliveries

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"enqueued" | "attempted" | "retrying" | "acknowledged" | "dead_lettered" | "cancelled"no
subscription_idquerystring (uuid)no
event_idquerystring (uuid)no
cursorquerystringno

Responses

CodeDescriptionMedia type
200Page—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/events/deliveries/{id}Delivery with attempts and history

Operation ID: ohn-24_get_events-deliveries-id

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/events/dead-letters

Operation ID: ohn-24_get_events-dead-letters

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"open" | "held" | "requeued" | "discarded"no
cursorquerystringno

Responses

CodeDescriptionMedia type
200Page—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/events/dead-letters/{id}/dispositionDisposition (F003, event_operator only). operator_ref must equal the authenticated operator

Operation ID: ohn-24_post_events-dead-letters-id-disposition

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/events/maintenance/dispatchDeliver due webhooks now; 409 dispatch_disabled unless delivery is enabled (ohn.m24.dispatch-enabled)

Operation ID: ohn-24_post_events-maintenance-dispatch

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Counts—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/events/maintenance/sweepRecover expired leases and reconcile replays (works with delivery disabled)

Operation ID: ohn-24_post_events-maintenance-sweep

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Counts—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/events/{id}/replayRequest a controlled replay (F002): authorized, range sized, dry run. Nothing is delivered yet

Operation ID: ohn-24_post_events-id-replay

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Dry-run result—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/replays

Operation ID: ohn-24_get_replays

Authentication: bearer

Parameters

NameInTypeRequiredDescription
cursorquerystringno

Responses

CodeDescriptionMedia type
200Page—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/replays/{id}

Operation ID: ohn-24_get_replays-id

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Replay with history and delivery states—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/replays/{id}/startStart a replay. Only the named approver (not the requester) may do this

Operation ID: ohn-24_post_replays-id-start

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Started—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
409Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
GET/events/reports/{reportId}Run a report (R001 delivery SLO, R002 replay accounting, R003 outbox backlog); 100 rows per page

Operation ID: ohn-24_get_events-reports-reportid

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-24-R001" | "OHN-24-R002" | "OHN-24-R003"yes
period_fromquerystring (date-time)noISO instant with offset
period_toquerystring (date-time)noISO instant with offset; not before period_from (compared as text)
subscriberquerystring (uuid)no
event_typequerystringnoR001 only
servicequerystring (uuid)noR003 only: the source system id
cursorquerystringno

Responses

CodeDescriptionMedia type
200Report—
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
POST/events/reports/{reportId}/exportSigned, single-use, five-minute export (csv|pdf)

Operation ID: ohn-24_post_events-reports-reportid-export

Authentication: bearer

Parameters

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

Request body (required)

Responses

CodeDescriptionMedia type
201download_path—
400400 idempotency_key_required, or 400 malformed_request for a body that is not JSON; 409 idempotency_key_reused / request_in_progress
application/json: Error
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
413413 payload_too_large: body over 512 kB
application/json: Error
422Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
503503 dependency_unavailable: Export signing is not configured
application/json: Error
GET/events/exports/{token}Download once, within five minutes, as the requester (404 for anyone else)

Operation ID: ohn-24_get_events-exports-token

Authentication: bearer

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200File
text/csv: string
application/pdf: string (binary)
401401 unauthenticated: no, invalid or expired token, a subject, jurisdiction or organization that is not a UUID, or an unknown role
application/json: Error
403403 denied_by_policy: role or purpose of use not permitted (audited)
application/json: Error
404Typed error: the platform problem+json superset of {error, message, details}
application/json: Error
410410 export_expired or export_consumed
application/json: Error
429429 rate_limited (Retry-After set)
application/json: Error
500500 export_integrity_failed
application/json: Error

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsobjectnoFirst failing check per top-level field, as the zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value), a domain reason or a custom message; unknown keys under "_" as unrecognized_keys
typestringno
titlestringno
statusintegerno
detailstringno
trace_idstringno

Classification

"public" | "internal" | "confidential" | "restricted" | "phi"

SubscriptionCommand

NameTypeRequiredDescription
subscriber_orgstring (uuid)yes
event_typestringyes
destination_endpointstring (uuid)yes
delivery_mode"webhook" | "pull"yes
scopestringyesJSON text: {organization_ids: uuid[1..50], max_classification}. organization_ids may only contain the creating organisation; no wildcard
max_retry_window_hoursintegeryesAt most the platform maximum (default 72)

PublishCommand

NameTypeRequiredDescription
event_typestringyes
schema_versionstringyes
occurred_atstring (date-time)yes
aggregate_idstring (uuid)yes
aggregate_versionintegeryes
correlation_idstring (uuid)yes
causation_idstring (uuid)yes
data_classificationClassificationyes
payloadobjectyes
source_system_idstring (uuid)yes
source_event_idstringyes

ReplayCommand

event_range_start must be before event_range_end; the range may not exceed the platform maximum (default 24 h); approved_by must differ from the requester (dual control)

NameTypeRequiredDescription
subscription_refstring (uuid)yes
event_range_startstring (date-time)yes
event_range_endstring (date-time)yes
replay_reasonstringyes
approved_bystring (uuid)yes
include_acknowledgedbooleanno

DispositionCommand

retry_after is only valid with resolution requeue (422 with the message as detail)

NameTypeRequiredDescription
dead_letter_idstring (uuid)yes
resolution"requeue" | "discard" | "hold"yes
operator_refstring (uuid)yes
remediation_notesstringyes
retry_afterstring (date-time)noOnly with requeue
expected_versionintegeryes

EndpointCommand

NameTypeRequiredDescription
subscriber_orgstring (uuid)yes
urlstringyeshttps only to public hosts; no credentials or fragment. Loopback and private hosts are refused unless the non-production switch is on
descriptionstringno

SchemaCommand

NameTypeRequiredDescription
event_typestringyes
schema_versionstringyes
payload_schemaobjectyesJSON-Schema subset: type, required, properties, additionalProperties (must be false at the root), enum, items, minLength, maxLength, minimum, maximum, description, format, title, $schema
descriptionstringno

TransitionCommand

NameTypeRequiredDescription
to_status"active" | "paused" | "revoked"yes
expected_versionintegeryes
reasonstringyes

PullCommand

NameTypeRequiredDescription
limitintegerno

ReplayStartCommand

NameTypeRequiredDescription
expected_versionintegeryes

SimulateCommand

NameTypeRequiredDescription
scopestringyes
event_typestringyes
event_classificationClassificationyes
event_organizationstring (uuid)no
subscription_status"active" | "paused" | "revoked"no

ExportCommand

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersobjectnoThe report filters (period_from, period_to, subscriber, event_type, service, cursor), string values of at most 128 characters; anything else is 422 Report filter is not valid

post-subscriptions-id-pull.response-200 defined inline

NameTypeRequiredDescription
itemsarray of anyno
subscription_status"active" | "paused" | "revoked"no