Responses & Errors
Every response is JSON and includes a success boolean. Successful payloads place data under a named key that describes the resource (for example booking, bookings, user) — there is no single universal data wrapper.
Success
A typical success response — note the resource-specific key:
{
"success": true,
"bookings": [ { "id": 12, "status": "confirmed", … } ],
"total": 42
} Some endpoints use a generic envelope via the framework helpers:
// Response::success(): {"success": true, "message": "OK", ...fields}
// Response::paginated():
{
"success": true,
"data": [ … ],
"pagination": { "total": 120, "page": 1, "per_page": 50, "pages": 3 }
}
Errors
Errors set success: false, an error message, and the matching HTTP status. Validation errors (422) may include a per-field errors object.
{
"success": false,
"error": "Validation failed",
"errors": { "email": "Invalid email" }
}
Status codes
| Type | Description |
|---|---|
200 | OK |
201 | Created |
400 | Bad request |
401 | Unauthorized — missing or invalid token |
403 | Forbidden — no access or plan limit reached |
404 | Not found |
409 | Conflict (e.g. email already registered) |
422 | Validation failed |
429 | Too many requests — rate limited |
500 | Server error |
Pagination
List endpoints accept limit and offset query parameters (defaults vary, commonly limit=50, offset=0) and return a total count alongside the items.