EN2H Booking Platform API
A REST API for managing bookable services and customer bookings — with JWT auth, business-rule validation and interactive documentation.
01
Register & log in
Create a staff account and receive short-lived access + refresh tokens.
02
Authorize in Swagger
Click Authorize, paste your access token, and test every endpoint live.
03
Create & manage
Add services, take public bookings, and move them through the status flow.
Endpoint reference
All routes are prefixed with /api/v1. PUBLIC needs no token; AUTH requires a Bearer token.
| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /auth/register | PUBLIC | Create an account, returns user + tokens |
| POST | /auth/login | PUBLIC | Sign in, returns user + tokens |
| POST | /auth/refresh | PUBLIC | Rotate token pair |
| POST | /auth/logout | AUTH | Invalidate refresh token |
| POST | /services | AUTH | Create a service |
| GET | /services | PUBLIC | List services (search, paginate) |
| GET | /services/:id | PUBLIC | Get one service |
| PATCH | /services/:id | AUTH | Update a service |
| DELETE | /services/:id | AUTH | Delete a service |
| POST | /bookings | PUBLIC | Create a booking as a customer |
| GET | /bookings | AUTH | List bookings (filters, paginate) |
| GET | /bookings/:id | AUTH | Get one booking |
| PATCH | /bookings/:id/status | AUTH | Change status (transition rules) |
| PATCH | /bookings/:id/cancel | AUTH | Cancel a booking |
| GET | /health | PUBLIC | Liveness probe |