yes this would be great. we currently have to put a job in to the techs day for holidays etc. as it will allow bookings due to not being able to read the leave.
Staff Leave entries (the blocks shown on Staff Schedules via the Staff Leave add-on) aren’t currently exposed via the public ServiceM8 REST API, so there isn’t a “leave” or “availability” JSON endpoint you can query to pull those leave records into an add-on.
If the goal is to keep staff time blocked out automatically, the supported options today are:
Use the Calendar Import add-on to import a staff member’s free/busy time from an external calendar into the Dispatch Board (this also marks them as “Busy” and is taken into account by Booking Suggestions).
Create a “blocking job” to reserve the time in the schedule, using the normal scheduling endpoints (for example JobActivity).
For reference, a Scheduled Booking in the UI maps to a JobActivity record in the API (activity_was_scheduled == 1), and Job Activities can be created via POST /jobactivity.json (requires the manage_schedule scope).
If you’re looking to block out holidays (without creating a dummy job booking), the supported way is the Staff Leave add-on, which blocks out that time in Staff Schedules:
For API-driven scheduling data, the documented schedule endpoints are JobActivity and JobAllocation (scopes read_schedule / manage_schedule). In the REST API, a “Scheduled Booking” maps to a JobActivity where activity_was_scheduled == 1.
If your leave data lives in an external calendar, the Calendar Import add-on can import staff busy time, show it on the Dispatch Board as “Busy”, and have it taken into account by Booking Suggestions:
If having Staff Leave/availability available via the REST API would unlock your add-ons, send the use case through to support@servicem8.com as a feature request.