A House Divided A House DividedDocumentation
Changelog
Game Design/Platform

API Conventions

Last updated 2026-08-12

Standard patterns for API routes in A House Divided.

Admin Routes#

Error Handling#

Cron Routes#

Status Codes#

Code Use case
401 Not authenticated (no valid token)
403 Authenticated but forbidden (e.g. not admin)
404 Resource not found
429 Rate limited

Cron vs Admin#

Some routes (e.g. /api/elections/snapshot) allow both cron and admin auth. Check cron first with requireCron(request); if false, fall back to requireAdmin().

Connected pages

References →
None