Skip to main content

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

NameLocationRequiredTypeDescription
min_timestampqueryYesinteger (int64)Unix timestamp for the beginning of the availability window.
max_timestampqueryYesinteger (int64)Unix timestamp for the end of the availability window.
servicesqueryNostringComma-separated service IDs.
providersqueryNostringComma-separated provider IDs.

Request Body

This endpoint does not require a JSON request body.

Responses

StatusMeaningDescriptionBody
200SuccessAvailable slotsOkEnvelope + object
401Authentication requiredMissing or invalid API tokenWpRestError

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, and end values 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": {}
}
]
}