Get canonical availability slots
GET /availability/get/
What It Does
Return the canonical slots that TheBooking considers bookable for a service, provider, and time range.
Authentication
Requires an API token with the read scope. Send it as a bearer token or with the configured API key header.
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
min_timestamp | query | Yes | integer (int64) | Unix timestamp for the beginning of the availability window. |
max_timestamp | query | Yes | integer (int64) | Unix timestamp for the end of the availability window. |
services | query | No | string | Comma-separated service IDs. |
providers | query | No | string | Comma-separated provider IDs. |
Request Body
This endpoint does not require a JSON request body.
Responses
| Status | Meaning | Description | Body |
|---|---|---|---|
200 | Success | Available slots | OkEnvelope + object |
401 | Authentication required | Missing or invalid API token | WpRestError |
Booking Rules
- Always query availability before creating or rescheduling a reservation.
- Treat the returned slot data as a short-lived booking token: send the same
availabilityId,serviceId,providerId,start, andendvalues when creating the reservation.
Request Example
curl -X GET "https://example.com/wp-json/thebooking/v1/API/availability/get/?min_timestamp=1779148800&max_timestamp=1779753600&services=service_123&providers=123" \
-H "Authorization: Bearer $TBK_API_TOKEN"
Success Response Example
{
"status": "OK",
"response": [
{
"availabilityId": "slot_123",
"serviceId": "service_123",
"providerId": 123,
"start": 1779148800,
"end": 1779152400,
"bookable": true,
"routingMode": "manual",
"eligibleProviderIds": [
123
],
"reservationsCount": 1,
"overrides": {}
}
]
}