OHN-01 Country and Jurisdiction Management
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-01/api/openapi.yaml- Servers
https://opeshealthnetwork.com/api/ohn/v1- Authentication
gatewayToken: http bearer (JWT)
Contracts are written in English.
Written from the observed behaviour of the TypeScript reference (backend/modules/ohn-01, 2026-11-17). Reports (/jurisdictions/reports*) and the legacy /auth/token are NOT part of this version: reports are a pending gap (docs/program/java/ohn-01-analysis.md); /auth/token is retired (issued tokens to anyone) and replaced by Keycloak.
Operations
- jurisdictions (15)
- reports (4)
jurisdictions
GET/countries
Read by every OHN-01 role with action read, including the read-only service role country_reader (OHN-05 facility codes take the jurisdiction's country_code from here; owner decision 2026-11-23).
Operation ID: listCountries
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Countries | application/json: CountryPage |
401 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
403 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
GET/jurisdictions
Operation ID: listJurisdictionPolicies
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Policies | application/json: PolicyPage |
POST/jurisdictions
Operation ID: createCountry
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:CountryCommand
Responses
POST/jurisdictions/{id}/policies
Operation ID: publishPolicy
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:PolicyCommand
Responses
GET/jurisdictions/namespace-rules
Operation ID: listNamespaceRules
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
country_id | query | string (uuid) | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Rules newest first (capped at 500) | application/json: NamespaceRuleList |
422 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
POST/jurisdictions/namespace-rules
Operation ID: createNamespaceRule
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:NamespaceRuleCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Created | application/json: NamespaceRule |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
422 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
GET/jurisdictions/namespace-rules/{ruleId}
Operation ID: getNamespaceRule
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Rule with overlapping rules | application/json: NamespaceRuleDetail |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
POST/jurisdictions/{id}/activate
Operation ID: activateCountry
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Responses
POST/jurisdictions/{id}/suspendLegacy one-step route; now only records a suspension request (dual control)
Operation ID: suspendCountryLegacy
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:SuspendCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Suspension requested | application/json: Country |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
409 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
422 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
POST/jurisdictions/{id}/reinstate
Operation ID: reinstateCountry
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
GET/jurisdictions/{id}/history
Operation ID: getCountryHistory
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Audit trail oldest first | application/json: HistoryList |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
GET/jurisdictions/{id}/suspension-request
Operation ID: getSuspensionRequest
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | State | application/json: SuspensionState |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
POST/jurisdictions/{id}/suspension-request
Operation ID: requestSuspension
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
POST/jurisdictions/{id}/suspension-request/approve
Operation ID: approveSuspension
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
POST/jurisdictions/{id}/suspension-request/withdraw
Operation ID: withdrawSuspension
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
reports
GET/jurisdictions/reports
Operation ID: listReports
Authentication: gatewayToken
Responses
| Code | Description | Media type |
|---|---|---|
200 | Available reports | application/json: ReportList |
403 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
GET/jurisdictions/reports/{reportId}
Filters are strict; an unknown query parameter is refused with 422. Scope comes from the token jurisdiction claim (country id or *).
Operation ID: runReport
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | string | yes | |
jurisdiction | query | string | no | |
status | query | string | no | |
policy_domain | query | string | no | |
issuer | query | string | no | |
actor | query | string | no | |
date | query | string | no | |
period_from | query | string | no | |
period_to | query | string | no | |
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Report | application/json: Report |
403 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
422 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
POST/jurisdictions/reports/{reportId}/export
Operation ID: exportReport
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ExportCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Export created - single use and valid for five minutes | application/json: ExportReceipt |
404 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
422 | application/problem+json with the legacy `error` code | application/problem+json: Problem |
GET/jurisdictions/report-exports/{token}
Operation ID: downloadReportExport
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes |
Responses
Schemas
Problem
| Name | Type | Required | Description |
|---|---|---|---|
type | string | no | |
title | string | no | |
status | integer | no | |
detail | string | no | |
error | string | yes | unauthenticated | denied_by_policy | not_found | conflict | domain_validation_failed | missing_idempotency_key | idempotency_conflict | request_in_progress | no_pending_request | second_approver_required | payload_too_large | server_unavailable |
message | string | yes | |
trace_id | string | no | |
details | object | no |
CountryStatus
"draft" | "reviewed" | "approved" | "active" | "suspension_requested" | "suspended" | "reinstated" | "superseded"
Country
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
country_code | string | yes | |
country_name | string | yes | |
default_locale | string | yes | |
time_zone | string | yes | |
issuing_authority | string (uuid) | yes | |
activation_date | string | null (date-time) | no | |
status | CountryStatus | yes | |
version | integer | yes | |
created_at | string (date-time) | yes | |
updated_at | string (date-time) | yes |
CountryCommand
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | yes | |
country_name | string | yes | |
default_locale | string | yes | |
time_zone | string | yes | |
issuing_authority | string (uuid) | yes | |
activation_date | string (date-time) | no |
CountryPage
| Name | Type | Required | Description |
|---|---|---|---|
data | array of Country | yes | |
next_cursor | string | null | yes | |
page_size | integer | yes |
Policy
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
country_id | string (uuid) | no | |
policy_domain | string | no | |
policy_version | string | no | |
effective_from | string (date-time) | no | |
policy_document | string | no | |
reviewer_id | string (uuid) | no | |
reason | string | no | |
status | string | no | |
version | integer | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
PolicyCommand
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | yes | |
policy_domain | string | yes | |
policy_version | string | yes | |
effective_from | string (date-time) | yes | |
policy_document | string | yes | |
reviewer_id | string (uuid) | yes | |
reason | string | yes |
PolicyPage
| Name | Type | Required | Description |
|---|---|---|---|
data | array of Policy | no | |
next_cursor | string | null | no | |
page_size | integer | no |
NamespaceRule
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
country_id | string (uuid) | no | |
identifier_namespace | string | no | |
issuer_id | string (uuid) | no | |
format_pattern | string | no | |
uniqueness_scope | "country" | "jurisdiction" | "facility" | no | |
valid_from | string (date) | no | |
version | integer | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
NamespaceRuleCommand
| Name | Type | Required | Description |
|---|---|---|---|
country_id | string (uuid) | yes | |
identifier_namespace | string | yes | |
issuer_id | string (uuid) | yes | |
format_pattern | string | yes | |
uniqueness_scope | "country" | "jurisdiction" | "facility" | yes | |
valid_from | string (date) | yes |
NamespaceRuleList
| Name | Type | Required | Description |
|---|---|---|---|
data | array of NamespaceRule | no |
NamespaceRuleDetail
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
country_id | string (uuid) | no | |
identifier_namespace | string | no | |
issuer_id | string (uuid) | no | |
format_pattern | string | no | |
uniqueness_scope | "country" | "jurisdiction" | "facility" | no | |
valid_from | string (date) | no | |
version | integer | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no | |
overlapping_rules | array of NamespaceRule | no |
SuspendCommand
| Name | Type | Required | Description |
|---|---|---|---|
reason | string | yes | |
second_approver_id | string (uuid) | yes |
ReasonCommand
| Name | Type | Required | Description |
|---|---|---|---|
reason | string | yes |
ReportList
| Name | Type | Required | Description |
|---|---|---|---|
reports | array of ReportList.reports.item | no |
Report
| Name | Type | Required | Description |
|---|---|---|---|
report_id | string | yes | |
title | string | yes | |
columns | array of string | yes | |
rows | array of object | yes | |
summary | object | yes | |
state | "rendered" | "no_authorized_data" | yes | |
generated_at | string (date-time) | yes | |
next_cursor | string | null | yes |
ExportCommand
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
filters | object | no |
ExportReceipt
| Name | Type | Required | Description |
|---|---|---|---|
export_id | string (uuid) | no | |
report_id | string | no | |
format | string | no | |
rows | integer | no | |
expires_at | string (date-time) | no | |
single_use | boolean | no | |
download_path | string | no |
HistoryEntry
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
event_type | string | no | |
at | string (date-time) | no | |
status | string | null | no | |
previous_status | string | null | no | |
policy_domain | string | null | no | |
policy_version | string | null | no | |
reason | string | null | no | |
actor | string | null | no | |
requested_by | string | null | no | |
decision | string | null | no |
HistoryList
| Name | Type | Required | Description |
|---|---|---|---|
data | array of HistoryEntry | no |
SuspensionState
| Name | Type | Required | Description |
|---|---|---|---|
country_id | string (uuid) | no | |
status | CountryStatus | no | |
pending | SuspensionState.pending | no |
ReportList.reports.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
id | string | no | |
title | string | no |
SuspensionState.pending defined inline
| Name | Type | Required | Description |
|---|---|---|---|
requested_by | string | no | |
reason | string | no | |
at | string (date-time) | no |