Documentation menu

API reference

The app and the admin panel use the same REST API under /api/v1. You can use it too, for example to connect a website, a CRM or your own reports.

Where the reference is

Format Where
HTML reference with examples https://your-api-domain/docs/api (turned off in production; set API_DOCS_ENABLED=true in .env to show it)
OpenAPI 3 docs/api/openapi.yaml in the package. Import it into Swagger UI, Insomnia, Stoplight or a code generator.
Postman collection docs/api/postman_collection.json. Set the baseUrl variable to your server.

After changing an endpoint in the code, regenerate all three with php artisan docs:api.

Authentication

App users (customers and providers) use bearer tokens:

curl -X POST https://api.yourbrand.com/api/v1/auth/login \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -d '{"email": "sarah@example.com", "password": "…", "device_name": "my-script"}'

The response contains a token. Send it with every request:

Authorization: Bearer <token>

The admin panel uses a cookie session instead (Laravel Sanctum's SPA mode): call GET /sanctum/csrf-cookie, then POST /api/v1/admin/login, and send the X-XSRF-TOKEN header on later requests. The admin's origin must be listed in SANCTUM_STATEFUL_DOMAINS. Admin endpoints live under /api/v1/admin/*.

Public endpoints such as GET /api/v1/config, GET /api/v1/categories and provider profiles need no token.

Language

Send Accept-Language: id (or any enabled language) to get texts, error messages and catalog names in that language. The response says which language it used in Content-Language.

Responses and errors

Successful responses wrap the data in data; lists add meta and links for paging:

{ "data": [ … ], "meta": { "current_page": 1, "last_page": 3, "per_page": 20, "total": 52 } }

Every error, including validation errors, has the same shape:

{
  "message": "Someone just booked that time. Please pick another one.",
  "errors": {},
  "code": "BOOKING_SLOT_TAKEN"
}
  • message is human-readable and translated.
  • errors lists problems per field (for HTTP 422).
  • code is stable: build your logic on it, not on the message. The full list is in backend/app/Enums/ErrorCode.php.

Money is in the smallest currency unit (cents) with a currency field. Times are ISO 8601 in UTC.

Rate limits

Sign-in, sign-up and code requests are rate limited per IP and account. Too many tries return HTTP 429 with the code TOO_MANY_REQUESTS; wait a minute and try again.