Get availability intervals by service
This endpoint allows querying the different availability intervals defined for the employees of a service within a period not exceeding 31 days.
GET /api/v1/businesses/{businessId}/service/{serviceId}/disponibility?from={yyyy-MM-dd}&to={yyyy-MM-dd}
If the data included in the request is correct —both businessId and serviceId— the response will contain the availability intervals defined for all employees of the service, detailing the following information:
-
serviceId: external identifier of the service.
-
from: start date specified in the request.
-
to: end date specified in the request.
-
disponibilityIntervals: set of availability intervals defined within the queried time period.
-
from: start date of the availability interval.
-
to: end date of the availability interval, if defined.
-
type: method used to define availability for this interval. Possible values are
DAY_TYPE
(day type),SHIFT_PATTERN
(shift patterns), andCALENDAR
(assignment calendar). -
personId: external identifier of the employee to whom the availability interval belongs.
-
Below is an example request:
GET /api/v1/businesses/BUSINESSID/service/SERVICEID/disponibility?from=2025-03-01&to=2025-03-20
{
"serviceId": "SERVICEID",
"from": "2025-03-01",
"to": "2025-03-20",
"disponibilityIntervals": [
{
"from": "2016-02-29",
"type": "DAY_TYPE",
"personId": "1006348"
},
{
"from": "2021-10-01",
"to": "2025-03-10",
"type": "DAY_TYPE",
"personId": "1006356"
},
{
"from": "2025-03-11",
"type": "SHIFT_PATTERN",
"personId": "1006356"
}
]
}
As shown in the example, if an employee has multiple availability intervals defined for the range specified in the URL, the request will return the specifications of each one.
Considerations
If the service specified in the URL does not exist in the business, the request will return a 404 Not Found
error indicating not exits.
If the time interval specified in the URL exceeds 31 days, the request will return a 400 Bad Request
error, specifying in the message The request exceded the maximum number of days allowed (31 days max).
If no availability intervals are defined for the service or for the requested date range, the disponibilityIntervals
field will contain an empty array []
.
Useful links
What is employee availability?