Availability API
API for managing available slots and bookable times
Endpoints
Get Available Slots
Get available time slots for booking
http
GET /api/rpc/provider/availability/slotsParameters
| Name | Type | Description |
|---|---|---|
| providerId | UUID | Provider ID |
| serviceId | UUID | Service ID |
| date | string | Date (YYYY-MM-DD) |
| staffId | UUID | Staff ID (optional) |
Response
json
{
"slots": [
{ "time": "09:00", "available": true },
{ "time": "09:30", "available": true },
{ "time": "10:00", "available": false },
{ "time": "10:30", "available": true }
]
}Get Schedule
Get work schedule
http
GET /api/rpc/provider/availability/scheduleUpdate Schedule
Update work schedule
http
PATCH /api/rpc/provider/availability/scheduleBody
json
{
"monday": { "start": "09:00", "end": "18:00" },
"tuesday": { "start": "09:00", "end": "18:00" },
"wednesday": null,
"thursday": { "start": "09:00", "end": "18:00" },
"friday": { "start": "09:00", "end": "18:00" },
"saturday": { "start": "10:00", "end": "16:00" },
"sunday": null
}Set Time Off
Set time off
http
POST /api/rpc/provider/availability/timeOffBody
json
{
"startDate": "2025-02-01",
"endDate": "2025-02-05",
"reason": "Temporary closure"
}Calendar Sync
Sync with external calendars
http
GET /api/rpc/provider/calendarSync/status
POST /api/rpc/provider/calendarSync/connect
DELETE /api/rpc/provider/calendarSync/disconnectExample Code
typescript
// Get available slots
const slots = await fetch(
'/api/rpc/provider/availability/slots?providerId=provider_123&serviceId=svc_456&date=2025-01-20',
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } },
);
// Update schedule
await fetch('/api/rpc/provider/availability/schedule', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
monday: { start: '09:00', end: '18:00' },
}),
});