Data Exchange & ICPC API Reference
Inter-agency data exchange and Interstate Compact on the Placement of Children (ICPC) workflow management.
Endpoints
Agreements
List data sharing agreements
GET /v1/exchange/agreements
| Name | In | Required | Description |
|---|---|---|---|
page |
query |
No |
1-based page number; default 1, at most 10000 (a deeper page is a 400). |
per_page |
query |
No |
Page size; default 25, capped at 500. |
partner_id |
query |
No |
Only agreements covering this partner. |
status |
query |
No |
Only agreements in this status ( |
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
-
200: Page of agreements
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-UUID
partner_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:
status/sort_by/sort_dir32,search500 bytes (validation-failed) -
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 data sharing agreement
POST /v1/exchange/agreements
| Field | Type | Required | Description |
|---|---|---|---|
agreement_title |
string |
Yes |
The agreement title. A NUL (U+0000), which the column cannot store, is a
422 |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — REQUIRED. Same id + identical intent replays the original agreement; a different intent under the same id is a 409 idempotency-conflict. |
data_elements |
object |
No |
The data elements the agreement covers (an extensible JSON document).
It may nest at most 16 levels, hold at most 2,000 values, and no
string or key longer than 16,384 bytes. Past a limit, or with a NUL
(U+0000) in any string or object key, it is a 422 |
effective_date |
date |
Yes |
First day the agreement admits a disclosure ( |
expiration_date |
date (optional) |
No |
Last day the agreement admits a disclosure ( |
legal_authority |
string (optional) |
No |
The legal authority for the exchange. A NUL (U+0000), which the column
cannot store, is a 422 |
object_key |
string (optional) |
No |
Object-store key of the signed agreement document: 1-1024 bytes
of |
partner_id |
UUID |
Yes |
The partner the agreement covers; an unknown partner is a 404. |
-
200: Agreement created (or replayed — same client_request_id + intent)
-
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, a NUL in agreement_title, legal_authority or any data_elements string or key, or an
object_keyoutside its object-store key grammar) -
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.
Get data sharing agreement by ID
GET /v1/exchange/agreements/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Agreement ID |
-
200: Agreement details
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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 data sharing agreement
PUT /v1/exchange/agreements/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Agreement ID |
| Field | Type | Required | Description |
|---|---|---|---|
agreement_title |
string (optional) |
No |
The agreement title. A NUL (U+0000), which the column cannot store, is a
422 |
approved_by |
string (optional) |
No |
Subject UUID or |
data_elements |
object |
No |
The data elements the agreement covers (an extensible JSON document),
under the same size limits as on create. Past a limit, or with a NUL
(U+0000) in any string or object key, it is a 422 |
expiration_date |
date (optional) |
No |
New last day of the agreement ( |
legal_authority |
string (optional) |
No |
The legal authority for the exchange. A NUL (U+0000), which the column
cannot store, is a 422 |
object_key |
string (optional) |
No |
Object-store key of the signed agreement document: 1-1024 bytes
of |
status |
string (optional) |
No |
Target status. Allowed moves: |
-
200: Agreement updated. The approval stamp is first-write-wins: a later write carrying approved_by cannot rewrite it. A replayed approve that repeats the status transition is a 400 (same-to-same is illegal); only a stamp-bearing write WITHOUT a status change converges to 200.
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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
expiration_date(validation-failed; the field is named, the value never echoed), a field over its length cap, a NUL in agreement_title, legal_authority or any data_elements string or key, or anobject_keyorapproved_byoutside its grammar (validation-failed) -
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.
Delete a draft data sharing agreement
DELETE /v1/exchange/agreements/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Agreement ID |
-
204: Agreement deleted
-
400: Only draft agreements can be deleted (
invalid-state-transition) -
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: A partner references the agreement (the refusal names the blocking partner), or it left draft since it was read (
concurrent-modification— re-read and retry) -
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/exchange/jobs/{id}
The read-only poll of a craig-exchange background job: its state (queued / running / succeeded / failed; the last two are terminal and never change), the current attempt and the attempts[] ledger (an interrupted or crash attempt is run again, up to max_attempts), the progress document (for collection_run, done of total admitted reports posted), result (present only when succeeded: for collection_run the recorded run, with its transaction id, status, failure and counts) and error (present only when failed: a closed token and a categorical detail). Authorized on the BackgroundJob resource type: an admin, or the job’s creator; any other caller is 403. An unknown id is 404, 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: neither the job’s creator nor an 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.
Collections
Collect what a partner published (human admin)
POST /v1/exchange/collections/run
Enqueues one collection run as a background job (kind = collection_run) and answers 202 with Location: /v1/exchange/jobs/{id} and the job; poll the Location until the job is succeeded or failed. Body = { client_request_id, interface, leg }: the same client_request_id replays the same job whatever its state, a fresh one is a new job. The run fetches one partner document (for doe_slds / weekly_records, the education agency’s weekly student file) and, for each record about a person this deployment currently lists with that partner, posts the reported fact, with the listing it was admitted under, to the service that owns it. A record about anyone else is counted not_listed and dropped, as is one whose listing ended while it was on its way (the owner refuses it); a record that names no person is counted unattributable; stale counts the reports the owner already held, or held a later one for. craig-exchange stores no reported value: the run leaves one transaction (origin = collection, direction = inbound, no payload) and one exchange.collection_completed event carrying the counts. A succeeded job recorded a run, and its result is that run: transaction_id, status (completed, or failed), failure (the class of a failed run: the partner failure’s class when its document could not be read, apply-failed:<n> when the owning service did not take n admitted reports; once three posts in a row say the owner is not taking reports, a run stops posting and counts the rest failed) and the counts. A failed run is safe to run again: every report is posted again. A failed job with error.token = refused_at_start called no partner and recorded nothing; error.detail names what did not hold when the run started: collection-disabled, collection-undeclared, partner-unresolved:<class> (no single active partner with an endpoint and a usable credential) or agreement-does-not-admit. A run interrupted by a shutdown is recorded as a failed run (interrupted) and the job runs again, up to three attempts (exhausted after the third). One run at a time per deployment: a second enqueue while one is queued or running is 409 job-already-active, and a job that finds the run’s lease held waits for it (progress.phase = waiting_for_lease). Collecting is off until CRAIG_EXCHANGECOLLECTIONS<INTERFACE>__ENABLED is set, separately from the interface’s send consent.
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
The client-held idempotency id (ADR-062): the same id replays the same job whatever its state; a fresh id is a new job. |
interface |
string |
Yes |
The partner interface: an adapter-kind token this deployment’s
configuration lists ( |
leg |
string |
Yes |
Which of the interface’s documents to collect ( |
-
202: The run is enqueued (or this is a replay of the stored job, and nothing was enqueued again);
Location=/v1/exchange/jobs/{id} -
400:
collection-undeclared— this deployment holds no collection for that interface and leg (fieldleg); or a body that is not JSON -
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
409: Nothing was enqueued:
collection-disabled(the interface’s collection consent is off),job-already-active(a run is already queued or running) oridempotency-conflict(thisclient_request_idwas used for a different interface or leg) -
413: The body is larger than the request body limit
-
415: The body is not
application/json -
422: Validation failure: a missing
client_request_id, an unknown field, or a field outside its bounds -
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.
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.
ICPC
List ICPC requests
GET /v1/exchange/icpc
| Name | In | Required | Description |
|---|---|---|---|
page |
query |
No |
1-based page number; default 1, at most 10000 (a deeper page is a 400). |
per_page |
query |
No |
Page size; default 25, capped at 500. |
direction |
query |
No |
Only requests with this direction ( |
status |
query |
No |
Only requests in this status. |
overdue |
query |
No |
|
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: direction, status (default: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
-
200: Page of ICPC requests
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-boolean
overdue) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Forbidden
-
422: A filter over its length cap:
direction/status/sort_by/sort_dir32,search500 bytes (validation-failed) -
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 ICPC request
POST /v1/exchange/icpc
| Field | Type | Required | Description |
|---|---|---|---|
case_id |
UUID |
Yes |
The case the placement request belongs to. |
child_id |
UUID |
Yes |
The child the request would place. |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — REQUIRED. Same id + identical intent replays the original ICPC request; a different intent under the same id is a 409 idempotency-conflict. |
direction |
string |
Yes |
|
receiving_state |
string |
Yes |
The receiving state’s USPS code: exactly two ASCII letters, any case,
stored upper case. Any other value is a 400
|
request_type |
string |
Yes |
Placement type: |
sending_state |
string |
Yes |
The sending state’s USPS code: exactly two ASCII letters, any case,
stored upper case. Any other value is a 400
|
-
200: ICPC request created (or replayed — same client_request_id + intent)
-
400: An unknown direction, request_type, sending_state or receiving_state (invalid-enum-value, value-free). A state must be exactly two ASCII letters naming a USPS code, any case, and is stored upper case; its refusal names the field
-
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)
-
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.
Get ICPC request detail
GET /v1/exchange/icpc/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
-
200: ICPC request detail
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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 ICPC request status
PUT /v1/exchange/icpc/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
| Field | Type | Required | Description |
|---|---|---|---|
status |
string |
Yes |
Target status. Allowed moves: |
-
200: ICPC request updated
-
400: Invalid transition
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: Status moved concurrently since your read — re-read and retry
-
422: A body field whose value does not deserialize, e.g. a non-string
status(validation-failed; the field is named, the value never echoed), or astatusover 32 bytes (validation-failed) -
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 ICPC attachments
GET /v1/exchange/icpc/{id}/attachments
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
-
200: Attachments list
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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.
Upload ICPC attachment
POST /v1/exchange/icpc/{id}/attachments
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
| Field | Type | Required | Description |
|---|---|---|---|
attachment_type |
string (optional) |
No |
The attachment type token: 1-64 bytes of lowercase ASCII
letters, digits, |
client_request_id |
UUID |
Yes |
The client-held idempotency id: a byte- and metadata-identical retry under the same id replays the same attachment. |
file |
binary |
Yes |
The attachment file part. |
file_sha256 |
string |
Yes |
The lowercase-hex SHA-256 of the file bytes (64 characters). |
-
200: Attachment uploaded (a byte- and metadata-identical retry under the same client_request_id replays the SAME attachment)
-
400: Validation error (including a missing client_request_id / file_sha256 text field or a digest that does not match the bytes)
-
401: Unauthorized
-
403: Forbidden (including a foreign actor replaying another’s client_request_id)
-
404: Not found
-
409: Concurrent retries kept finalizing this upload; retry the request
-
422: client_request_id reused with a different upload, or an
attachment_typeoutside its 1-64 byte identifier token grammar (validation-failed) -
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.
Download ICPC attachment
GET /v1/exchange/icpc/{id}/attachments/{attachment_id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
attachment_id |
path |
Yes |
Attachment ID |
-
200: Attachment file
-
206: Partial content: the one
Rangeslice (bytes=a-b,a-or-n) withContent-Range,Accept-Ranges: bytesand the slice’sContent-Length; honoured only when anIf-Rangestrong-matches theETag. A multi-range request is the full 200 -
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
416: Range not satisfiable:
Content-Range: bytes */<length> -
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.
Get home study for ICPC request
GET /v1/exchange/icpc/{id}/home-study
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
-
200: Home study detail
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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.
Submit home study assessment
POST /v1/exchange/icpc/{id}/home-study
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
ICPC request ID |
| Field | Type | Required | Description |
|---|---|---|---|
background_checks |
string |
No |
Background checks: |
client_request_id |
UUID |
Yes |
Client-minted idempotency id — REQUIRED. Same id + identical intent replays the original home study; a different intent under the same id is a 409 idempotency-conflict. |
coordinator_decision |
string (optional) |
No |
Coordinator decision token: one of |
education_access |
string |
No |
Education access check: |
home_safety |
string |
No |
Home safety check: |
medical_access |
string |
No |
Medical access check: |
override_justification |
string (optional) |
No |
The coordinator’s documented override justification. A NUL
(U+0000), which the column cannot store, is a 422
|
references_check |
string |
No |
References check: |
rules_recommendation |
string (optional) |
No |
Rules-engine recommendation token: one of |
space_capacity |
string |
No |
Space and capacity check: |
support_systems |
string |
No |
Support systems check: |
-
200: Home study recorded (or replayed — same client_request_id + intent)
-
400: A per-check value outside pending|pass|fail — problem type invalid-enum-value, naming the field
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
409: Home study already exists, client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id, a NUL in override_justification, or a
rules_recommendation/coordinator_decisionoutsideapprove | approved | conditional | deny | denied) -
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.
Outbound triggers
Retire held admissions with a recorded reason (human admin)
POST /v1/exchange/triggers/admissions/dismiss
Terminal: a dismissed admission is never released. The ids are always explicit — there is no dismiss-everything — and the reason is stored on the row. An interface this deployment declares no leg for is refused.
| Field | Type | Required | Description |
|---|---|---|---|
ids |
array of UUID |
Yes |
The admissions to retire — always explicit. There is no "dismiss everything held": a terminal act names what it is retiring. |
interface |
string |
Yes |
The partner interface whose backlog to address. |
reason |
string |
Yes |
Why, for the record. Bounded because it is persisted and rendered:
a reason is a sentence, not a paste buffer. A NUL (U+0000), which the
column cannot store, is a 422 |
-
200: The pass completed
-
400:
trigger-interface-undeclared— this deployment declares no leg for that interface (fieldinterface) -
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
422: Validation failure (including a NUL in reason)
-
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.
Re-run the consent chain over a held backlog, or re-stage failed auth-class record jobs (human admin)
POST /v1/exchange/triggers/admissions/release
Held admissions are the substrate’s record that nothing was dropped when the interface knob was off, no partner was configured, or the agreement had lapsed. This act re-evaluates the chain over them: whatever now admits becomes a staged resolve job, whatever still refuses is re-held with the reason as it stands today. One pass addresses at most 500 admissions: those no pass has re-held yet first (oldest first), then the least recently re-held, so repeated passes reach every held row; the act is idempotent, so a larger backlog is drained by running it again. An interface this deployment declares no leg for is refused rather than answered with a pass that touched nothing. With record_class the act addresses failed record jobs instead: each job of the interface whose last_error class is that auth class (auth-unsupported, auth-misconfigured, auth-unavailable, auth-refused), not yet re-staged, re-runs the chain; one the chain admits for its own partner is staged again under a fresh correlation with a fresh attempt budget, and its old row keeps its class and names the replacement in restaged_as. ids then names send jobs. A re-staged job is never re-staged again, so a repeated or concurrent pass re-stages nothing. A refused job stays selectable and every pass re-reads it; past 500 refused jobs, name newer ones with ids.
| Field | Type | Required | Description |
|---|---|---|---|
held_reason |
string (optional) |
No |
Only rows held for this exact reason; omit for every reason. Closed
vocabulary: the eight admission-time hold reasons ( |
ids |
array of UUID (optional) |
No |
Only these admissions (with |
interface |
string |
Yes |
The partner interface whose backlog to address. |
record_class |
string (optional) |
No |
Re-stage FAILED record jobs instead of releasing held
admissions — those whose |
-
200: The pass completed
-
400:
trigger-interface-undeclared— this deployment declares no leg for that interface (fieldinterface) -
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
422: Validation failure (including a
held_reasonoutside the closed trigger held-reason and settlement-class vocabulary); held_reason and record_class together (validation-failed, field record_class); a record_class outside the auth classes (release-record-class-unsupported, field record_class) -
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.
Admit the open stages no event admitted (human admin)
POST /v1/exchange/triggers/catch-up
Walks the cases open-stages projection for one interface and stage kind, writing a stage_opened admission for every open stage the admission ledger does not already cover, under a deployment-wide lease. Idempotent: a stage an event already admitted collides on the ledger’s identity and is counted as existing. This is both the catalogue’s initial pre-population of open stages at release and the repair for events an older binary consumed during a rolling deploy. Nothing is sent here — the send worker drains the resolve jobs under the ordinary consent chain.
| Field | Type | Required | Description |
|---|---|---|---|
interface |
string |
Yes |
The partner interface — an adapter-kind token this deployment declares a trigger matrix for. |
kind |
enum (case, investigation, custody_episode, medicaid_application) |
Yes |
Which CRAIG entity plays the partner’s stage. |
-
200: The walk completed; the counts say what it did
-
400: No opening leg is declared for that interface and stage kind
-
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
409: Another catch-up walk holds the lease
-
422: Validation failure
-
503: The cases projection could not be walked
-
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 exchange partners
GET /v1/exchange/partners
| Name | In | Required | Description |
|---|---|---|---|
page |
query |
No |
1-based page number; default 1, at most 10000 (a deeper page is a 400). |
per_page |
query |
No |
Page size; default 25, capped at 500. |
partner_type |
query |
No |
Only partners of this category token. |
active |
query |
No |
|
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
-
200: Page of exchange partners
-
400: A page past the depth cap; a malformed query parameter (e.g. a non-boolean
active) 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:
partner_type64,search500,sort_by/sort_dir32 bytes (validation-failed) -
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 exchange partner
POST /v1/exchange/partners
| Field | Type | Required | Description |
|---|---|---|---|
adapter_kind |
string |
No |
Wire-protocol token driving adapter dispatch. One of the
registry-backed |
auth_config |
object |
No |
Secret REFERENCE names only, shaped by |
auth_type |
string |
No |
Outbound credential scheme: none, bearer, basic or |
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. |
direction |
string |
Yes |
|
endpoint_url |
string (optional) |
No |
The partner’s endpoint. A NUL (U+0000), which the column cannot
store, is a 422 |
exchange_format |
string |
No |
Wire format token: 1-64 bytes of lowercase ASCII letters,
digits, |
partner_name |
string |
Yes |
The partner’s display name. A NUL (U+0000), which the column cannot
store, is a 422 |
partner_type |
string |
Yes |
Category token, one of |
-
200: Partner created (or replayed — same client_request_id + intent)
-
401: Unauthorized
-
403: Forbidden (including a typed-only adapter kind, which may not be active)
-
409: Duplicate partner name, client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure (including a missing client_request_id, a NUL in partner_name or endpoint_url, or an
exchange_formatoutside its identifier token grammar), or a partner-auth-type-unknown, partner-auth-config-invalid, partner-endpoint-userinfo or partner-auth-requires-https refusal naming the field only -
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.
Get exchange partner by ID
GET /v1/exchange/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Partner details
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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 exchange partner
PUT /v1/exchange/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
If-Match |
header |
Yes |
REQUIRED row version from your last read, e.g. |
| Field | Type | Required | Description |
|---|---|---|---|
adapter_kind |
string (optional) |
No |
New wire-protocol token from |
auth_config |
object (optional) |
No |
Secret REFERENCE names only, shaped by |
auth_type |
string (optional) |
No |
Outbound credential scheme: none, bearer, basic or |
caller_partner_id |
UUID (optional) |
No |
The craig-security partner whose approved client certificates may call CRAIG as this
partner. Omitting it keeps the current one. An id that names no security partner is
stored and matches no caller; a second active partner of the same |
data_sharing_agreement_id |
UUID (optional) |
No |
Agreement to link to the partner; it must exist (else a 400). Omitting it keeps the current link. |
direction |
string (optional) |
No |
New direction: |
endpoint_url |
string (optional) |
No |
The partner’s endpoint. A NUL (U+0000), which the column cannot
store, is a 422 |
exchange_format |
string (optional) |
No |
Wire format token: 1-64 bytes of lowercase ASCII letters,
digits, |
partner_name |
string (optional) |
No |
The partner’s display name. A NUL (U+0000), which the column cannot
store, is a 422 |
partner_type |
string (optional) |
No |
New category token from |
-
200: Partner updated
-
400: Missing or malformed If-Match, or a data_sharing_agreement_id that does not name an existing agreement
-
401: Unauthorized
-
403: Forbidden (including a typed-only adapter kind left/made active by the effective post-merge state)
-
404: Not found
-
409: Version moved since your read (stale If-Match) — re-read and retry; or the new
partner_nameis already another partner’s, a deactivated one included (duplicate-resource; value-free); or the update would leave a second active partner of oneadapter_kindanswering for onecaller_partner_id(duplicate-resource; value-free) -
422: partner-auth-type-unknown, partner-auth-config-invalid (including auth_type and auth_config not named together), partner-endpoint-userinfo (checked on every update, whatever active says) or partner-auth-requires-https, each naming the field only; a field over its length cap, a NUL in partner_name or endpoint_url, an
exchange_formatoutside its identifier token grammar, or a body field whose value does not deserialize (e.g. a non-UUIDdata_sharing_agreement_id), isvalidation-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.
Soft-delete exchange partner (sets active=false)
DELETE /v1/exchange/partners/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
204: Partner deactivated
-
401: Unauthorized
-
403: Forbidden
-
404: Not found (including an already-deactivated partner — fleet delete convention)
-
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.
Test partner connectivity
POST /v1/exchange/partners/{id}/test
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Partner ID |
-
200: Connectivity test result: result is ok, error: <reason>, or error: <auth class>[ ref=<name>] when the stored row’s credential is refused before anything is sent; auth_applied names the scheme presented (applied, not verified: /health may ignore it), null when nothing was sent
-
401: Unauthorized
-
403: Forbidden: the probe presents the partner’s credential, so it needs partner update
-
404: Not found
-
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.
Person Index
Service-to-service: ask the person index about a person
POST /v1/exchange/person-index/matches
| Field | Type | Required | Description |
|---|---|---|---|
person_id |
UUID |
Yes |
The person asked about (cases-side logical ref), for the log. |
requested_by |
UUID |
Yes |
The worker the request is relayed for. |
subject |
object |
Yes |
The person a find asks about: all a find sends. |
-
200: The index’s candidates, best first; possibly none
-
401: Unauthorized
-
403: Caller is not the craig-cases service identity, the person index is not consented to for its interface (
feature-disabled), the request carries no verifiedX-Craig-Actornaming a worker (worker-required), orrequested_byis not that worker (forbidden) -
409: The index’s partner has no active data-sharing agreement (
dsa-not-active), or the index refused the request as sent (person-index-refused) -
422: A body field over its bound or of the wrong type (
validation-failed; the field is named, the value never echoed) -
503: No person index is registered, no single active partner of its interface is configured, its credential cannot be resolved, or the index did not answer (the failure’s class is named; nothing the index said is)
-
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: tell the person index the product holds a person
POST /v1/exchange/person-index/participations
| Field | Type | Required | Description |
|---|---|---|---|
index_id |
string |
Yes |
The index’s id for the person, as the worker chose it. |
person_id |
UUID |
Yes |
The person (cases-side logical ref): the id the index is given for them, and the one the log holds. |
requested_by |
UUID |
Yes |
The worker the request is relayed for. |
subject |
object |
Yes |
The person a find asks about: all a find sends. |
-
204: The index was told
-
401: Unauthorized
-
403: Caller is not the craig-cases service identity, the person index is not consented to for its interface (
feature-disabled), the request carries no verifiedX-Craig-Actornaming a worker (worker-required), orrequested_byis not that worker (forbidden) -
409: The index’s partner has no active data-sharing agreement (
dsa-not-active), or the index refused: it knows no person under that id, orindex_idis not an id an index could have given (person-index-refused) -
422: A body field over its bound or of the wrong type (
validation-failed; the field is named, the value never echoed) -
503: No person index is registered, no single active partner of its interface is configured, its credential cannot be resolved, or the index did not answer
-
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: register a person in the person index
POST /v1/exchange/person-index/registrations
| Field | Type | Required | Description |
|---|---|---|---|
birth_city |
string (optional) |
No |
The city the person was born in. |
birth_date_verification |
string |
Yes |
How the date of birth was verified. |
birth_state |
string (optional) |
No |
The state the person was born in, as its two-letter code. |
date_of_birth |
date |
Yes |
Date of birth. |
ethnicity |
string (optional) |
No |
The person’s ethnicity. |
first_name |
string |
Yes |
Given name. |
last_name |
string |
Yes |
Family name. |
marital_status |
string (optional) |
No |
The person’s marital status. |
middle_name |
string (optional) |
No |
Middle name. |
person_id |
UUID |
Yes |
The person registered (cases-side logical ref), for the log. |
primary_language |
string (optional) |
No |
The person’s primary language. |
races |
array of string |
No |
The person’s races; empty when none is recorded. |
requested_by |
UUID |
Yes |
The worker the request is relayed for. |
residence_county |
string |
Yes |
The county the person lives in, as the product’s admin-unit code. |
sex |
string |
Yes |
The person’s sex. |
suffix |
string (optional) |
No |
Name suffix. |
-
200: The id the index gave the person
-
401: Unauthorized
-
403: Caller is not the craig-cases service identity, the person index is not consented to for its interface (
feature-disabled), the request carries no verifiedX-Craig-Actornaming a worker (worker-required), orrequested_byis not that worker (forbidden) -
409: The index’s partner has no active data-sharing agreement (
dsa-not-active), or the index refused the registration as sent (person-index-refused) -
422: A body field over its bound or of the wrong type (
validation-failed; the field is named, the value never echoed) -
503: No person index is registered, no single active partner of its interface is configured, its credential cannot be resolved, or the index did not answer: whether the person was created is then unknown
-
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.
Registry
List registered adapter-kind tokens
GET /v1/exchange/registry/adapter-kinds
-
200: Sorted adapter-kind tokens
-
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
-
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 registered partner-type taxonomy tokens
GET /v1/exchange/registry/partner-types
-
200: Sorted partner-type tokens
-
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
-
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.
SSA Screening
Re-admit paused SSA screening jobs (human admin)
POST /v1/exchange/ssa-screening-jobs/resume
| Field | Type | Required | Description |
|---|---|---|---|
reason |
string (optional) |
No |
Re-admit only jobs paused with this categorical reason token (one of the pause-reason vocabulary). |
run_id |
UUID (optional) |
No |
Re-admit only the given run’s paused jobs. |
-
200: Matching paused jobs re-admitted (0 matches is a legal no-op)
-
400:
required-field-missing— neither filter (reason,run_id) was given; orinvalid-enum-value—reasonis not a pause-reason token -
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
409: A live precondition still holds the pause condition — the detail names the token
-
422: Validation failure (the reason token’s length bounds)
-
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: stage an SSA screening run atomically
POST /v1/exchange/ssa-screening-runs
| Field | Type | Required | Description |
|---|---|---|---|
as_of |
date |
Yes |
The business date the cohort was bound (cases-side
|
case_id |
UUID |
Yes |
The case whose household is being screened. |
client_request_id |
UUID |
Yes |
The client-held operation id, forwarded unchanged from the original caller. |
cohort_hash |
string |
Yes |
The cohort hash cases computed via the ONE shared
|
cohort_revision |
integer |
Yes |
The case’s |
members |
array of StageScreeningMember |
Yes |
The cohort (1..= |
requested_by |
UUID |
Yes |
The requesting caseworker’s sub (stage-time actor attribution;
becomes |
requested_by_name |
string |
Yes |
The requesting caseworker’s display name (per-member attribution). A NUL
(U+0000) is a 422 |
-
202: Run staged (or a replay of the stored run — nothing re-staged)
-
400:
duplicate-entry— the cohort lists one person id twice (fieldmembers); orscreening-cohort-hash-mismatch—cohort_hashis not the hash of the members + as_of sent (fieldcohort_hash). Nothing was staged -
401: Unauthorized
-
403: Caller is not the craig-cases service identity, the SSA screening knob is off (FEATURE_DISABLED), the request carries no verified
X-Craig-Actornaming a worker (worker-required), orrequested_byis not that worker (forbidden) -
409: A screening run is already active for the case (SCREENING_RUN_ACTIVE), the submitted cohort revision is below the case watermark (SCREENING_COHORT_STALE — re-read the case and re-screen), or the partner’s DSA is missing/inactive/expired (DSA_NOT_ACTIVE)
-
422: A body field whose value does not deserialize, e.g. a non-date
as_of(validation-failed; the field is named, the value never echoed), or acohort_hashthat is not 64 bytes, an empty or over-200-byterequested_by_nameor one holding a NUL, a negativecohort_revision, or an empty or over-50-membermemberslist (validation-failed) -
503: No SSA screening source is registered, or no active partner of its interface is configured, or more than one is (all categorical)
-
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 case’s latest screening run status
GET /v1/exchange/ssa-screening-runs/latest
| Name | In | Required | Description |
|---|---|---|---|
case_id |
query |
Yes |
The case id. |
-
200: The latest run’s status view
-
400: A malformed query parameter (e.g. a missing or non-UUID
case_id) is the extractor’s value-freebad-requestproblem, before the handler -
401: Unauthorized
-
403: Caller is not the craig-cases service identity
-
404: The case has never staged a screening run
-
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: operator cancel of one screening run
POST /v1/exchange/ssa-screening-runs/{run_id}/cancel
| Name | In | Required | Description |
|---|---|---|---|
run_id |
path |
Yes |
Screening run ID |
| Field | Type | Required | Description |
|---|---|---|---|
case_id |
UUID |
Yes |
The case the run must belong to (the relay’s binding check — a run id from another case answers 404, never a cross-case cancel). |
requested_by |
UUID |
Yes |
The acting worker (attribution). |
requested_by_name |
string |
Yes |
Display attribution. |
-
200: Invalidated (or a deterministic already-invalidated replay)
-
401: Unauthorized
-
403: Caller is not the craig-cases service identity, the request carries no verified
X-Craig-Actornaming a worker (worker-required), orrequested_byis not that worker (forbidden) -
404: No such run for this case
-
409: The run is completed and past the freshness horizon — quiesced for archive (a no-op)
-
422: A body field whose value does not deserialize, e.g. a non-UUID
case_id(validation-failed; the field is named, the value never echoed), or an empty or over-200-byterequested_by_name(validation-failed) -
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.
Set the legal hold on one screening run (human admin)
POST /v1/exchange/ssa-screening-runs/{run_id}/hold
| Name | In | Required | Description |
|---|---|---|---|
run_id |
path |
Yes |
Screening run ID |
| Field | Type | Required | Description |
|---|---|---|---|
reason |
string |
Yes |
Why this run’s records must not be pruned or archived (set) /
why the hold is released (clear). A NUL (U+0000), which the audit
event’s |
-
200: Held (changed=false is the already-held replay)
-
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
404: No such run
-
422: Validation failure (reason length bounds, or a NUL in reason)
-
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.
Clear the legal hold on one screening run (human admin)
DELETE /v1/exchange/ssa-screening-runs/{run_id}/hold
| Name | In | Required | Description |
|---|---|---|---|
run_id |
path |
Yes |
Screening run ID |
| Field | Type | Required | Description |
|---|---|---|---|
reason |
string |
Yes |
Why this run’s records must not be pruned or archived (set) /
why the hold is released (clear). A NUL (U+0000), which the audit
event’s |
-
200: Cleared (changed=false is the already-clear replay)
-
401: Unauthorized
-
403: Service callers and non-admin humans are refused
-
404: No such run
-
422: Validation failure (reason length bounds, or a NUL in reason)
-
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.
Transactions
Send outbound data exchange
POST /v1/exchange/send
| Field | Type | Required | Description |
|---|---|---|---|
client_request_id |
UUID |
Yes |
Client-minted idempotency id — REQUIRED. Same id + identical intent replays the original 202 with the stored transaction (nothing restaged); a different intent under the same id is a 409 idempotency-conflict. |
exchange_type |
string |
Yes |
The transaction’s type token: 1-64 bytes of lowercase ASCII
letters, digits, |
partner_id |
UUID |
Yes |
The partner to send to; it must exist and be active. |
payload |
object |
No |
The opaque record the partner receives. It may nest at most 32 levels,
hold at most 100,000 values, and no string or key longer than 65,536
bytes, and no string or object key in it may contain a NUL (U+0000):
otherwise it is a 422 |
record_count |
integer (optional) |
No |
Number of records the payload carries, recorded on the transaction as given. |
-
202: Send accepted; will be dispatched asynchronously by the send-worker (a replay — same client_request_id + intent — returns 202 with the stored transaction, staging nothing)
-
400: The partner is not active (
bad-request), orexchange_typeis a registered outbound-trigger token or a collection’s<interface>.<leg>(exchange-type-reserved): a triggered send is staged by its domain event and a collection’s transaction by its run, never by hand -
401: Unauthorized
-
403: Forbidden
-
404: The partner does not exist (
not-found) -
409: client_request_id claimed by a different operation, or replayed entity gone
-
422: Validation failure: a missing client_request_id, an
exchange_typeoutside its grammar or a NUL inpayload, or a typed-only adapter kind refusing generic dispatch -
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 exchange transactions
GET /v1/exchange/transactions
| Name | In | Required | Description |
|---|---|---|---|
page |
query |
No |
1-based page number; default 1, at most 10000 (a deeper page is a 400). |
per_page |
query |
No |
Page size; default 25, capped at 500. |
partner_id |
query |
No |
Only transactions with this partner. |
status |
query |
No |
Only transactions in this status ( |
direction |
query |
No |
Only transactions with this direction (every transaction today is |
origin |
query |
No |
Where the transaction came from: |
search |
query |
No |
Full-text search across |
sort_by |
query |
No |
Sort column: direction, |
sort_dir |
query |
No |
Sort direction: asc or desc (default: desc). |
-
200: Page of transactions
-
400:
invalid-enum-valueon fieldorigin:originis notmanual,trigger,collectionorreturn; or a genericbad-requeston fieldpagepast the pagination depth cap -
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: Validation failure (the query): a parameter past its
maxLength, anoriginlonger than 32 bytes included -
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.
Get transaction detail
GET /v1/exchange/transactions/{id}
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Transaction ID |
-
200: Transaction detail
-
401: Unauthorized
-
403: Forbidden
-
404: Not found
-
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.
Retry a failed transaction
POST /v1/exchange/transactions/{id}/retry
| Name | In | Required | Description |
|---|---|---|---|
id |
path |
Yes |
Transaction ID |
-
200: Transaction retried
-
400: Not retryable: the transaction does not exist or is not
failed(invalid-state-transition), or no worker staged it (exchange-type-reserved): an outbound trigger’s record is assembled at dispatch and a collection run sent nothing, so this route cannot re-send either -
401: Unauthorized
-
403: Forbidden
-
422: Typed-only adapter kind refuses generic restage
-
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.