---
title: "Readiness Checklist"
description: "Standards from the REST API pages, consolidated for review before shipping."
---

> Documentation Index
> Fetch the complete documentation index at: https://codex.mirio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Readiness Checklist

Run this before shipping a new API or cutting a new version. Section headers
link to the page where each standard is explained.

## [Endpoints](https://codex.mirio.dev/web/rest-apis/endpoints/)

- Resources are plural nouns in `kebab-case`; the HTTP method carries the action
- Sub-resources are nested at most one level deep
- Partial updates use `PATCH`; `PUT` is reserved for full replacement
- `DELETE` returns `204 No Content` and is idempotent
- Non-CRUD actions are sub-resource nouns: `POST /invoices/{id}/void`, not `POST /voidInvoice`
- Query parameters are `snake_case`; sort uses `-` prefix for descending

## [Authentication](https://codex.mirio.dev/web/rest-apis/authentication/)

- Session cookies are signed, `HttpOnly`, `Secure`, `SameSite=Lax` or stricter, with the `__Host-` prefix
- Logout deletes the session row; expiry is enforced by `expires_at` server-side, not only `Max-Age`
- Tokens travel in `Authorization: Bearer` only: never in query strings or request bodies
- Sign with `RS256` or `ES256`; avoid `HS256` in multi-service environments
- Access tokens expire within one hour; refresh tokens rotate on each use
- `401` means unauthenticated; `403` means authenticated but not authorized
- `401` responses to bearer-token requests include a `WWW-Authenticate` header

## [Versioning](https://codex.mirio.dev/web/rest-apis/versioning/)

- The major version is the first path segment: `/v1/`
- Deprecated versions send `Deprecation` and `Sunset` headers from the announcement date
- Removed versions return `410 Gone`, not `404 Not Found`
- Clients get at least six months between deprecation announcement and removal

## [Errors](https://codex.mirio.dev/web/rest-apis/errors/)

- Error codes are `SCREAMING_SNAKE_CASE` strings, not integers
- `code` is stable API surface; `message` is prose and may change freely
- All validation failures are reported in a single response, not one per round-trip
- Field pointers follow JSON Pointer (RFC 6901): `/addresses/0/city`
- Adding new codes is non-breaking; renaming or removing codes is breaking

## [Response envelopes](https://codex.mirio.dev/web/rest-apis/envelopes/)

- Add an envelope only when it earns its keep: pagination metadata, consistent error shape
- Success responses carry `data`; failures carry `error`; never both in the same response
- Metadata already present in HTTP headers is not duplicated in the body

## [Pagination](https://codex.mirio.dev/web/rest-apis/pagination/)

- Use cursor-based pagination, not offset
- Paginated responses include `next_cursor`, `has_next_page`, and `limit`
- No `total_count` by default; expose a separate endpoint if clients need it
- Enforce a maximum `limit` server-side; return an error for out-of-range values, not a silent clamp
- Cursors encode the sort order and are not valid across different sort orders

## [CORS](https://codex.mirio.dev/web/rest-apis/cors/)

- Origins are an explicit allowlist, not a wildcard
- `Access-Control-Allow-Origin: *` cannot be combined with `Access-Control-Allow-Credentials: true`
- `OPTIONS` preflight requests return `204 No Content` with the CORS headers

Source: https://codex.mirio.dev/web/rest-apis/checklist/index.mdx
