Documentation Index
Fetch the complete documentation index at: https://docs.apivalk.com/llms.txt
Use this file to discover all available pages before exploring further.
RESTful design and naming
RESTful design principles
Follow industry-standard REST conventions.HTTP methods
| Method | Description |
|---|---|
| GET | Retrieve resources |
| POST | Create a new resource |
| PUT | Fully update an existing resource |
| PATCH | Partially update an existing resource |
| DELETE | Delete a resource |
| OPTIONS | Show available methods (optional if docs cover it) |
| HEAD | Same as GET but returns only headers, no response body |
Naming conventions
URI naming
Rules:- Use plural nouns, lowercase, hyphenated names
- No verbs in URLs
- Nest resources only if there is a logical hierarchy or relationship
- Keep nesting shallow (2 levels max)
Resource identifiers: IDs vs UUIDs
Path parameters that identify a single resource should (if possible) use UUIDs. Rules:- UUIDs should be used for externally exposed REST APIs
- Numeric, auto-increment IDs (/users/1) must not be exposed; they have a risk for enumeration
- Only when there is no other way around it you can use auto-increment IDs
- Internal IDs may exist but should never be part of the public API contract
- Prevents ID enumeration and scraping
- Improves security by design
- Decouples API contracts from database implementation details
- Enables safer data migrations and sharding
Path parameter naming
Path parameters should be explicitly named: Avoid generic or naming to clarify to what resource the ID belongs to.Field naming (JSON bodies)
Use snake_case:Parameter naming in URI, path, body
Use snake_case consistently:How Apivalk Enforces These Standards
Most of the rules on this page are enforced automatically when you use resource controllers:- HTTP methods per mode —
Route::resource()picksPOSTfor create,GETfor view/list,PATCHfor update,DELETEfor delete. You can’t accidentally use the wrong verb for a CRUD mode. - Plural URLs — paths are derived from
$resource->getPluralName(). - Explicit path-parameter naming — the identifier property name (e.g.
{animal_uuid}) is used literally in the URL. There’s no generic{id}. - snake_case fields — property names on
AbstractPropertyinstances are used verbatim as JSON keys; keep them in snake_case and the API stays consistent.
StringProperty holding a UUID rather than an IntegerProperty.