Vexar API

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

TypeDescription
200OK
201Created
400Bad request
401Unauthorized — missing or invalid token
403Forbidden — no access or plan limit reached
404Not found
409Conflict (e.g. email already registered)
422Validation failed
429Too many requests — rate limited
500Server 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.