Patterns and conventions I've landed on after years of trial, error, and strong opinions. None of this is new or proprietary. These are well-established practices for building software, and this is how I choose to implement them.
A quick primer on REST architecture and the HTTP methods that drive it: GET, POST, PUT, PATCH, and DELETE, and what each one should actually mean.
Time & Date FormatsStandard formats for representing datetimes, durations, and recurring schedules in the API, so time is unambiguous across clients and time zones.
Identifier ConventionsHow to choose and use identifiers (auto-increment, UUID versions, and ULID) and when each one makes sense for keys, URLs, and distributed systems.
The core principles and conventions that guide how the syntaqx API is designed: consistency, predictability, and least surprise for the developer using it.
Naming ConventionsConventions for naming API routes and resources to keep the surface consistent, predictable, and aligned with RESTful expectations.
Resource RelationshipsModeling associations between resources: direct endpoints vs. relationship endpoints, association data, and keeping route sets minimal.
The standard error response format and the HTTP status codes used across the API, so clients can handle failures consistently and predictably.
PaginationPage-based and cursor-based pagination using the Link header: how to walk large result sets consistently, and when to reach for each approach.
Expanding ResponsesUse the expand parameter to inline related resources within API responses: fewer round-trips, and only the extra data you actually ask for.