Security & Compliance API Reference
Audit logging, security reviews, data archiving, and control mapping against NIST SP 800-53 (the federal security-control catalog).
Endpoints
Admin Units
List live (not deactivated) administrative units, filtered, sorted and paginated.
GET /v1/security/admin/units
| Name | In | Required | Description |
|---|---|---|---|
jurisdiction |
query |
No |
Filter by jurisdiction (exact match). A NUL (U+0000), which the query’s
|
unit_type |
query |
No |
Filter by unit type (exact match). A NUL (U+0000), which the query’s
|
search |
query |
No |
Full-text search across name, |
sort_by |
query |
No |
Sort column: name, |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated admin units
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
jurisdiction/unit_type64,search500,sort_by/sort_dir32 bytes; or a NUL (U+0000) injurisdiction,unit_typeorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Register an administrative unit; idempotent on client_request_id, and a duplicate live
name in the jurisdiction is a 409.
POST /v1/security/admin/units
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
jurisdiction |
string |
Yes |
Jurisdiction the unit is scoped to. A NUL (U+0000) is refused. |
name |
string |
Yes |
Display name of the administrative unit. A NUL (U+0000) is refused. |
state_fips |
string |
Yes |
State FIPS code the unit belongs to. A NUL (U+0000) is refused. |
unit_type |
string |
Yes |
Unit type (e.g. county, region). A NUL (U+0000) is refused. |
-
200: Admin unit created (or replayed — same client_request_id + intent)
-
401: Unauthorized
-
403: Forbidden
-
409: Duplicate name+jurisdiction, client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
name,unit_type,fips_code,state_fipsorjurisdiction(validation-failednaming the field, the value never echoed; before the authorization check) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one live administrative unit; a deactivated unit is a 404.
GET /v1/security/admin/units/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Admin unit ID |
-
200: Admin unit
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Rename, retype or re-code a unit under If-Match; refused with 409 while any worker binding
on it is live.
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, e.g. |
| Field | Type | Required | Description |
|---|---|---|---|
fips_code |
string (optional) |
No |
Optional FIPS code for the unit. A NUL (U+0000) is refused. |
name |
string |
Yes |
Display name of the administrative unit. A NUL (U+0000) is refused. |
state_fips |
string |
Yes |
State FIPS code the unit belongs to. A NUL (U+0000) is refused. |
unit_type |
string |
Yes |
Unit type (e.g. county, region). A NUL (U+0000) is refused. |
-
200: Admin unit updated
-
400: Missing or malformed If-Match
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: A live worker binding holds the row — revoke every binding first (
admin-unit-bound); the version moved since your read (stale If-Match,concurrent-modification) — re-read and retry; or the newnameis already a live unit’s in this jurisdiction (duplicate-resource; value-free, a deactivated unit’s name is free) -
422: A body field whose value does not deserialize, e.g. a non-string
name(validation-failed; the field is named, the value never echoed), a field over its length cap, or a NUL (U+0000) inname,unit_type,fips_codeorstate_fips(validation-failed; before the authorization check and the If-Match check) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Deactivate (soft-delete) a unit; refused with 409 while any worker binding on it is live.
DELETE /v1/security/admin/units/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Admin unit ID |
-
200: Admin unit soft-deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: A live worker binding holds the row — revoke every binding first (
admin-unit-bound); deactivation never cascades to revocation -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Alerts
List security alerts, filtered by severity, acknowledgement and text, paginated.
GET /v1/security/alerts
| Name | In | Required | Description |
|---|---|---|---|
severity |
query |
No |
Filter by severity (exact match; an unknown value matches nothing). A
NUL (U+0000), which the query’s |
acknowledged |
query |
No |
|
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: severity, |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated alerts
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-boolean
acknowledged) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
severity/sort_by/sort_dir32,search500 bytes; or a NUL (U+0000) inseverityorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one security alert by id.
GET /v1/security/alerts/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Alert ID |
-
200: Alert found
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Acknowledge a standing alert as the acting worker, which re-arms its rule for the next scan;
an already-acknowledged alert is a 404.
PUT /v1/security/alerts/{id}/acknowledge
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Alert ID |
-
200: Alert acknowledged
-
401: Unauthorized
-
403: Forbidden
-
404: Not found or already acknowledged
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Archive
List archive-ledger batches (including purged and legacy rows), filtered and paginated.
GET /v1/security/archive
| Name | In | Required | Description |
|---|---|---|---|
source_service |
query |
No |
Filter by source service (exact match). A NUL (U+0000), which the
query’s |
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated archive records
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
source_service64,search500,sort_by/sort_dir32 bytes; or a NUL (U+0000) insource_serviceorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Purge up to limit archive batches whose retention date has passed and that carry no legal
hold, reporting counts and whether more remain.
POST /v1/security/archive/purge
| Name | In | Required | Description |
|---|---|---|---|
limit |
query |
No |
Rows per call, |
-
200: Bounded purge: counts + a
moreflag -
400: A
limitoutside 1..=100; a malformed query parameter (e.g. a non-integerlimit) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Archiver disabled (consent knob)
-
409: An archive pass is running
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Enqueue an archive-then-prune run
POST /v1/security/archive/run
Enqueues ONE archive-then-prune run over this service’s audit-class tables (audit_log, dead_letter_audit) as a background job. The job holds the retention-archive lease for its whole life and runs bounded passes (the scheduled pass budget per pass) over ONE preserved set of table states until no eligible work remains — a quarantined poison row is excluded once and never re-selected. Every ledger row + staged event is attributed to the enqueuing operator. Body = { client_request_id } (REQUIRED; the same id replays the SAME job whatever its state, a fresh id is a new job; any other field is 422 validation-failed). Answers 202 with Location: /v1/security/jobs/{id} and the job (state = queued); poll the Location until succeeded (result = the pass report: per_table[] counters + more = false; an isolated table does NOT fail the job — its error is visible in result) or failed (error.token closed: refused_at_start naming the consent knob when it was flipped OFF between enqueue and start, no_progress when a pass moved nothing while work remained, exhausted after three crashed / interrupted attempts, engine_failed). A second enqueue while a run is queued or running is 409 job-already-active; a peer-held engine lease (the hourly scheduled pass) is NOT a refusal — the attempt waits for it (progress.phase = waiting_for_lease). The consent knob (CRAIG_SECURITYRETENTION_ARCHIVEENABLED) is checked synchronously at enqueue (403, nothing minted) AND re-checked by the attempt. Authorized as approve on the security archive (after which the knob refusal is visible).
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
The client-minted operation id: the same id replays the SAME job (whatever its state); a fresh id is a new job. |
-
202: Run enqueued (or a replay of the stored job — nothing re-enqueued);
Location=/v1/security/jobs/{id} -
401: Unauthorized
-
403: Forbidden — not permitted to approve the archive, or the archiver is disabled (consent knob;
feature-disabled) -
409: A run is already queued or running in this jurisdiction (
job-already-active), or this client_request_id was used with a different intent (idempotency-conflict) -
422: Validation failure — a missing
client_request_idor a forged field (validation-failed) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Audit
Search the audit log with optional filters, sorting and pagination.
GET /v1/security/audit
| Name | In | Required | Description |
|---|---|---|---|
user_id |
query |
No |
Filter by the recorded user id (exact match). A NUL (U+0000), which the
query’s |
service |
query |
No |
Filter by the recording service (exact match). A NUL (U+0000), which
the query’s |
action |
query |
No |
Filter by action (exact match). A NUL (U+0000), which the query’s
|
resource_type |
query |
No |
Filter by resource type (exact match). A NUL (U+0000), which the
query’s |
resource_id |
query |
No |
Filter by the affected resource’s id (exact match). |
from |
query |
No |
Only rows recorded at or after this RFC 3339 instant. |
to |
query |
No |
Only rows recorded at or before this RFC 3339 instant. |
actor_service |
query |
No |
Filter by caller-service attribution (e.g.
|
actor_user_sub |
query |
No |
Filter by acting-worker normalized UUID sub. |
search |
query |
No |
Full-text search across action, |
sort_by |
query |
No |
Sort column: timestamp, action, |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated audit log
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-UUID
resource_id) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
user_id/service/action/resource_type/actor_service64,search500,sort_by/sort_dir32 bytes; or a NUL (U+0000) inuser_id,service,action,resource_type,actor_serviceorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
The 100 most recent audit entries for one resource type and id.
GET /v1/security/audit/resource/{resource_type}/{resource_id}
| Name | In | Required | Description |
|---|---|---|---|
resource_type |
path |
Yes |
Resource type. A NUL (U+0000), which the query’s |
resource_id |
path |
Yes |
Resource ID |
-
200: Audit entries for resource
-
401: Unauthorized
-
403: Forbidden
-
422: A NUL (U+0000) in the
{resource_type}path segment, before the authorization check (validation-failednamingresource_type, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
The 100 most recent audit entries whose actor column equals the path user_id.
GET /v1/security/audit/user/{user_id}
| Name | In | Required | Description |
|---|---|---|---|
user_id |
path |
Yes |
User ID. A NUL (U+0000), which the query’s |
-
200: Audit entries for user
-
401: Unauthorized
-
403: Forbidden
-
422: A NUL (U+0000) in the
{user_id}path segment, before the authorization check (validation-failednaminguser_id, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Background Jobs
Poll a background job
GET /v1/security/jobs/{id}
The generic read-only poll of a security background job: the job as a LOGICAL resource — state (queued / running / succeeded / failed; the last two are terminal and immutable), the current attempt and the attempts[] ledger (an interrupted / crash attempt re-queues a convergent kind up to max_attempts), the typed progress document, result (the kind’s report — for archive_run the archive pass report: per-table counters + more, an isolated table’s error visible — present iff succeeded), error (a CLOSED token + a categorical detail — refused_at_start names the consent knob, no_progress a pass that moved nothing — present iff failed), and resource when the kind links its own row. Authorized on the BackgroundJob resource type: admin realm-flat, the creator (human or service principal) by assigned_worker_sub; another actor is the fleet’s typed 403; an unknown id is 404 (no existence collapse — the row is looked up before the check). Cache-Control: no-store. Never writes.
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Job id — the last segment of the |
-
200: The job (
Cache-Control: no-store) -
401: Unauthorized
-
403: Forbidden — not the creator and not admin
-
404: No such job
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Config
Return the deployment’s jurisdiction and its operator label for administrative units.
GET /v1/security/admin/config
-
200: Deployment configuration
-
401: Unauthorized
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Detection Rules
List every live detection rule, newest first.
GET /v1/security/detection-rules
-
200: List of detection rules
-
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Create a detection rule; idempotent on client_request_id, and a duplicate rule_name is a
409.
POST /v1/security/detection-rules
| Field | Type | Required | Description |
|---|---|---|---|
business_end_hour |
integer (optional) |
No |
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 |
Business-hours band start (0..=23), meaningful for
|
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
notify_webhook |
string (optional) |
No |
Optional webhook URL to notify on trigger. A NUL (U+0000) is refused;
a value must also be an absolute |
rule_name |
string |
Yes |
Human-readable rule name. A NUL (U+0000) is refused. |
rule_type |
string |
Yes |
Rule category (e.g. rate, anomaly). |
severity |
string |
Yes |
Alert severity (e.g. low, high). |
threshold |
integer |
Yes |
Trigger threshold: the rule fires when its window holds at least this many matching audit rows. 0 or more; 0 fires on every scan. |
window_minutes |
integer |
Yes |
Evaluation window in minutes, at least 1: a shorter window counts no row, so the rule could never fire. |
-
200: Rule created (or replayed — same client_request_id + intent)
-
400: Invalid rule_type or severity
-
401: Unauthorized
-
403: Forbidden
-
409: Duplicate rule_name, client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), a
window_minutesunder 1 or a negativethreshold, or a NUL (U+0000) inrule_name,descriptionornotify_webhook(before the authorization check), or anotify_webhookthat is not an absolutehttporhttpsURL with a host (after the authorization check and therule_type/severitychecks, before the claim) (validation-failednaming the field, the value never echoed) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partially update a detection rule under If-Match (enable / disable, threshold, window,
severity, webhook, business-hours band).
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, e.g. |
| Field | Type | Required | Description |
|---|---|---|---|
business_end_hour |
integer (optional) |
No |
New business-hours band end (absent = keep). |
business_start_hour |
integer (optional) |
No |
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 (absent = keep); 0 or more, as on create. |
window_minutes |
integer (optional) |
No |
New evaluation window in minutes (absent = keep); at least 1, as on create. |
-
200: Rule updated
-
400: Invalid severity, or a missing/malformed If-Match
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: Version moved since your read (stale If-Match) — re-read and retry
-
422: A body field whose value does not deserialize, e.g. a non-boolean
enabled(validation-failed; the field is named, the value never echoed), aseverity/notify_webhookover its length cap, abusiness_start_hour/business_end_houroutside 0..=23, awindow_minutesunder 1 or a negativethreshold, or a NUL (U+0000) innotify_webhook(validation-failed; before the authorization check and the If-Match check); or a setnotify_webhookthat is not an absolutehttporhttpsURL with a host (validation-failednamingnotify_webhook, the value never echoed; after the authorization, If-Match andseveritychecks, before the write) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Soft-delete a detection rule; it is no longer listed or run by the scan.
DELETE /v1/security/detection-rules/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Detection rule ID |
-
204: Rule deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Run every enabled detection rule now over the audit rows committed since the last scan,
and return the alerts this scan created.
POST /v1/security/detection/run
-
200: Detection scan completed
-
401: Unauthorized
-
403: Forbidden
-
500: Internal error, including a missing scan watermark
-
503: Service Unavailable (RFC 9457 problem document): database pool exhaustion (carries Retry-After: 5), db-connection-lost, db-outcome-unknown, or a synchronous upstream dependency refusal.
-
504:
db-timeout: another scan held the scan watermark, or a count ran, past the statement timeout; scans run one at a time and the next scan evaluates the same rows
EventReplay
Replay outbox events in a time window
POST /v1/admin/events/replay
Re-stages the published outbox rows created in [from, to] (optionally one event_type) so the outbox worker republishes them. At most 100000 rows per call; when more is true, call again with the same window and resume_from. Rows already pending are left alone. dry_run=true only counts. A from older than the service’s outbox retention window is refused. Each batch commits on its own, so after a 5xx the committed batches stay re-staged and re-running the same window picks up the rest. Every admitted call, a dry run included, records an admin.events_replayed act naming the worker.
| Name | In | Required | Description |
|---|---|---|---|
from |
query |
Yes |
RFC 3339 inclusive lower bound on |
to |
query |
Yes |
RFC 3339 inclusive upper bound on |
event_type |
query |
No |
Optional |
dry_run |
query |
No |
If true, return the would-replay count without modifying rows. |
resume_from |
query |
No |
The |
-
200: The window’s count and what this call re-staged
-
400:
bad-request: a malformed or missingfrom/to, a non-booleandry_run,fromafterto,fromolder than the outbox retention window, or aresume_fromthat is not a replay cursor (fieldnames it) -
401: Missing or invalid bearer token
-
403: The acting identity is not an admin, or is a bare service principal (
worker-required): a replay is a worker’s act -
422:
validation-failed:event_typelonger than 255 bytes -
500: Internal error (the re-staged count overflowed, or an unclassified database error); batches already committed stay committed
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Major Changes
List live major changes, filtered, sorted and paginated.
GET /v1/security/changes
| Name | In | Required | Description |
|---|---|---|---|
change_type |
query |
No |
Filter by change type (exact match). A NUL (U+0000), which the query’s
|
search |
query |
No |
Full-text search across description, |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated major changes
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
change_type64,search500,sort_by/sort_dir32 bytes; or a NUL (U+0000) inchange_typeorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Record a major change reported by the acting worker; idempotent on client_request_id.
POST /v1/security/changes
| Field | Type | Required | Description |
|---|---|---|---|
affected_scope |
string |
Yes |
Scope of systems/processes affected. A NUL (U+0000) is refused. |
change_type |
string |
Yes |
Category of the change (e.g. system, policy). |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
effective_date |
date |
Yes |
Date the change takes effect. |
notes |
string (optional) |
No |
Optional free-text notes. A NUL (U+0000) is refused. |
-
200: Major change recorded (or replayed — same client_request_id + intent)
-
400: Invalid change_type
-
401: Unauthorized
-
403: Forbidden
-
409: client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
description,affected_scopeornotes(validation-failednaming the field, the value never echoed; before the authorization check and thechange_typecheck) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one live major change; a deleted one is a 404.
GET /v1/security/changes/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Major change ID |
-
200: Major change found
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partially update a major change (ACF-reported flag and date, notes, description).
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. A NUL (U+0000) is refused. |
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
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
422: A body field whose value does not deserialize, e.g. a non-boolean
reported_to_acf(validation-failed; the field is named, the value never echoed), anotes/descriptionover its length cap, or a NUL (U+0000) innotesordescription(validation-failed; before the authorization check and the lookup) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Soft-delete a major change.
DELETE /v1/security/changes/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Major change ID |
-
204: Major change deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
NIST
List live NIST controls, filtered, sorted and paginated.
GET /v1/security/nist
| Name | In | Required | Description |
|---|---|---|---|
control_family |
query |
No |
Filter by control family (exact match). A NUL (U+0000), which the
query’s |
implementation_status |
query |
No |
Filter by implementation status (exact match). A NUL (U+0000), which
the query’s |
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated NIST controls
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
control_family64,implementation_status/sort_by/sort_dir32,search500 bytes; or a NUL (U+0000) incontrol_family,implementation_statusorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Map a NIST control; idempotent on client_request_id, and a duplicate live control_id is a
409.
POST /v1/security/nist
| Field | Type | Required | Description |
|---|---|---|---|
assessed_by |
string (optional) |
No |
Who performed the assessment. A NUL (U+0000) is refused. |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
evidence_key |
string (optional) |
No |
Object-store key for supporting evidence. A NUL (U+0000) is refused. |
implementation_notes |
string (optional) |
No |
Free-text implementation notes. A NUL (U+0000) is refused. |
implementation_status |
string (optional) |
No |
Implementation status: one of |
last_assessed |
date (optional) |
No |
Date the control was last assessed. |
-
200: Control created (or replayed — same client_request_id + intent)
-
400: An
implementation_statusoutsideplanned,partial,implemented,not_applicable(invalid-enum-valuenamingimplementation_statusand listing the vocabulary, the value never echoed; after the authorization check, before the claim) -
401: Unauthorized
-
403: Forbidden
-
409: Duplicate control_id, client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
control_id,control_family,control_name,implementation_status,implementation_notes,evidence_keyorassessed_by(validation-failednaming the field, the value never echoed; before the authorization check) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read the live control with this 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
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
422: A
{control_id}over 64 bytes or carrying a NUL (U+0000) (validation-failednamingcontrol_id, the value never echoed; before the authorization check and the lookup) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Update a control’s status (an allowed transition only) and assessment details.
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. A NUL (U+0000) is refused. |
evidence_key |
string (optional) |
No |
Object-store key for supporting evidence. A NUL (U+0000) is refused. |
implementation_notes |
string (optional) |
No |
Free-text implementation notes. A NUL (U+0000) is refused. |
implementation_status |
string |
Yes |
New implementation status. |
last_assessed |
date (optional) |
No |
Date the control was last assessed. |
-
200: Control updated
-
401: Unauthorized
-
403: Forbidden
-
404: Not found (including a soft-deleted control)
-
409: Implementation status moved concurrently since your read — re-read and retry
-
422: A body field whose value does not deserialize, e.g. a non-date
last_assessed(validation-failed; the field is named, the value never echoed), a field over its length cap, a{control_id}over 64 bytes, or a NUL (U+0000) in the{control_id}path segment (namingcontrol_id),implementation_notes,evidence_keyorassessed_by(validation-failed; the path first, then the body, both before the authorization check and the lookup) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Soft-delete the live control with this control_id; the id can then be reused.
DELETE /v1/security/nist/{control_id}
| Name | In | Required | Description |
|---|---|---|---|
control_id |
path |
Yes |
NIST control ID (e.g. AC-2) |
-
204: Control deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
422: A
{control_id}over 64 bytes or carrying a NUL (U+0000) (validation-failednamingcontrol_id, the value never echoed; before the authorization check and the delete) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partner Client Certificates
Resolve a caller’s certificate, by its fingerprint, to the partner it is registered against;
only an approved certificate of an active partner, inside its validity, resolves.
GET /v1/security/client-certificates/by-fingerprint/{sha256}
| Name | In | Required | Description |
|---|---|---|---|
sha256 |
path |
Yes |
SHA-256 of the certificate’s DER encoding: 64 lowercase hexadecimal digits |
-
200: The partner and the registration that admit the caller
-
400:
sha256is not 64 lowercase hexadecimal digits: it names no certificate (bad-requestnamingsha256, value-free), answered before authorization -
401: Unauthorized
-
403: The caller is not the craig-exchange service identity, or it relays another identity (a delegated actor or subject token)
-
404: No certificate with this fingerprint admits a caller now: it is unregistered, pending, revoked or outside its validity, or its partner is not active. The answer is the same for each
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
List a partner’s client certificates in every status, newest first.
GET /v1/security/partners/{id}/client-certificates
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: The partner’s client certificates
-
401: Unauthorized
-
403: Forbidden, including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused and never widened
-
404: Partner not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Register a partner’s client certificate; it stays pending and admits nobody until an
administrator approves it.
POST /v1/security/partners/{id}/client-certificates
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
| Field | Type | Required | Description |
|---|---|---|---|
certificate_pem |
string |
Yes |
The partner’s certificate in PEM: exactly one |
label |
string |
Yes |
What an administrator tells this certificate from another by, e.g. "benefits batch host, 2027". A NUL (U+0000) is refused. |
-
200: Registered (pending an administrator’s approval)
-
400:
certificate_pemis not exactly one X.509 certificate, is a certificate authority’s, is valid at no time (its validity ends before it begins), or is past its validity (invalid-client-certificate, namingcertificate_pem; the certificate is never echoed); or alabelmade only of control characters (named, never echoed). Other control characters are removed from the label before it is stored -
401: Unauthorized
-
403: Forbidden
-
404: Partner not found (a deleted partner is not found)
-
409: The certificate is already registered and not revoked, against this partner or another
-
422: An unknown key, a field empty or over its length cap, or a NUL (U+0000) in
certificate_pemorlabel(validation-failed; the field is named, the value never echoed) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Approve a pending client certificate so that it admits a caller.
PUT /v1/security/partners/{id}/client-certificates/{certificate_id}/approve
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
certificate_id |
path |
Yes |
Client certificate registration ID |
-
200: Approved
-
401: Unauthorized
-
403: Forbidden
-
404: No pending registration of this partner has this id: it is another partner’s, already approved, revoked or absent
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Revoke a client certificate so that it admits nobody from this statement on.
PUT /v1/security/partners/{id}/client-certificates/{certificate_id}/revoke
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
certificate_id |
path |
Yes |
Client certificate registration ID |
-
200: Revoked
-
401: Unauthorized
-
403: Forbidden
-
404: No live registration of this partner has this id: it is another partner’s, already revoked or absent
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partner Signer Keys
List a partner’s signer keys in every status, newest first.
GET /v1/security/partners/{id}/signer-keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Signer keys for partner
-
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
404: Partner not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Register a per-person JWS signer key for a partner; it stays pending and verifies nothing
until an admin approves it.
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". A NUL (U+0000) is refused. |
expires_at |
datetime (optional) |
No |
Optional key expiry. |
key_id |
string |
Yes |
|
public_key_jwk |
object |
Yes |
Public key as a JWK (RFC 7517). The document may nest at most 4 levels, hold at most 32 values, and no string or key longer than 1,024 bytes; a document past a limit is refused before the key itself is checked, with the status each route documents for an invalid body. |
user_identifier |
string |
Yes |
Partner-scoped identifier for the signing person (email, employee id). A NUL (U+0000) is refused. |
-
200: Signer key registered (pending admin approval)
-
400: Invalid algorithm (
invalid-enum-value), apublic_key_jwkthat is not exactly a P-256 public key (invalid-signer-jwk; the key is never echoed), or auser_identifier/display_namemade only of control characters (named, never echoed). Other control characters are removed from both labels before they are stored -
401: Unauthorized
-
403: Forbidden
-
404: Partner not found
-
409: Duplicate kid
-
422: A body field whose value does not deserialize, e.g. a malformed
expires_at(validation-failed; the field is named, the value never echoed), a field over its length cap, or a NUL inuser_identifier,display_nameorkey_id(validation-failed) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Approve a pending signer key so it starts verifying signatures.
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
-
401: Unauthorized
-
403: Forbidden
-
404: Not found or already approved
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Revoke a signer key so it stops verifying signatures.
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
-
401: Unauthorized
-
403: Forbidden
-
404: Not found or already revoked
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Resolve a JWS kid to the signer’s public key and identity; only an approved, unrevoked,
unexpired key of an active partner resolves.
GET /v1/security/signer-keys/by-kid/{kid}
| Name | In | Required | Description |
|---|---|---|---|
kid |
path |
Yes |
JWS |
-
200: Signer key metadata + pubkey
-
400: A
kidover the identifier cap or containing a NUL (U+0000): it names no registered key (bad-requestnamingkid, value-free), before authorization -
401: Unauthorized
-
403: Forbidden
-
404: Unknown/pending/revoked kid or inactive partner
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Partners
List non-deleted partners, filtered, sorted and paginated.
GET /v1/security/partners
| Name | In | Required | Description |
|---|---|---|---|
kind |
query |
No |
Filter by partner kind (exact match). A NUL (U+0000), which the query’s
|
status |
query |
No |
Filter by partner status (exact match). A NUL (U+0000), which the
query’s |
search |
query |
No |
Full-text search across name, |
sort_by |
query |
No |
Sort column: name, kind, status, |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated partners
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
kind64,status/sort_by/sort_dir32,search500 bytes; or a NUL (U+0000) inkind,statusorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Create a partner organisation; idempotent on client_request_id (a matching resend returns
the same partner).
POST /v1/security/partners
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
kind |
string |
Yes |
Partner kind. One of: hospital, school, le, other. |
name |
string |
Yes |
Partner display name. A NUL (U+0000) is refused. |
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
-
401: Unauthorized
-
403: Forbidden
-
409: client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
name,contact_emailorcontact_phone(validation-failednaming the field, the value never echoed; before the authorization check and thekindcheck) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Check a partner-presented API key: valid only when unrevoked, unexpired and owned by an
active partner. Returns the partner id and rate limit, or 401.
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
-
403: Forbidden
-
422: A body field whose value does not deserialize, e.g. a non-string
api_key(validation-failed; the field is named, the value never echoed), or anapi_keyover 64 bytes (validation-failed) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one partner by id, whatever its status.
GET /v1/security/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Partner found
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Update a partner’s details or suspend / re-activate it, guarded by the body’s version.
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. A NUL (U+0000) is refused. |
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 —
the version CAS. Suspension cycles are ABA-vulnerable, so only the
monotonic counter blocks a stale re-suspension replay; stale → 409
|
-
200: Partner updated
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: Version moved since your read (stale body version) — re-read and retry
-
422: A body field whose value does not deserialize, e.g. a non-integer
version(validation-failed; the field is named, the value never echoed), a field over its length cap, or a NUL (U+0000) inname,contact_emailorcontact_phone(validation-failed; before the authorization check and thestatuscheck) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Soft-delete a partner (status deleted); the row stays for audit and its keys stop
authenticating.
DELETE /v1/security/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Partner soft-deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
List a partner’s API keys, revoked ones included; only hashes and prefixes, never a secret.
GET /v1/security/partners/{id}/keys
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Keys for partner (hash/prefix only)
-
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
404: Partner not found, or soft-deleted
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Issue a new API key for an active partner. The plaintext key is in this response only; a
resend with the same client_request_id is a 409 naming the key, never the secret.
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 — 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). A NUL (U+0000) is refused. |
-
200: Key issued; plaintext returned once — a replay never re-exposes it
-
401: Unauthorized
-
403: Forbidden
-
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, or the partner is suspended (partner-not-active — re-activate and retry; the refusal consumed nothing)
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
label(validation-failednaming the field, the value never echoed; before the authorization check, the replay precheck and the partner lookup) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Revoke one of a partner’s API keys; a key belonging to another partner reads as not found.
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
-
401: Unauthorized
-
403: Forbidden
-
404: Key not found or already revoked
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
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). It
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 — REQUIRED.
Same one-time-secret replay contract as |
-
200: Rotated; new plaintext key returned once — a replay never re-exposes it
-
401: Unauthorized
-
403: Forbidden
-
404: Key not found or already revoked, or the partner is soft-deleted (masked)
-
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, or the partner is suspended (partner-not-active — 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): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Reviews
List live security reviews, filtered, sorted and paginated.
GET /v1/security/reviews
| Name | In | Required | Description |
|---|---|---|---|
review_type |
query |
No |
Filter by review type (exact match). A NUL (U+0000), which the query’s
|
status |
query |
No |
Filter by status (exact match). A NUL (U+0000), which the query’s
|
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
page |
query |
No |
1-based page number (default 1); a page past the depth cap of 10,000 is a 400. |
per_page |
query |
No |
Rows per page (default 25, silently capped at 500); 0 returns only the total. |
-
200: Paginated reviews
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-integer
page) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
review_type64,status/sort_by/sort_dir32,search500 bytes; or a NUL (U+0000) inreview_type,statusorsearch, before the authorization check (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Schedule a security review; idempotent on client_request_id.
POST /v1/security/reviews
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id — 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. A NUL (U+0000) is refused. |
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
-
401: Unauthorized
-
403: Forbidden
-
409: client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id), or a NUL (U+0000) in
reviewer(validation-failednaming the field, the value never echoed; before the authorization check and thereview_typecheck) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one live security review; a deleted one is a 404.
GET /v1/security/reviews/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Review ID |
-
200: Review found
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Move a review to a new status (an allowed transition only) and record its completion date,
findings and remediation plan.
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). It may nest at most 16 levels, hold at most 2,000 values, and no string or key longer than 16,384 bytes; a document past a limit, or with a NUL (U+0000) in any string or object key, is refused. |
remediation_plan |
object |
No |
Structured remediation-plan payload (stored as-is), under the same
size limits as |
status |
string |
Yes |
New review status. |
-
200: Review updated
-
401: Unauthorized
-
403: Forbidden
-
404: Not found (including a soft-deleted review)
-
409: Status moved concurrently since your read — re-read and retry
-
422: A body field whose value does not deserialize, e.g. a non-date
completed_date(validation-failed; the field is named, the value never echoed), astatusover 32 bytes, or a NUL (U+0000) in any string or object key offindingsorremediation_plan(validation-failed; before the authorization check, the lookup and the transition check) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Soft-delete a security review.
DELETE /v1/security/reviews/{id}
A review with attached evidence is deleted too; its evidence records stay in place.
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Review ID |
-
204: Review deleted
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Worker Admin Units
List the worker’s live bindings, oldest first.
GET /v1/security/admin/workers/{sub}/admin-units
| Name | In | Required | Description |
|---|---|---|---|
sub |
path |
Yes |
The worker’s subject ( |
-
200: The worker’s LIVE bindings, oldest first (revoked rows read by id only)
-
401: Unauthorized
-
403: Not an admin or readonly auditor; an assignment-scoped grant is refused rather than widened, since these rows carry no per-worker ownership
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Bind a worker to an active county unit, copying its name, type and jurisdiction at assign;
idempotent on client_request_id.
POST /v1/security/admin/workers/{sub}/admin-units
| Name | In | Required | Description |
|---|---|---|---|
sub |
path |
Yes |
The worker’s subject ( |
| Field | Type | Required | Description |
|---|---|---|---|
admin_unit_id |
UUID |
Yes |
The |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — REQUIRED. Same id |
-
200: Binding assigned (or replayed — same client_request_id + intent)
-
400: The registry row is not bindable — not a county, or inactive (
admin-unit-not-bindable) -
401: Unauthorized
-
403: Not an admin
-
404: No such admin unit
-
409: The worker already holds a live binding to this unit (
admin-unit-already-bound), client_request_id claimed by a different operation, or replayed entity gone -
422: Validation failure (including a missing client_request_id)
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Read one of the worker’s bindings by id, live or revoked.
GET /v1/security/admin/workers/{sub}/admin-units/{id}
| Name | In | Required | Description |
|---|---|---|---|
sub |
path |
Yes |
The worker’s subject ( |
id |
path |
Yes |
Binding ID |
-
200: The binding — live OR revoked, with the unit name frozen at assign
-
401: Unauthorized
-
403: Not an admin or readonly auditor
-
404: No such binding under this worker
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Revoke a worker’s binding under If-Match; revoking an already-revoked binding answers the
row again.
DELETE /v1/security/admin/workers/{sub}/admin-units/{id}
| Name | In | Required | Description |
|---|---|---|---|
sub |
path |
Yes |
The worker’s subject ( |
id |
path |
Yes |
Binding ID |
If-Match |
header |
Yes |
REQUIRED row version from your last read, e.g. |
-
200: Binding revoked — or already revoked (the idempotent replay answers the row, whatever If-Match it carried)
-
400: Missing or malformed If-Match
-
401: Unauthorized
-
403: Not an admin
-
404: No such binding under this worker
-
409: The live row’s version moved since your read (stale If-Match) — re-read and retry
-
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
WorkerIdentities
Admin: set or clear a worker’s agency work phone
PUT /v1/security/admin/workers/{sub}/contact
Replaces the worker’s WHOLE contact record: a string sets the agency work line (E.164), null clears it; the key is required. Admin only — the worker_identity ruleset’s non-admin update DENY on the contact projection (its current revision) refuses every other role. A change stages security.worker_identity.contact_changed (the new value, the acting admin) in the same transaction; an unchanged value writes nothing. Never a personal number. Cache-Control: no-store.
| Name | In | Required | Description |
|---|---|---|---|
sub |
path |
Yes |
The worker’s subject ( |
| Field | Type | Required | Description |
|---|---|---|---|
contact_phone |
string (optional) |
Yes |
E.164 ( |
-
200: The worker’s contact card after the write; Cache-Control: no-store
-
401: Missing or invalid bearer
-
403: Not an admin
-
404: A worker this service has never seen (the worker signs in once first)
-
422: The
contact_phonekey is missing, or the value is not E.164, or a body field whose value does not deserialize, e.g. a non-stringcontact_phone(validation-failed; the field is named, the value never echoed) -
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Service-to-service: the live admin-units snapshot of one jurisdiction
GET /v1/security/worker-identities/admin-units
{ registry_generation, units: { sub → [unit_name] } } — every LIVE county binding of the requested jurisdiction (the name frozen at assign), read after the registry generation inside one transaction, so the rows are never older than the generation attests. No PII (pseudonymous subjects, county names). Service-only: a worker bearer — direct, or relayed through X-Craig-Actor — is refused before the engine; the caller must be a service principal the worker_identity ruleset’s admin_units projection row admits (claims.is_service AND resource.attrs.projection == 'admin_units', 1.3.0). Cache-Control: no-store.
| Name | In | Required | Description |
|---|---|---|---|
jurisdiction |
query |
Yes |
The jurisdiction whose live county bindings the snapshot carries —
a |
-
200: The snapshot; Cache-Control: no-store
-
400: An unknown jurisdiction key — the typed INVALID_ENUM_VALUE problem naming field
jurisdiction. A missing or unknown query parameter (the query is closed) is refused by the query extractor itself with its value-freebad-requestproblem before the handler runs. -
401: Missing or invalid bearer
-
403: Not a service caller, a relayed (
X-Craig-Actor) call, or the deployment’s worker_identity ruleset carries noadmin_unitsprojection row yet -
422: A
jurisdictionover its 64-byte length cap -
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Service-to-service: batched worker contact cards for the foster-parent portal
POST /v1/security/worker-identities/contacts
{ sub → { display_name, contact_phone } } for ≤ 50 subs — the identity cache’s display name (the worker’s IdP name; null when the cache holds only the username, which is never returned) plus the admin-entered agency work line (null when unset); no username, no email. The request is WorkerContactsRequest ({ subs }). Service-only: a worker bearer is refused outright; a bare service principal passes only the worker_identity ruleset’s contact row (claims.service_id == 'craig-placement' AND resource.attrs.projection == 'contact'); a service call relaying X-Craig-Actor is refused 403 before the engine or any read (the engine would evaluate it as the acting worker). A sub this service has never seen is omitted; Cache-Control: no-store.
| Field | Type | Required | Description |
|---|---|---|---|
subs |
array of UUID |
Yes |
Worker subjects to look up (≤ |
-
200: Contact cards keyed by sub (unknown subs omitted); Cache-Control: no-store
-
400: Over the 50-sub cap (BATCH_TOO_LARGE, field
subs) -
401: Missing or invalid bearer
-
403: Not a service caller; a relayed (
X-Craig-Actor) call; or a bare service principal thecontactrow does not admit -
422: A body field whose value does not deserialize, e.g. a non-UUID entry in
subs(validation-failed; the field is named, the value never echoed) -
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.
Autocomplete-search worker identities for reassignment UI
GET /v1/security/workers
| Name | In | Required | Description |
|---|---|---|---|
search |
query |
No |
Substring to match (case-insensitive) against |
limit |
query |
No |
Result cap. Default 25; max 100. |
-
200: Matched workers
-
400: Search query too short; a malformed query parameter (e.g. a non-integer
limit) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden — including a worker- or supervisor-scoped caller: these rows carry no per-worker ownership, so an assignment scope is refused rather than widened
-
422: A filter over its length cap:
search500 bytes; or a NUL (U+0000) insearch, checked before the authorization check and the 2-character minimum, so a lone NUL is this 422, not the 400 (validation-failednaming the parameter, value-free) -
500: Internal error
-
503: Service Unavailable (RFC 9457 problem document): 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): the route-class request ceiling elapsed (request-timeout) or the database canceled the statement (db-timeout) — the server yields first.