Skip to main content

Availability & Schedule Tracking

Query live availability and per-date capacity data to determine when appointments can be booked, and manage the schedule tracking records that back the booking engine.


Before You Begin

  • GET /v1/appointment-slots/availability and GET /v1/appointment-slots/schedule-tracking require the slots:read scope.
  • PATCH /v1/appointment-slots/tracking/:slot_id and POST /v1/appointment-slots/regenerate require the slots:write scope.

Get Availability

Returns all open calendar windows for a specific date, with live filled and available slot counts.

  • Endpoint: GET https://api.huskyvoice.ai/v1/appointment-slots/availability
  • Required scope: slots:read
ParameterRequiredDescription
dateYesDate to check — YYYY-MM-DD
branch_idNoFilter by branch UUID
sessionNoFilter by session: Morning, Afternoon, or Evening
curl -s "https://api.huskyvoice.ai/v1/appointment-slots/availability?date=2026-06-15&session=Morning" \
-H "Authorization: Bearer YOUR_API_KEY"

Response — 200 OK

{
"success": true,
"date": "2026-06-15",
"slots": [
{
"slot_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890||2026-06-15",
"calendar_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_id": "branch_uuid_here",
"day": "monday",
"session": "Morning",
"batch": "MA",
"start_time": "09:00",
"end_time": "11:00",
"appointment_type": null,
"max_slots": 20,
"ai_slots": 10,
"filled_slots": 3,
"available_slots": 7,
"status": "OPEN",
"created_at": "2026-05-01T10:00:00.000Z",
"updated_at": "2026-05-01T10:00:00.000Z"
}
]
}
slot_id in availability responses

The slot_id in availability results uses the 2-part format calendar_id||YYYY-MM-DD. Pass this value directly to the PATCH or disable endpoints — the server extracts the calendar ID from the first segment automatically.

filled_slots counts confirmed appointments for the window on that date. available_slots is computed as ai_slots − filled_slots.


Get Schedule Tracking

Returns per-date schedule tracking records — the persistent fill-count projections the booking engine maintains for each calendar window and date.

  • Endpoint: GET https://api.huskyvoice.ai/v1/appointment-slots/schedule-tracking
  • Required scope: slots:read
ParameterRequiredDescription
date_fromYesStart date — YYYY-MM-DD
date_toNoEnd date — YYYY-MM-DD (defaults to date_from if omitted)
branch_idNoFilter by branch UUID
appointment_type_idNoFilter by service UUID
sessionNoFilter by session
curl -s "https://api.huskyvoice.ai/v1/appointment-slots/schedule-tracking?date_from=2026-06-15&date_to=2026-06-21" \
-H "Authorization: Bearer YOUR_API_KEY"

Response — 200 OK

{
"success": true,
"data": [
{
"slot_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890||2026-06-15||f47ac10b-58cc-4372-a567-0e02b2c3d479",
"calendar_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"appointment_type_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"appointment_type_name": "General Checkup",
"date": "2026-06-15",
"day_of_week": "monday",
"session": "Morning",
"batch": "MA",
"start_time": "09:00",
"end_time": "11:00",
"max_slots": 20,
"filled_slots": 3,
"available_slots": 17,
"status": "OPEN"
}
]
}
slot_id in schedule tracking responses

The slot_id in schedule tracking results uses the 3-part format calendar_id||YYYY-MM-DD||appointment_type_id. Pass this value directly to PATCH /v1/appointment-slots/tracking/:slot_id.


Update a Schedule Tracking Record

Override the status or max_slots for a specific date's tracking record. Filled and available counts are always computed from live appointment data and cannot be set directly.

  • Endpoint: PATCH https://api.huskyvoice.ai/v1/appointment-slots/tracking/{slot_id}
  • Required scope: slots:write

The {slot_id} must be the 3-part format from a schedule-tracking response: calendar_id||YYYY-MM-DD||appointment_type_id.

curl -s -X PATCH \
"https://api.huskyvoice.ai/v1/appointment-slots/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890||2026-06-15||f47ac10b-58cc-4372-a567-0e02b2c3d479" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "CLOSED"}'
FieldDescription
status"OPEN" or "CLOSED" — overrides the window's status for this date only
max_slotsOverride the slot capacity for this date only

Regenerate Schedule Tracking

Recreates schedule tracking records for a date range from the current calendar window definitions. Use this after making changes to calendar windows to ensure the per-date projections are up to date.

  • Endpoint: POST https://api.huskyvoice.ai/v1/appointment-slots/regenerate
  • Required scope: slots:write
curl -s -X POST https://api.huskyvoice.ai/v1/appointment-slots/regenerate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date_from": "2026-06-15", "date_to": "2026-06-30"}'
FieldRequiredDescription
date_fromYesStart of the regeneration range — YYYY-MM-DD
date_toNoEnd of the range — YYYY-MM-DD (defaults to date_from if omitted)

Response — 200 OK

{
"success": true,
"processed": 16,
"skipped": 0,
"errors": 0,
"upserted": 16
}

Error Codes

StatusCodeCause
400VALIDATION_ERRORMissing required parameter (date or date_from)
404NOT_FOUNDSchedule tracking record not found (PATCH only)
403INSUFFICIENT_SCOPEAPI key does not have the required scope