Skip to content

Availability

Computed free appointment slots and the dates that have them. Availability is derived from Team Member schedules, existing appointments, and service durations — query it right before creating an appointment to offer valid start times.

Search free slots

Request

Computes the free start times for the given services within a date range of up to 7 days, optionally narrowed to one Team Member, by the same calculation as online booking. A slot is one Team Member at one start time: when several Team Members are free at the same time, each gets its own slot. starts_at carries the Location's UTC offset; pass it with team_member_id to createAppointment. Slots are sorted by starts_at, then team_member_id. For the dates with free time over a longer range (a booking calendar) use getAvailabilityDates.

  • Only services with online booking enabled in the Location are searched. Without team_member_id the search covers Team Members open for online booking. A working Team Member currently hidden from online booking yields 200 with an empty result, including when passed explicitly. An explicit id does not bypass the Team Member's current visibility setting.
  • The Location's technical Team Member setting is separate from the Team Member's online visibility. If a technical Team Member is configured, an incompatible explicit team_member_id returns 200 with an empty result. Without the parameter, the existing technical Team Member setting applies. An explicit matching id or an omitted parameter can return availability only if that technical Team Member is currently visible for online booking and the acting user's rights permit it.
  • Days before today in the Location's time zone have no free time.
  • Package services are planned: a package in service_ids[] fails with 422 validation_failed and errors[0].code = unsupported_service_type.
  • Visibility follows the acting user's rights in the Digital schedule: a Team Member outside the user's allowed Team Members (own appointments or own position) yields an empty result, and without team_member_id only allowed Team Members are searched.

This is a computed read-only aggregate: slots have no ids and can disappear at any moment when another request schedules an overlapping appointment (a lost race on create returns 409 slot_taken).

Security
OAuth2(Required scopes: availability:read) or ApiKey
Path
location_idintegerrequired

Identifier of the Location. Verified against the credential on every call — a Location the credential cannot access responds with 404.

Query
service_ids[]Array of integers, [ 1 .. 10 ] itemsrequired

Services the appointment will consist of, 1 to 10 ids. An unknown, deleted or foreign id, a service with online booking disabled in the Location, or more than 10 ids fails with 422 validation_failed, errors[0].pointer = service_ids[], source = query and code = invalid_value; a package service fails the same way with code = unsupported_service_type.

team_member_idinteger

Restrict the search to one Team Member. An id that is not a working Team Member of the Location (unknown, deleted or dismissed) fails with 422 validation_failed, errors[0].pointer = team_member_id, source = query and code = invalid_value. A working Team Member currently hidden from online booking returns 200 with empty slots or dates, including when explicitly requested; it does not fail with 422. An explicit id does not bypass the current online visibility setting. The Location's technical Team Member setting is separate from that visibility: an incompatible explicit id returns 200 with an empty result. When omitted, the existing technical Team Member setting applies. A matching explicit id and an omitted parameter both require that technical Team Member to be currently visible for online booking and permitted by the acting user's Team Member permissions.

date_fromstring, (date)required

First date of the range (inclusive), YYYY-MM-DD, in the Location's calendar.

date_tostring, (date)required

Last date of the range (inclusive), YYYY-MM-DD. Must not be earlier than date_from; the range covers at most 7 calendar days inclusive, i.e. date_to is at most 6 days after date_from; otherwise 422 validation_failed with errors[0].pointer = date_to, source = query and code = invalid_value.

curl -i -X GET \
  'https://developer.alteg.io/_mock/en/b2b-v3/openapi/locations/{location_id}/availability?service_ids%5B%5D=0&team_member_id=0&date_from=2019-08-24&date_to=2019-08-24' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Free slots of the requested services within the range.

Headers
RateLimit-Remaininginteger, (int32), >= 0

Requests left in the most constrained policy window that applies to this request.

RateLimit-Resetinteger, (int32), >= 0

On 429, seconds until the most constrained policy frees up; it equals Retry-After there. On a successful response it reports the length of that policy's window rather than the time left in the current one, so treat it as the window size, not as a countdown — the counter to pace against is RateLimit-Remaining.

RateLimit-Policystring

Most constrained policy applied to the request, as <limit>;w=<window in seconds>.

Example:"10;w=60"
X-Request-Idstring

Request identifier for support and log correlation.

Bodyapplication/json
objectstringrequired
Value:"availability"
slotsArray of objects(AvailabilitySlot)required

Sorted by starts_at, then team_member_id.

Response
{ "object": "availability", "slots": [ { … }, { … }, { … } ] }