---
title: "REST APIs"
description: "Opinionated patterns for designing consistent, developer-friendly REST APIs."
---

> 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.

# REST APIs

A consistent API is a predictable API. Predictable APIs reduce integration time,
shrink support burden, and let clients share request/response handling code across
every endpoint. The patterns here are opinionated by design: when every team
makes the same calls, the choices stop mattering and the consistency starts paying off.

- [Endpoint design](https://codex.mirio.dev/web/rest-apis/endpoints/) — Resource naming, URL structure, HTTP methods, and query parameter conventions.
- [Authentication](https://codex.mirio.dev/web/rest-apis/authentication/) — Session cookies and JWT bearer tokens: when each fits, signed-cookie setup, and 401 vs 403.
- [Pagination](https://codex.mirio.dev/web/rest-apis/pagination/) — Cursor-based pagination: why offset breaks down and how cursors stay fast.
- [Versioning](https://codex.mirio.dev/web/rest-apis/versioning/) — URL path versioning, breaking-change taxonomy, and the deprecation lifecycle.
- [Response envelopes](https://codex.mirio.dev/web/rest-apis/envelopes/) — HTTP is already an envelope. When to add one anyway, and how to keep it minimal.
- [Error responses](https://codex.mirio.dev/web/rest-apis/errors/) — String error codes, reporting all errors at once, and a stable code vocabulary.
- [CORS](https://codex.mirio.dev/web/rest-apis/cors/) — Cross-origin headers, preflight handling, and where to enforce CORS: app code or Caddy.

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