Conventions

Shared rules across Lunar API: username format, request bodies, the status field, and auth status codes.

Conventions

These rules apply across the whole API.

Usernames

Usernames must match the pattern ^[a-zA-Z0-9_.-]+$ and be 3 to 32 characters long. Allowed characters: letters, digits, underscore (_), hyphen (-), and dot (.).

Request bodies

Bodies are JSON (Content-Type: application/json) unless a route documents otherwise. The only exception is POST /admin/s3/upload, which accepts raw image bytes.

The status field

Successful responses include a numeric status field that mirrors the HTTP status code, with a few exceptions noted inline.

{ "status": 200, "message": "🦊 The API is up!" }

Auth status codes

  • 401 — the token is missing, malformed, or revoked.
  • 403 — the user is banned or lacks the required role priority.

See Authentication and Error shapes for details.