← All contracts
OHN-07 Network Organization and Membership Registry
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-07/api/openapi.yaml- Servers
https://opeshealthnetwork.com/api/ohn/v1/network-registry
- Authentication
bearer: http bearer (JWT)
Download the contract (YAML)
Contracts are written in English.
Authoritative registry of network organizations, hierarchy, member agreements and endpoints.
All paths are jurisdiction-scoped to the bearer principal. Every POST requires `Idempotency-Key`
(successful responses are replayed; key reuse with another body = 409). Version-checked writes take
`expected_version` and return 409 `concurrent_mutation` on a stale version. Errors: 401 unauthenticated,
403 denied_by_policy / separation_of_duties, 404 not_found, 409 concurrent_mutation / invalid_transition /
duplicate / membership_not_active / challenge_expired, 422 domain_validation_failed (zod `details`) /
untrusted_assessment / untrusted_certificate / challenge_mismatch / policy_refused, 429 rate_limited,
503 not_configured (names the OHN07_* setting) / dependency_unavailable / server_unavailable.
Operations
Other operations
POST/auth/tokenSynthetic sign-in (404 unless OHN07_SYNTHETIC_AUTH=true and NODE_ENV!=production)
Responses
| Code | Description | Media type |
|---|
200 | token | — |
404 | disabled | — |
422 | invalid | — |
GET/configPolicy configuration
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/dashboardP001 KPIs, status distribution, 14-day trend, exceptions
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/organizationsList organizations
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
limit | query | integer | no | |
offset | query | integer | no | |
q | query | string | no | |
organization_type | query | string | no | |
state | query | MembershipState | no | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
POST/organizationsF001 organization application (creates organization + membership in state applied; emits organization.updated)
Operation ID: OHN-07-API-001
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | created | — |
403 | other jurisdiction | — |
409 | duplicate registry_ref | — |
422 | validation | — |
503 | dependency or policy unavailable | — |
GET/organizations/treeP002 hierarchy (roots with nested children)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/organizations/{id}Organization detail with ancestors
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
404 | not in scope | — |
POST/organizations/{id}/amendAmend organization (cycle-safe parent change; emits organization.updated)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
409 | stale | — |
422 | cycle or validation | — |
GET/organizations/{id}/certificatesCertificate picker source: the organization's certificates held by OHN-39 (GET /api/ohn/v1/trust/certificates, organization-scoped). certificate_ref is the value POST /endpoints checks; usable = active, current/rollover/overlap and not expired. Audited (certificate.list).
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
404 | not in scope | — |
503 | OHN-39 unavailable | — |
GET/organizations/{id}/standingRouting decision for an organization (roles network_service
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | |
GET/routing-decisionsRouting decision by organization_id or endpoint_url
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
organization_id | query | string (uuid) | no | |
endpoint_url | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | ok | |
GET/membershipsList memberships
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | MembershipState | no | |
limit | query | integer | no | |
offset | query | integer | no | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
POST/membershipsF002 membership approval — signs agreement version n+1 (trust_assessed → agreement_signed, or amendment while active)
Operation ID: OHN-07-API-002
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | signed | — |
403 | role or separation_of_duties | — |
409 | state or version | — |
422 | untrusted_assessment or validation | — |
GET/memberships/{id}Membership with organization
Operation ID: OHN-07-API-003
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
404 | not in scope | — |
POST/memberships/{id}/transitionsW001 steps: documents_verified (officer), trust_assessed (reviewer, OHN-39 check), active (officer; emits membership.approved)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
403 | wrong role | — |
409 | invalid transition | — |
422 | untrusted | — |
POST/memberships/{id}/suspensionsF004 open suspension review (officer; active → suspension_review; routing blocked immediately)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | ok | — |
409 | not active | — |
POST/memberships/{id}/revokeRevoke (reviewer ≠ requester): disables endpoints, terminates agreements, emits membership.revoked; 200 when downstream confirmed, 202 when pending
Operation ID: OHN-07-API-004
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | downstream_notified | — |
202 | revoked | — |
403 | separation_of_duties | — |
POST/memberships/{id}/reinstateReinstate after review (reviewer ≠ requester)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | active again | — |
GET/agreementsList agreements
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
organization_id | query | string | no | |
status | query | "approved" | "terminated" | no | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/agreements/diffP007 field diff between two agreement versions
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
organization_id | query | string | yes | |
from_version | query | integer | no | |
to_version | query | integer | no | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/endpointsP006 server-paginated endpoint list (filters state, service_type, environment, organization_id, q; sort endpoint_url|state|certificate_expires_at|created_at, dir)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
POST/endpointsF003 register endpoint (active member, OHN-39-trusted certificate, https)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | registered | — |
409 | membership_not_active | — |
422 | untrusted_certificate | — |
GET/endpoints/{id}Endpoint detail with probes and history
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
POST/endpoints/{id}/challengeW002 issue ownership challenge (officer); returns one-time token and publish_at
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
200 | challenge_sent | — |
POST/endpoints/{id}/proveW002 submit challenge_response (officer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ownership_proved | — |
409 | challenge_expired | — |
422 | challenge_mismatch | — |
POST/endpoints/{id}/policy-checkW002 attestation checks (reviewer): OHN-39 certificate trusted and unexpired, environment permitted, https
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | policy_checked | — |
422 | policy_refused with checks | — |
POST/endpoints/{id}/enableW002 enable (reviewer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | enabled | — |
POST/endpoints/{id}/disableDisable endpoint with reason
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | disabled | — |
POST/endpoints/{id}/probesRecord a reachability probe for an enabled endpoint (officer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | recorded | — |
GET/auditAudit receipts (filter resource_id)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
GET/outboxPending outbox events (status=all for all)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
POST/outbox/dispatchRetry delivery of pending events (reviewer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | {published, pending} | — |
GET/reports/{id}R001/R002/R003 with metrics and provenance
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | "OHN-07-R001" | "OHN-07-R002" | "OHN-07-R003" | yes | |
Responses
| Code | Description | Media type |
|---|
200 | ok | — |
404 | unknown | — |
POST/reports/{id}/exportSigned CSV/PDF export (HMAC-SHA256, OHN07_EXPORT_SIGNING_KEY); returns single-use 5-minute retrieval path
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | ok | — |
503 | not_configured | — |
GET/exports/{token}Download once (same principal); X-OHN-Export-Signature header
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | file | — |
404 | expired or used | — |
Schemas
Receipt
| Name | Type | Required | Description |
|---|
receipt_id | Uuid | yes | |
committed_at | string (date-time) | yes | |
aggregate_type | string | yes | |
aggregate_id | string | yes | |
version | integer | yes | |
status | "committed" | "pending" | yes | |
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
details | object | no | |
setting | string | no | |
MembershipState
"applied" | "documents_verified" | "trust_assessed" | "agreement_signed" | "active" | "suspension_review" | "revoked" | "downstream_notified"
EndpointState
"registered" | "challenge_sent" | "ownership_proved" | "policy_checked" | "enabled" | "disabled"
OrganizationApplication
| Name | Type | Required | Description |
|---|
legal_name | string | yes | |
jurisdiction_id | Uuid | yes | |
organization_type | string | yes | Member of OHN07_ORGANIZATION_TYPES. |
registry_ref | string | yes | Must resolve in OHN-05. |
accountable_officer | Uuid | yes | |
terms_version | string | yes | |
parent_organization_id | Uuid | null | no | |
OrganizationAmend
| Name | Type | Required | Description |
|---|
legal_name | string | no | |
organization_type | string | no | |
registry_ref | string | no | |
accountable_officer | Uuid | no | |
terms_version | string | no | |
parent_organization_id | Uuid | null | no | |
expected_version | integer | yes | |
reason | string | yes | |
MembershipApproval
| Name | Type | Required | Description |
|---|
organization_id | Uuid | yes | |
agreement_ref | Uuid | yes | |
trust_assessment_id | Uuid | yes | |
approved_scope | string | yes | |
reviewer | Uuid | yes | Must equal the bearer principal. |
expected_version | integer | yes | |
Transition
| Name | Type | Required | Description |
|---|
to_state | "documents_verified" | "trust_assessed" | "active" | yes | |
expected_version | integer | yes | |
reason | string | yes | |
trust_assessment_id | Uuid | no | |
Suspension
| Name | Type | Required | Description |
|---|
organization_id | Uuid | yes | |
suspension_reason | string | yes | |
effective_at | string (date-time) | yes | |
affected_endpoints | string | yes | |
expected_version | integer | yes | |
Decision
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
reason | string | yes | |
EndpointRegistration
| Name | Type | Required | Description |
|---|
organization_id | Uuid | yes | |
endpoint_url | string (uri) | yes | |
service_type | string | yes | |
environment | string | yes | |
certificate_ref | Uuid | yes | |
jurisdiction_id | Uuid | yes | |
Step
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
Standing
Routing decision contract v1.0.0 for clinical gateways (OHN-20 etc.). Never cache beyond cache_ttl_seconds (0).
| Name | Type | Required | Description |
|---|
contract_version | "1.0.0" | yes | |
organization_id | Uuid | yes | |
jurisdiction_id | Uuid | no | |
legal_name | string | no | |
membership_state | MembershipState | "none" | yes | |
trust_tier | string | null | no | |
membership_active | boolean | no | |
routable | boolean | yes | true only if membership active AND at least one enabled endpoint with unexpired certificate. |
reason | "active_member" | "no_enabled_endpoint" | "not_a_member" | "unknown_endpoint" | "membership_applied" | "membership_documents_verified" | "membership_trust_assessed" | "membership_agreement_signed" | "membership_suspension_review" | "membership_revoked" | "membership_downstream_notified" | "endpoint_registered" | … | yes | |
enabled_endpoints | array of Standing.enabled_endpoints.item | yes | |
evaluated_at | string (date-time) | yes | |
cache_ttl_seconds | 0 | yes | |
Standing.enabled_endpoints.item defined inline
| Name | Type | Required | Description |
|---|
id | string | no | |
endpoint_url | string | no | |
service_type | string | no | |
environment | string | no | |
certificate_expires_at | string | null | no | |