Security & Compliance API Reference
On this page
Audit logging, security reviews, data archiving, and control mapping against NIST SP 800-53 (the federal security-control catalog).
Endpoints
Admin Units
/v1/security/admin/units
GET /v1/security/admin/units
| Name | In | Required | Description |
|---|---|---|---|
jurisdiction |
query |
No |
Jurisdiction |
unit_type |
query |
No |
Unit type |
search |
query |
No |
Full-text search across name, fips_code. |
sort_by |
query |
No |
Sort column: name, unit_type, jurisdiction, fips_code. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated admin units
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/admin/units
POST /v1/security/admin/units
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original admin unit; a different intent under the same id is a 409 idempotency-conflict. |
fips_code |
string (optional) |
No |
Optional FIPS code for the unit. |
jurisdiction |
string |
Yes |
Jurisdiction the unit is scoped to. |
name |
string |
Yes |
Display name of the administrative unit. |
state_fips |
string |
Yes |
State FIPS code the unit belongs to. |
unit_type |
string |
Yes |
Unit type (e.g. county, region). |
-
200: Admin unit created (or replayed — same client_request_id + intent)
-
409: Duplicate name+jurisdiction, client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/admin/units/{id}
GET /v1/security/admin/units/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Admin unit ID |
-
200: Admin unit
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/admin/units/{id}
PUT /v1/security/admin/units/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Admin unit ID |
If-Match |
header |
Yes |
REQUIRED row version from your last read (ADR-062 §G3), e.g. |
| Field | Type | Required | Description |
|---|---|---|---|
fips_code |
string (optional) |
No |
Optional FIPS code for the unit. |
name |
string |
Yes |
Display name of the administrative unit. |
state_fips |
string |
Yes |
State FIPS code the unit belongs to. |
unit_type |
string |
Yes |
Unit type (e.g. county, region). |
-
200: Admin unit updated
-
400: Missing or malformed If-Match
-
404: Not found
-
409: Version moved since your read (stale If-Match) — re-read and retry
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/admin/units/{id}
DELETE /v1/security/admin/units/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Admin unit ID |
-
200: Admin unit soft-deleted
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Alerts
/v1/security/alerts
GET /v1/security/alerts
| Name | In | Required | Description |
|---|---|---|---|
severity |
query |
No |
Severity |
acknowledged |
query |
No |
Acknowledged |
search |
query |
No |
Full-text search across rule_name, description. |
sort_by |
query |
No |
Sort column: severity, rule_name, acknowledged, created_at. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated alerts
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/alerts/{id}
GET /v1/security/alerts/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Alert ID |
-
200: Alert found
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/alerts/{id}/acknowledge
PUT /v1/security/alerts/{id}/acknowledge
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Alert ID |
-
200: Alert acknowledged
-
404: Not found or already acknowledged
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Archive
/v1/security/archive
GET /v1/security/archive
| Name | In | Required | Description |
|---|---|---|---|
source_service |
query |
No |
Source service |
search |
query |
No |
Full-text search across source_service, source_table. |
sort_by |
query |
No |
Sort column: source_service, source_table, retention_until, archived_at. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated archive records
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/archive/purge
POST /v1/security/archive/purge
| Name | In | Required | Description |
|---|---|---|---|
limit |
query |
No |
Rows per call, |
-
200: Bounded purge: counts + a
moreflag -
403: Archiver disabled (D11 consent knob)
-
409: An archive pass is running
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/archive/run
POST /v1/security/archive/run
-
200: One bounded archive pass: per-table reports + a
moreflag -
403: Archiver disabled (D11 consent knob)
-
409: A pass is already running
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Audit
/v1/security/audit
GET /v1/security/audit
| Name | In | Required | Description |
|---|---|---|---|
user_id |
query |
No |
User id |
service |
query |
No |
Service |
action |
query |
No |
Action |
resource_type |
query |
No |
Resource type |
resource_id |
query |
No |
Resource id |
from |
query |
No |
From |
to |
query |
No |
To |
actor_service |
query |
No |
Plan E § Step 11: filter by caller-service attribution (e.g.
|
actor_user_sub |
query |
No |
Plan E § Step 11: filter by acting-worker normalized UUID sub. |
search |
query |
No |
Full-text search across action, user_id. |
sort_by |
query |
No |
Sort column: timestamp, action, user_id, service, resource_type, actor_service, actor_user_sub. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated audit log
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/audit/resource/{resource_type}/{resource_id}
GET /v1/security/audit/resource/{resource_type}/{resource_id}
| Name | In | Required | Description |
|---|---|---|---|
resource_type |
path |
Yes |
Resource type |
resource_id |
path |
Yes |
Resource ID |
-
200: Audit entries for resource
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/audit/user/{user_id}
GET /v1/security/audit/user/{user_id}
| Name | In | Required | Description |
|---|---|---|---|
user_id |
path |
Yes |
User ID |
-
200: Audit entries for user
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Config
/v1/security/admin/config
GET /v1/security/admin/config
-
200: Deployment configuration
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Detection Rules
/v1/security/detection-rules
GET /v1/security/detection-rules
-
200: List of detection rules
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/detection-rules
POST /v1/security/detection-rules
| Field | Type | Required | Description |
|---|---|---|---|
business_end_hour |
integer (optional) |
No |
#1143: business-hours band end (0..=23, exclusive-of-after-hours upper bound — 17 means "17:00-17:59 is still business"). |
business_start_hour |
integer (optional) |
No |
#1143: business-hours band start (0..=23), meaningful for
|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original detection rule; a different intent under the same id is a 409 idempotency-conflict. |
description |
string |
Yes |
What the rule detects. |
notify_webhook |
string (optional) |
No |
Optional webhook URL to notify on trigger. |
rule_name |
string |
Yes |
Human-readable rule name. |
rule_type |
string |
Yes |
Rule category (e.g. rate, anomaly). |
severity |
string |
Yes |
Alert severity (e.g. low, high). |
threshold |
integer |
Yes |
Trigger threshold (event count). |
window_minutes |
integer |
Yes |
Evaluation window in minutes. |
-
200: Rule created (or replayed — same client_request_id + intent)
-
400: Invalid rule_type or severity
-
409: Duplicate rule_name, client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/detection-rules/{id}
PUT /v1/security/detection-rules/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Detection rule ID |
If-Match |
header |
Yes |
REQUIRED row version from your last read (ADR-062 §G3), e.g. |
| Field | Type | Required | Description |
|---|---|---|---|
business_end_hour |
integer (optional) |
No |
#1143: new business-hours band end (absent = keep). |
business_start_hour |
integer (optional) |
No |
#1143: new business-hours band start (absent = keep). Plain Option — the columns are pair-NULLable but "clear the band" is not a supported operation (a clear would silence the rule; set both hours instead). |
enabled |
boolean (optional) |
No |
Enable/disable the rule. |
notify_webhook |
string (optional) |
No |
Webhook URL — omitted keeps, explicit |
severity |
string (optional) |
No |
New alert severity. |
threshold |
integer (optional) |
No |
New trigger threshold. |
window_minutes |
integer (optional) |
No |
New evaluation window in minutes. |
-
200: Rule updated
-
400: Invalid severity, or a missing/malformed If-Match
-
404: Not found
-
409: Version moved since your read (stale If-Match) — re-read and retry
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/detection-rules/{id}
DELETE /v1/security/detection-rules/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Detection rule ID |
-
204: Rule deleted
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/detection/run
POST /v1/security/detection/run
-
200: Detection scan completed
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Major Changes
/v1/security/changes
GET /v1/security/changes
| Name | In | Required | Description |
|---|---|---|---|
change_type |
query |
No |
Change type |
search |
query |
No |
Full-text search across description, affected_scope. |
sort_by |
query |
No |
Sort column: change_type, description, affected_scope, effective_date, reported_to_acf, created_at. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated major changes
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/changes
POST /v1/security/changes
| Field | Type | Required | Description |
|---|---|---|---|
affected_scope |
string |
Yes |
Scope of systems/processes affected. |
change_type |
string |
Yes |
Category of the change (e.g. system, policy). |
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original major change; a different intent under the same id is a 409 idempotency-conflict. |
description |
string |
Yes |
What changed. |
effective_date |
date |
Yes |
Date the change takes effect. |
notes |
string (optional) |
No |
Optional free-text notes. |
-
200: Major change recorded (or replayed — same client_request_id + intent)
-
400: Invalid change_type
-
409: client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/changes/{id}
GET /v1/security/changes/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Major change ID |
-
200: Major change found
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/changes/{id}
PUT /v1/security/changes/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Major change ID |
| Field | Type | Required | Description |
|---|---|---|---|
description |
string (optional) |
No |
Updated description. |
notes |
string (optional) |
No |
Free-text notes — same keep/clear/set wire contract as
|
reported_date |
date (optional) |
No |
Date reported to ACF — omitted keeps, explicit |
reported_to_acf |
boolean (optional) |
No |
Whether the change was reported to ACF. |
-
200: Major change updated
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/changes/{id}
DELETE /v1/security/changes/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Major change ID |
-
204: Major change deleted
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
NIST
/v1/security/nist
GET /v1/security/nist
| Name | In | Required | Description |
|---|---|---|---|
control_family |
query |
No |
Control family |
implementation_status |
query |
No |
Implementation status |
search |
query |
No |
Full-text search across control_id, control_family. |
sort_by |
query |
No |
Sort column: control_id, control_family, control_name, implementation_status. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated NIST controls
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/nist
POST /v1/security/nist
| Field | Type | Required | Description |
|---|---|---|---|
assessed_by |
string (optional) |
No |
Who performed the assessment. |
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original NIST control; a different intent under the same id is a 409 idempotency-conflict. |
control_family |
string |
Yes |
Control family (e.g. |
control_id |
string |
Yes |
Control identifier (e.g. |
control_name |
string |
Yes |
Human-readable control name. |
evidence_key |
string (optional) |
No |
Object-store key for supporting evidence. |
implementation_notes |
string (optional) |
No |
Free-text implementation notes. |
implementation_status |
string (optional) |
No |
Implementation status (e.g. implemented, planned). |
last_assessed |
date (optional) |
No |
Date the control was last assessed. |
-
200: Control created (or replayed — same client_request_id + intent)
-
409: Duplicate control_id, client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/nist/{control_id}
GET /v1/security/nist/{control_id}
| Name | In | Required | Description |
|---|---|---|---|
control_id |
path |
Yes |
NIST control ID (e.g. AC-2) |
-
200: Control found
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/nist/{control_id}
PUT /v1/security/nist/{control_id}
| Name | In | Required | Description |
|---|---|---|---|
control_id |
path |
Yes |
NIST control ID (e.g. AC-2) |
| Field | Type | Required | Description |
|---|---|---|---|
assessed_by |
string (optional) |
No |
Who performed the assessment. |
evidence_key |
string (optional) |
No |
Object-store key for supporting evidence. |
implementation_notes |
string (optional) |
No |
Free-text implementation notes. |
implementation_status |
string |
Yes |
New implementation status. |
last_assessed |
date (optional) |
No |
Date the control was last assessed. |
-
200: Control updated
-
404: Not found (including a soft-deleted control — previously a 500)
-
409: Implementation status moved concurrently since your read — re-read and retry (ADR-062 §G3)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/nist/{control_id}
DELETE /v1/security/nist/{control_id}
| Name | In | Required | Description |
|---|---|---|---|
control_id |
path |
Yes |
NIST control ID (e.g. AC-2) |
-
204: Control deleted
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partner Signer Keys
/v1/security/partners/{id}/signer-keys
GET /v1/security/partners/{id}/signer-keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Signer keys for partner
-
404: Partner not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/signer-keys
POST /v1/security/partners/{id}/signer-keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
| Field | Type | Required | Description |
|---|---|---|---|
algorithm |
string (optional) |
No |
Signing algorithm (defaults to ES256 if omitted). |
display_name |
string |
Yes |
Human-readable display name, e.g. "Dr. Jones". |
expires_at |
datetime (optional) |
No |
Optional key expiry. |
key_id |
string |
Yes |
|
public_key_jwk |
object |
Yes |
Public key as a JWK (RFC 7517). |
user_identifier |
string |
Yes |
Partner-scoped identifier for the signing person (email, employee id). |
-
200: Signer key registered (pending admin approval)
-
400: Invalid algorithm
-
404: Partner not found
-
409: Duplicate kid
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/signer-keys/{signer_key_id}/approve
PUT /v1/security/partners/{id}/signer-keys/{signer_key_id}/approve
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
signer_key_id |
path |
Yes |
Signer key ID |
-
200: Approved
-
404: Not found or already approved
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/signer-keys/{signer_key_id}/revoke
PUT /v1/security/partners/{id}/signer-keys/{signer_key_id}/revoke
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
signer_key_id |
path |
Yes |
Signer key ID |
-
200: Revoked
-
404: Not found or already revoked
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/signer-keys/by-kid/{kid}
GET /v1/security/signer-keys/by-kid/{kid}
| Name | In | Required | Description |
|---|---|---|---|
kid |
path |
Yes |
JWS |
-
200: Signer key metadata + pubkey
-
404: Unknown/pending/revoked kid or inactive partner
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partners
/v1/security/partners
GET /v1/security/partners
| Name | In | Required | Description |
|---|---|---|---|
kind |
query |
No |
Kind |
status |
query |
No |
Status |
search |
query |
No |
Full-text search across name, contact_email. |
sort_by |
query |
No |
Sort column: name, kind, status, created_at. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated partners
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners
POST /v1/security/partners
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original partner; a different intent under the same id is a 409 idempotency-conflict. |
contact_email |
string (optional) |
No |
Contact email (capped at |
contact_phone |
string (optional) |
No |
Contact phone. |
kind |
string |
Yes |
Partner kind. One of: hospital, school, le, other. |
name |
string |
Yes |
Partner display name. |
rate_limit_rpm |
integer (optional) |
No |
Per-minute rate limit (defaults to 60 if omitted). |
-
200: Partner created (or replayed — same client_request_id + intent)
-
400: Invalid kind
-
409: client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/verify
POST /v1/security/partners/verify
| Field | Type | Required | Description |
|---|---|---|---|
api_key |
string |
Yes |
Raw API key — intake forwards the partner-presented credential here. |
-
200: Credential valid
-
401: Credential invalid, revoked, or partner suspended
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}
GET /v1/security/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Partner found
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}
PUT /v1/security/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
| Field | Type | Required | Description |
|---|---|---|---|
contact_email |
string (optional) |
No |
Contact email — omitted keeps, explicit |
contact_phone |
string (optional) |
No |
Contact phone — same keep/clear/set wire contract as
|
name |
string (optional) |
No |
New partner display name. |
rate_limit_rpm |
integer (optional) |
No |
Per-minute rate limit. |
status |
string (optional) |
No |
Status transition: |
version |
integer |
Yes |
REQUIRED row version from your last read (ADR-062 §G3, #1268) —
the version CAS. Suspension cycles are ABA-vulnerable, so only the
monotonic counter blocks a stale re-suspension replay; stale → 409
|
-
200: Partner updated
-
404: Not found
-
409: Version moved since your read (stale body version) — re-read and retry (ADR-062 §G3)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}
DELETE /v1/security/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Partner soft-deleted
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/keys
GET /v1/security/partners/{id}/keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Keys for partner (hash/prefix only)
-
404: Partner not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/keys
POST /v1/security/partners/{id}/keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1262) — REQUIRED.
One-time-secret contract: the plaintext key is returned exactly
once, so a replay under the same id + intent is a 409
|
expires_at |
datetime (optional) |
No |
Override the default 1-year expiry. |
label |
string (optional) |
No |
Operator-facing label (optional). |
-
200: Key issued; plaintext returned once — a replay never re-exposes it
-
404: Partner not found (including soft-deleted)
-
409: One-time secret already issued for this client_request_id (naming the key id, never the secret), the id is claimed by a different operation (ADR-062), or the partner is suspended (partner-not-active, #1290 — re-activate and retry; the refusal consumed nothing)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/partners/{id}/keys/{key_id}
DELETE /v1/security/partners/{id}/keys/{key_id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
key_id |
path |
Yes |
Key ID |
-
200: Key revoked
-
404: Key not found or already revoked
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Plan C § Step 7 (F-009): rotation. Atomically revokes the named key and
issues a new one belonging to the same partner. Returns the new row
raw plaintext (one-time view, same contract as issue_key). #1262:
takes rotation’s first body — the 1-field claim id — and replays 409
naming the previously rotated-in key, never re-exposing its plaintext.
POST /v1/security/partners/{id}/keys/{key_id}/rotate
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
key_id |
path |
Yes |
Key ID being rotated |
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1262) — REQUIRED.
Same one-time-secret replay contract as |
-
200: Rotated; new plaintext key returned once — a replay never re-exposes it
-
404: Key not found or already revoked, or the partner is soft-deleted (#1290 masking)
-
409: One-time secret already issued for this client_request_id (naming the new key id, never the secret), the id is claimed by a different operation (ADR-062), or the partner is suspended (partner-not-active, #1290 — re-activate and retry; the refusal consumed nothing)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Reviews
/v1/security/reviews
GET /v1/security/reviews
| Name | In | Required | Description |
|---|---|---|---|
review_type |
query |
No |
Review type |
status |
query |
No |
Status |
search |
query |
No |
Full-text search across review_type. |
sort_by |
query |
No |
Sort column: review_type, status, scheduled_date, reviewer. |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
Page |
per_page |
query |
No |
Per page |
-
200: Paginated reviews
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/reviews
POST /v1/security/reviews
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id (ADR-062 §B, #1261) — REQUIRED. Same id + identical intent replays the original review; a different intent under the same id is a 409 idempotency-conflict. |
review_type |
string |
Yes |
Review category — the closed |
reviewer |
string |
Yes |
Name of the assigned reviewer. |
scheduled_date |
date |
Yes |
Date the review is scheduled for. |
-
200: Review created (or replayed — same client_request_id + intent)
-
400: Invalid review_type — outside the canonical ReviewType vocabulary (#1288)
-
409: client_request_id claimed by a different operation, or replayed entity gone (ADR-062)
-
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/reviews/{id}
GET /v1/security/reviews/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Review ID |
-
200: Review found
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/reviews/{id}
PUT /v1/security/reviews/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Review ID |
| Field | Type | Required | Description |
|---|---|---|---|
completed_date |
date (optional) |
No |
Date the review was completed. |
findings |
object |
No |
Structured findings payload (stored as-is). |
remediation_plan |
object |
No |
Structured remediation-plan payload (stored as-is). |
status |
string |
Yes |
New review status. |
-
200: Review updated
-
404: Not found (including a soft-deleted review — previously still mutable)
-
409: Status moved concurrently since your read — re-read and retry (ADR-062 §G3)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
/v1/security/reviews/{id}
DELETE /v1/security/reviews/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Review ID |
-
204: Review deleted
-
404: Not found
-
409: Review has attached evidence
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document, ADR-068): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504: Gateway Timeout (RFC 9457 problem document, ADR-068): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.