Risk RegisterGuides

Errors

Every /api/v1/* response uses the same JSON error envelope. Failures are typed, the codes are stable, and the wire shape never changes within v1.

Wire shape

{
  "error": "human-readable message",
  "code": "VALIDATION_ERROR",
  "details": {
    "subcode": "ACCEPTANCE_REQUIRED"
  },
  "requestId": "5dba8a3c-9b71-4f9b-9b9a-3b8b2a1c4d2e"
}

Codes and HTTP status mapping

CodeHTTPWhen it fires
VALIDATION_ERROR400The request body, query parameters or headers failed validation. For a body, details.issues lists each field and what is wrong with it. Subcode ASSIGNEE_NOT_ON_REGISTER: a risk's owner, a review's assignee or a treatment action's owner can't read the register (only an org owner or admin, or someone on the register, can be given its work). Subcode ACCEPTANCE_REQUIRED: a create, edit, bulk change or treatment tried to make a risk accepted, which only POST /api/v1/risks/{id}/accept does (an accepted risk sent back with its status unchanged is fine).
UNAUTHORIZED401A missing, malformed, unknown or revoked Bearer token, or one whose secret doesn't match. All five answer with this code and the same message, so a caller cannot use the response to find out which tokens exist (Authentication lists them). One more, for the token's holder only: a personal access token past its expiry is refused with the date it expired (the check runs after the token matches).
FORBIDDEN403Authenticated, but the caller cannot perform this action. The subcodes are listed under Forbidden subcodes. Two refusals carry a message only, with no subcode: a personal access token or connected app while Risk Register has switched tokens or programmatic access off for the organisation, and a non-admin's token on a route reserved for admins (see Authentication).
NOT_FOUND404The entity doesn't exist, isn't visible to your organisation, or has been deleted. A record in another organisation answers exactly as one that doesn't exist, so the response never reveals whether it does.
METHOD_NOT_ALLOWED405The HTTP method isn't supported for this resource. The response carries an Allow header listing the methods that are. Used today on DELETE /api/v1/registers/{id} (archive the register with POST /api/v1/registers/{id}/archive instead).
CONFLICT409State machine violation. Subcodes include API_V1_IDEMPOTENCY_BODY_MISMATCH (same Idempotency-Key, different body), MAPPING_DIFFERS_FROM_REQUEST (re-PUT mapping with a different body), REVIEW_NOT_PENDING (cannot complete or cancel a non-pending review), AI_GENERATION_IN_FLIGHT (carries Retry-After), API_V1_DRAFT_DISCARDED (a retried document save or template start whose draft a person has since discarded in the app; a new save needs a new Idempotency-Key), API_V1_REGISTER_NOT_ACTIVE (the register is archived or closed, so it is read-only: no change to its risks, their reviews, treatment actions, control links, acceptances or comments until someone makes it active again; details.registerId and details.status), API_V1_RISK_CLOSED (a closed risk takes no new treatment action, review request or acceptance; reopen it first; details.riskId).
PRECONDITION_FAILED412The x-rr-if-match header didn't match the current ETag. Subcodes: ETAG_MISMATCH (stale ETag), IF_MATCH_MALFORMED, IF_MATCH_WILDCARD_UNSUPPORTED. The ETAG_MISMATCH body carries details.currentETag and details.suppliedETag. See ETag and optimistic concurrency.
PAYLOAD_TOO_LARGE413The request body exceeded the cap: 64 KiB on most routes, 1 MiB on a register document save (POST /api/v1/registers/from-document) and a proposal.
UNPROCESSABLE422The request is well formed but can't be applied as asked. Used today for a proposal that can't be stored as it stands: subcode API_V1_PROPOSAL_REJECTED, with the refused rows and the reason for each in details.rejected. See Drafts and proposals.
PRECONDITION_REQUIRED428A proposal was sent without expectedRevision, the register revision it was written against.
RATE_LIMITED429Per-token or per-IP rate limit exhausted. Response carries Retry-After: <seconds> header. See Rate limits.
INTERNAL_ERROR500Unexpected failure. The requestId is the only useful signal for the customer; the server logs the full trace under that id.
EXTERNAL_SERVICE_ERROR503A service Risk Register depends on failed: for example Anthropic (AI generation), Clerk (sign-in) or Stripe (billing). Transient; retry with exponential backoff.
SERVICE_UNAVAILABLE503Paused on purpose by Risk Register, not a failure; nothing was done. Only the MCP endpoint answers with it today: subcode MCP_PAUSED (the whole endpoint) or MCP_WRITES_PAUSED (a tool that would change something, while reading still works). See the MCP guide.

The table lists every code. The same list is the Error.code enum in the OpenAPI specification.

Forbidden subcodes

Who is asking:

What the plan allows:

The values of details.limit:

details.limitWhat is counted
registersRegisters
usersPeople in the organisation
live_risksRisks that aren't closed, across every register (300 on Free)
templatesRegisters started from a template
ai_calls_per_monthAI calls in the calendar month
ai_provider_attempts_per_monthAttempts made to the AI provider in the calendar month

A refused batch is refused whole.

Validation errors in detail

When a request body fails validation, details.issues lists every problem found. Each has a path (the field, with nested fields joined by dots, such as risks.0.title) and a message written for a person:

{
  "error": "request body is invalid",
  "code": "VALIDATION_ERROR",
  "details": {
    "issues": [
      {
        "path": "title",
        "message": "Too small: expected string to have >=1 characters"
      },
      {
        "path": "categoryId",
        "message": "Invalid UUID"
      }
    ]
  },
  "requestId": "..."
}

Don't parse message: its wording can change. Other validation failures (a malformed query parameter, a rule that spans fields) carry a message and sometimes a subcode, without issues.

Score-field bounds depend on the parent register's scoring matrix (1–5 on iso31000_5x5, 1–3 on simple_3x3). The server checks a score against the register's own matrix; the OpenAPI schema documents both ranges.

Retry semantics

CodeSafe to retry?How
RATE_LIMITEDYesWait the number of seconds in Retry-After, then retry. Many HTTP client libraries can do this for you.
CONFLICT with subcode AI_GENERATION_IN_FLIGHTYesCarries Retry-After. Same-key replay returns the original result once the in-flight call completes.
EXTERNAL_SERVICE_ERRORYesExponential backoff. The upstream is transient.
SERVICE_UNAVAILABLELaterA pause lasts until Risk Register lifts it: minutes or hours, not seconds. Don't retry in a loop; tell the person, and try again later.
INTERNAL_ERRORYes, onceQuote requestId if it recurs.
PRECONDITION_FAILEDNo, not without re-readingRe-GET the resource to capture the fresh ETag, then retry with the new value in x-rr-if-match.
CONFLICT other subcodesNoAction-specific; the body tells you why.
VALIDATION_ERROR, NOT_FOUND, FORBIDDEN, UNAUTHORIZED, METHOD_NOT_ALLOWED, PAYLOAD_TOO_LARGE, UNPROCESSABLE, PRECONDITION_REQUIREDNoFix the request; retrying with the same body returns the same error.

Idempotency-safe retries

For state-mutating routes, supply an Idempotency-Key header to make every retry safe regardless of error code. Same key plus same body returns the record the first call made, without making another; same key plus a different body returns 409 API_V1_IDEMPOTENCY_BODY_MISMATCH. See Idempotency.

Dispatching on errors

Most HTTP clients can dispatch on status code; for finer control, dispatch on code from the parsed body. It is stable within v1, and the table above lists every value.

See also