Skip to content

← 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

CodeDescriptionMedia type
200token—
404disabled—
422invalid—
GET/configPolicy configuration

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
GET/dashboardP001 KPIs, status distribution, 14-day trend, exceptions

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
GET/organizationsList organizations

Authentication: bearer

Parameters

NameInTypeRequiredDescription
limitqueryintegerno
offsetqueryintegerno
qquerystringno
organization_typequerystringno
statequeryMembershipStateno

Responses

CodeDescriptionMedia type
200ok—
POST/organizationsF001 organization application (creates organization + membership in state applied; emits organization.updated)

Operation ID: OHN-07-API-001

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201created—
403other jurisdiction—
409duplicate registry_ref—
422validation—
503dependency or policy unavailable—
GET/organizations/treeP002 hierarchy (roots with nested children)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
GET/organizations/{id}Organization detail with ancestors

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok—
404not in scope—
POST/organizations/{id}/amendAmend organization (cycle-safe parent change; emits organization.updated)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
200ok—
409stale—
422cycle 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

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok—
404not in scope—
503OHN-39 unavailable—
GET/organizations/{id}/standingRouting decision for an organization (roles network_service

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok
application/json: Standing
GET/routing-decisionsRouting decision by organization_id or endpoint_url

Authentication: bearer

Parameters

NameInTypeRequiredDescription
organization_idquerystring (uuid)no
endpoint_urlquerystringno

Responses

CodeDescriptionMedia type
200ok
application/json: Standing
GET/membershipsList memberships

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequeryMembershipStateno
limitqueryintegerno
offsetqueryintegerno

Responses

CodeDescriptionMedia type
200ok—
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

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201signed—
403role or separation_of_duties—
409state or version—
422untrusted_assessment or validation—
GET/memberships/{id}Membership with organization

Operation ID: OHN-07-API-003

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok—
404not in scope—
POST/memberships/{id}/transitionsW001 steps: documents_verified (officer), trust_assessed (reviewer, OHN-39 check), active (officer; emits membership.approved)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
200ok—
403wrong role—
409invalid transition—
422untrusted—
POST/memberships/{id}/suspensionsF004 open suspension review (officer; active → suspension_review; routing blocked immediately)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
201ok—
409not 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

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
200downstream_notified—
202revoked—
403separation_of_duties—
POST/memberships/{id}/reinstateReinstate after review (reviewer ≠ requester)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
200active again—
GET/agreementsList agreements

Authentication: bearer

Parameters

NameInTypeRequiredDescription
organization_idquerystringno
statusquery"approved" | "terminated"no

Responses

CodeDescriptionMedia type
200ok—
GET/agreements/diffP007 field diff between two agreement versions

Authentication: bearer

Parameters

NameInTypeRequiredDescription
organization_idquerystringyes
from_versionqueryintegerno
to_versionqueryintegerno

Responses

CodeDescriptionMedia type
200ok—
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

CodeDescriptionMedia type
200ok—
POST/endpointsF003 register endpoint (active member, OHN-39-trusted certificate, https)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
201registered—
409membership_not_active—
422untrusted_certificate—
GET/endpoints/{id}Endpoint detail with probes and history

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok—
POST/endpoints/{id}/challengeW002 issue ownership challenge (officer); returns one-time token and publish_at

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: Step

Responses

CodeDescriptionMedia type
200challenge_sent—
POST/endpoints/{id}/proveW002 submit challenge_response (officer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200ownership_proved—
409challenge_expired—
422challenge_mismatch—
POST/endpoints/{id}/policy-checkW002 attestation checks (reviewer): OHN-39 certificate trusted and unexpired, environment permitted, https

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200policy_checked—
422policy_refused with checks—
POST/endpoints/{id}/enableW002 enable (reviewer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200enabled—
POST/endpoints/{id}/disableDisable endpoint with reason

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200disabled—
POST/endpoints/{id}/probesRecord a reachability probe for an enabled endpoint (officer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201recorded—
GET/auditAudit receipts (filter resource_id)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
GET/outboxPending outbox events (status=all for all)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
POST/outbox/dispatchRetry delivery of pending events (reviewer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200{published, pending}—
GET/reports/{id}R001/R002/R003 with metrics and provenance

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpath"OHN-07-R001" | "OHN-07-R002" | "OHN-07-R003"yes

Responses

CodeDescriptionMedia type
200ok—
404unknown—
POST/reports/{id}/exportSigned CSV/PDF export (HMAC-SHA256, OHN07_EXPORT_SIGNING_KEY); returns single-use 5-minute retrieval path

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201ok—
503not_configured—
GET/exports/{token}Download once (same principal); X-OHN-Export-Signature header

Authentication: bearer

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200file—
404expired or used—

Schemas

Uuid

string (uuid)

Receipt

NameTypeRequiredDescription
receipt_idUuidyes
committed_atstring (date-time)yes
aggregate_typestringyes
aggregate_idstringyes
versionintegeryes
status"committed" | "pending"yes

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsobjectno
settingstringno

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

NameTypeRequiredDescription
legal_namestringyes
jurisdiction_idUuidyes
organization_typestringyesMember of OHN07_ORGANIZATION_TYPES.
registry_refstringyesMust resolve in OHN-05.
accountable_officerUuidyes
terms_versionstringyes
parent_organization_idUuid | nullno

OrganizationAmend

NameTypeRequiredDescription
legal_namestringno
organization_typestringno
registry_refstringno
accountable_officerUuidno
terms_versionstringno
parent_organization_idUuid | nullno
expected_versionintegeryes
reasonstringyes

MembershipApproval

NameTypeRequiredDescription
organization_idUuidyes
agreement_refUuidyes
trust_assessment_idUuidyes
approved_scopestringyes
reviewerUuidyesMust equal the bearer principal.
expected_versionintegeryes

Transition

NameTypeRequiredDescription
to_state"documents_verified" | "trust_assessed" | "active"yes
expected_versionintegeryes
reasonstringyes
trust_assessment_idUuidno

Suspension

NameTypeRequiredDescription
organization_idUuidyes
suspension_reasonstringyes
effective_atstring (date-time)yes
affected_endpointsstringyes
expected_versionintegeryes

Decision

NameTypeRequiredDescription
expected_versionintegeryes
reasonstringyes

EndpointRegistration

NameTypeRequiredDescription
organization_idUuidyes
endpoint_urlstring (uri)yes
service_typestringyes
environmentstringyes
certificate_refUuidyes
jurisdiction_idUuidyes

Step

NameTypeRequiredDescription
expected_versionintegeryes

Standing

Routing decision contract v1.0.0 for clinical gateways (OHN-20 etc.). Never cache beyond cache_ttl_seconds (0).

NameTypeRequiredDescription
contract_version"1.0.0"yes
organization_idUuidyes
jurisdiction_idUuidno
legal_namestringno
membership_stateMembershipState | "none"yes
trust_tierstring | nullno
membership_activebooleanno
routablebooleanyestrue 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_endpointsarray of Standing.enabled_endpoints.itemyes
evaluated_atstring (date-time)yes
cache_ttl_seconds0yes

Standing.enabled_endpoints.item defined inline

NameTypeRequiredDescription
idstringno
endpoint_urlstringno
service_typestringno
environmentstringno
certificate_expires_atstring | nullno