API reference
Availability
Recurring availability patterns and on-demand availability checks. Define when entities are bookable, then ask the engine for valid slots.
Key points
- Availability has two surfaces: ad-hoc availability checks and persistent patterns
- Patterns are recurring (weekly schedules) or blackout (vacation, holidays)
- Higher-priority patterns override lower-priority ones — useful for layering exceptions on top of defaults
- POST /availability/check is the primitive used by Bookings and Suggestions internally
About availability
Two distinct concepts share this resource:
- Patterns — persistent records describing when an entity is or isn’t bookable. Recurring schedules (Mon-Fri 9-5), one-off blackouts (vacation, holidays), capacity-bounded windows.
- Checks — ad-hoc queries asking “is this entity available for this kind of event in this time range?”. Returns ranked slots.
Most integrations use Bookings for the high-level flow rather than calling availability check directly. The check endpoint exists for cases where you need finer control or the slot data without committing to a booking.
Check availability
/api/v1/availability/checkFind available time slots ranked by constraint satisfaction. Pre-allocates resources without committing them.
Headers
x-organization-idUUIDrequiredOrganization scope
x-template-idstringrequiredTemplate ID
Request body
Required: eventType, primaryEntity, timePreferences, durationMinutes. Required participants and resources are optional filters.
{
"eventType": "home_visit",
"primaryEntity": {
"entityId": "ent_pt_9001",
"entityType": "participant"
},
"requiredResources": [
{
"resourceType": "transport_vehicle",
"quantity": 1
}
],
"timePreferences": {
"preferredStart": "2026-05-08T10:00:00Z",
"flexibilityDays": 7,
"timeOfDay": ["morning", "early_afternoon"]
},
"durationMinutes": 60,
"limit": 10
}Responses
200Available slots and any overlapping blocked periods that limited the result set{
"slots": [
{
"startTime": "2026-05-08T10:00:00Z",
"endTime": "2026-05-08T11:00:00Z",
"score": 0.95,
"allocatedResources": [
{ "entityId": "res_van_2", "resourceType": "transport_vehicle" }
]
}
],
"blockedPeriods": [
{
"start": "2026-05-08T13:00:00Z",
"end": "2026-05-08T15:00:00Z",
"reason": "blackout_pattern"
}
]
}400Invalid request body — validation failedCheck is read-only
Create pattern
/api/v1/availability/patternsDefine a recurring availability or blackout pattern for an entity.
Headers
x-organization-idUUIDrequiredOrganization scope
Request body
Required: entityId, patternType, startTime, endTime. Day-of-week and date ranges scope the pattern’s applicability.
{
"entityId": "ent_staff_a8f4",
"patternType": "recurring",
"patternName": "Standard weekday shift",
"dayOfWeek": [1, 2, 3, 4, 5],
"startTime": "09:00",
"endTime": "17:00",
"startDate": "2026-01-01",
"endDate": "2026-12-31",
"priority": 100,
"capacity": 1,
"timezone": "America/New_York"
}Responses
201Pattern created{
"id": "pat_a8f4c2d1-...",
"entityId": "ent_staff_a8f4",
"patternType": "recurring",
"patternName": "Standard weekday shift",
"dayOfWeek": [1, 2, 3, 4, 5],
"startTime": "09:00",
"endTime": "17:00",
"isActive": true,
"priority": 100,
"createdAt": "2026-04-26T15:30:00.000Z"
}400Invalid request body — validation failedList patterns
/api/v1/availability/patternsPaginated list of patterns with rich filters.
Headers
x-organization-idUUIDrequiredOrganization scope
Query parameters
entityIdUUIDFilter to one entity
patternTypeenumrecurring or blackout
blockReasonstringFilter blackouts by reason (e.g. vacation, holiday)
isActivebooleanFilter by active flag
effectiveDatedatePatterns effective on this date
startDateFromdatePatterns starting on or after this date
startDateTodatePatterns starting on or before this date
endDateFromdatePatterns ending on or after this date
endDateTodatePatterns ending on or before this date
dayOfWeekintegerFilter by ISO day of week (1=Mon, 7=Sun)
minPriorityintegerMinimum priority
limitintegerDefault 20, max 100
offsetintegerDefault 0
orderBystringpriority, startDate, or createdAt
orderDirectionenumasc or desc
Responses
200List of matching patternsGet pattern
/api/v1/availability/patterns/{patternId}Retrieve a single pattern by ID.
Headers
x-organization-idUUIDrequiredOrganization scope
Path parameters
patternIdstringrequiredPattern ID
Responses
200Pattern returned{
"id": "pat_a8f4c2d1-...",
"entityId": "ent_staff_a8f4",
"patternType": "recurring",
"patternName": "Standard weekday shift",
"dayOfWeek": [1, 2, 3, 4, 5],
"startTime": "09:00",
"endTime": "17:00",
"isActive": true,
"priority": 100,
"createdAt": "2026-04-26T15:30:00.000Z"
}404Pattern not foundUpdate pattern
/api/v1/availability/patterns/{patternId}Modify pattern fields. Times, dates, priority, and active state are all mutable.
Headers
x-organization-idUUIDrequiredOrganization scope
Path parameters
patternIdstringrequiredPattern to update
Responses
200Pattern updated successfully404Pattern not foundDelete pattern
/api/v1/availability/patterns/{patternId}Hard-delete a pattern. Existing events are not modified, but new bookings will no longer respect this pattern.
Headers
x-organization-idUUIDrequiredOrganization scope
Path parameters
patternIdstringrequiredPattern to delete
Responses
200Pattern deleted successfully404Pattern not foundPattern types
The two pattern types behave differently:
Recurring patterns
Define when an entity is available. Day-of-week + time-of-day. The most common pattern — a staff member’s regular schedule, a clinic’s operating hours, a room’s booking window.
Higher priority overrides lower priority. A staff member might have a base recurring pattern at priority 100 (Mon-Fri 9-5) and a Wednesday-late-start pattern at priority 200 (Wed 11-5). The higher-priority pattern wins on Wednesdays.
Blackout patterns
Define when an entity is not available, regardless of recurring patterns. Vacations, holidays, training days, system maintenance windows.
Blackouts always win over recurring patterns when they overlap — that’s the point. Use blockReason to categorize them for analytics.
{
"entityId": "ent_staff_a8f4",
"patternType": "blackout",
"patternName": "Vacation",
"blockReason": "vacation",
"startDate": "2026-07-01",
"endDate": "2026-07-14",
"priority": 200
}Don’t set capacity unless you mean it