API Reference
This section documents every API endpoint in the CRAIG system. The pages are generated from the OpenAPI specification embedded in each service, so they always reflect the current implementation.
They are written for non-technical stakeholders (caseworkers, supervisors, and administrators) who want to understand what each service does and what information it accepts and returns.
Idempotency
Endpoints that take a client_request_id (an identifier the client mints once per action and repeats on every retry of it) are safe to retry. A retry that repeats both the client_request_id and the request does not repeat the action: the service answers as it did the first time, describing the record as it stands now, and checks the caller’s permissions again. The limits:
-
The service remembers a
client_request_idfor 30 days by default (an operator setting), and a file upload’s for 31 days. A retry after that runs as a new request. -
Reusing a
client_request_idfor a different request is refused: with a 409, or for a file upload with a 422 (a 403 when another caller reuses it). -
An action that issues a one-time secret, such as a partner key or a portal invitation code, never shows the secret again: its retry is refused with a 409 that names the record already issued.
When a retry is answered from the first request and succeeds (a 2xx status), the response carries the header Idempotent-Replayed: true, so a client can tell a replay from a first run. A first request never carries it, and neither does a refusal.
The header is set wherever the shared idempotency layer answers a replay, and when a case report is resubmitted under the same submission identifier. The case SSA screening request passes on the exchange service’s header, and Public Intake passes on the case service’s header for its report submissions and its two file uploads. Under the SHINES backend, Public Intake sets it itself when it answers a public or signed report submission from the first submission’s stored receipt.
Regenerating
These pages are generated from source: each service binary supports a --print-openapi flag, so no running devstack is needed. cargo xtask validate fails on any drift between the committed pages and a fresh regeneration (#1022):
cargo xtask api-docs