Skip to content
HANKAI
GuidesDevelopersChangelog

Developers

API error codes

Every /api/v1 error response carries both a human error string and a stable, machine-readable code. Branch on the code: it never changes when we reword a message. Each code maps to one HTTP status (the failure class).

HANK platform REST API error codes, HTTP status, and meaning
CodeHTTPMeaning
invalid_request400The request body, query, or path parameter failed validation (the catch-all bad-input code).
duplicate_slug400A unique field (a slug, or a topic source key) collides with an existing row.
duplicate_member400The product is already a member of this platform (the platform+member pair is unique).
unknown_parent400A referenced parent (product / manual / chapter) does not exist or was concurrently deleted.
content_rejected400The submitted CONTENT failed the publish pipeline (leak/PHI scan, MDX compile, link/alt gate, or policy gate). Fix the content, not the request shape.
unauthorized401No, malformed, or unrecognized bearer token (unauthenticated).
forbidden403A valid token lacking the required scope / admin / operator privilege (authenticated, denied).
not_found404The addressed resource does not exist.
payload_too_large413The request body exceeds the configured size cap.
rate_limited429The per-identity write rate limit was exceeded. Writes are limited to 120 requests per minute per identity. Back off and retry after the Retry-After header.
invalid_idempotency_key400The Idempotency-Key header is present but malformed (empty or over the length cap).
idempotency_in_progress409A request with the same Idempotency-Key is still in progress; retry after Retry-After.
idempotency_key_conflict422The Idempotency-Key was already used for a request with a DIFFERENT body (no safe replay).
chapter_not_empty409The chapter still holds topics. Deleting it would silently detach them from the guide, so the delete is refused. Move or ungroup the topics first, then delete the chapter.
manual_not_empty409The manual still holds topics. Deleting it would CASCADE them away, including published ones, so the delete is refused. Delete or move the topics first.
product_not_empty409The product still holds manuals. Deleting it would CASCADE the entire tree away, including published topics and changelog entries, so the delete is refused. Delete the manuals first.

The same catalog drives the Error.code enum in the OpenAPI spec, so the documented set can never drift from what the API actually emits.