Skip to main content

Appointment Availability

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 "x-api-key: YOUR_API_KEY"

Response — 200 OK

{
"success": true,
"date": "2026-07-15",
"slots": [
{
"slot_id": "f3c2b61b-52d9-4a71-8ae8-63f4464711b9||2026-07-15",
"calendar_id": "f3c2b61b-52d9-4a71-8ae8-63f4464711b9",
"parent_calendar_id": null,
"branch_id": "5dd088a7-285a-405a-a0de-1c6ff0e9bd78",
"day": "wednesday",
"session": "evening",
"batch": "A",
"start_time": "15:30",
"end_time": "16:00",
"appointment_type": null,
"max_slots": 12,
"ai_slots": 12,
"filled_slots": 0,
"available_slots": 12,
"status": "OPEN",
"created_at": "2026-06-19T06:14:13.944Z",
"updated_at": "2026-07-06T04:43:50.249Z"
}
]
}

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 "x-api-key: YOUR_API_KEY"

Response — 200 OK

{
"success": true,
"data": [
{
"slot_id": "f3c2b61b-52d9-4a71-8ae8-63f4464711b9||2026-07-15||",
"calendar_id": "f3c2b61b-52d9-4a71-8ae8-63f4464711b9",
"appointment_type_id": null,
"appointment_type_name": null,
"date": "2026-07-15",
"day_of_week": "wednesday",
"session": "Evening",
"batch": "A",
"start_time": "15:30",
"end_time": "16:00",
"max_slots": 12,
"ai_slots": 12,
"filled_slots": 0,
"agent_filled": 0,
"available_slots": 12,
"status": "OPEN",
"child_types": [
"42031a9f-368a-46ee-ba4a-724d744f9c03",
"13af12ed-4c62-46cb-ae77-88819d3ab4ee",
"1ef5c539-c545-4c70-a9bd-482cbf62cdf1"
]
}
]
}

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 "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "CLOSED"}'

Response — 200 OK

{
"success": true,
"data": {
"_id": "6a4d45c9f01a52acd5487fea",
"org_id": "8ba8b0bf-c63e-421c-b22d-1f64a964c155",
"batch_name": "A",
"date_str": "2026-07-15",
"appointment_type_id": null,
"branch_id": "5dd088a7-285a-405a-a0de-1c6ff0e9bd78",
"calendar_id": "f3c2b61b-52d9-4a71-8ae8-63f4464711b9",
"date": "2026-07-14T18:30:00.000Z",
"day_of_week": "wednesday",
"session": "Evening",
"batch_start": "15:30",
"batch_end": "16:00",
"max_slots": 12,
"max_agent_slots": 12,
"agent_filled": 0,
"prebooking_filled": 0,
"walkin_filled": 0,
"total_filled": 0,
"available": 12,
"status": "OPEN",
"max_slots_overridden": true
}
}
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 "x-api-key: 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