TheBooking Public API
Public REST API shipped by TheBooking 4. WordPress administration routes under /backend are not part of this contract.
Use this section when you need exact route names, parameters, request bodies, response envelopes, and complete request/response examples. For booking flows and implementation choices, start from API and webhooks and Integration workflows.
Base URL
https://example.com/wp-json/thebooking/v1/API/
Authentication
- Bearer token:
Authorization: Bearer $TBK_API_TOKEN - API key header: use the header configured in Settings > API & Webhooks.
- Read operations require
read; write operations requirewrite. - Authentication and scope errors are returned as HTTP
401or403responses.
Typical Flow
- Verify the token with Verify the current API token.
- Read services and providers if the external system lets users choose them.
- Query canonical availability for the intended time range.
- Create or update a customer.
- Create the reservation with the slot identity returned by availability.
The API does not bypass TheBooking availability rules. Reservation creation and rescheduling validate the slot again before saving.
Endpoints
| Method | Endpoint | Route | Scope |
|---|---|---|---|
GET | Verify the current API token | /auth/verify/ | read |
GET | Get canonical availability slots | /availability/get/ | read |
GET | List services | /services/get/ | read |
POST | Create an appointment service | /services/add/ | write |
POST | Update service properties | /services/edit/ | write |
POST | Remove a service without reservations | /services/remove/ | write |
GET | List providers | /providers/get/ | read |
POST | Update supported provider restrictions | /providers/edit/ | write |
POST | Update supported provider/service properties | /providers/edit/service/ | write |
GET | List customers | /customers/get/ | read |
POST | Create a customer | /customers/add/ | write |
POST | Update a customer | /customers/edit/ | write |
POST | Remove a customer without reservations | /customers/remove/ | write |
GET | List reservations | /reservations/get/ | read |
POST | Create one reservation from a canonical slot | /reservations/add/ | write |
POST | Update or reschedule a reservation | /reservations/edit/ | write |
POST | Remove a reservation allowed by the route policy | /reservations/remove/ | write |
Response Format
Successful application responses use status: "OK". Application-level failures use status: "KO" with a human-readable message. WordPress authentication failures use REST error objects with HTTP 401 or 403.
OpenAPI Contract
The machine-readable contract is available as OpenAPI 3.1 YAML.