Create Availability
Add a new availability time slot
POST
/calendar/availabilityRequires
Bearer authenticationAdd a new availability time slot for a specific day of the week. You can optionally restrict the slot to a specific appointment type.
Request Body
day_of_weekintegerrequiredDay of week (0=Sunday, 1=Monday, ... 6=Saturday).
start_timestringrequiredStart time in HH:MM:SS format (e.g., '09:00:00').
end_timestringrequiredEnd time in HH:MM:SS format (e.g., '17:00:00').
appointment_type_idstringRestrict this slot to a specific appointment type.
is_activebooleanWhether this slot is active. Defaults to true.
POST
/calendar/availabilitycurl -X POST "https://api.vastal.agency/v1/calendar/availability" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "day_of_week": 1, "start_time": "09:00:00", "end_time": "12:00:00" }'
const response = await fetch( 'https://api.vastal.agency/v1/calendar/availability', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ day_of_week: 1, start_time: '09:00:00', end_time: '12:00:00' }) } ); const data = await response.json();
import requests response = requests.post( 'https://api.vastal.agency/v1/calendar/availability', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'day_of_week': 1, 'start_time': '09:00:00', 'end_time': '12:00:00' } ) data = response.json()
200Success
{ "schedule": { "id": "avail_new123", "org_id": "org_xyz789", "day_of_week": 1, "start_time": "09:00:00", "end_time": "12:00:00", "appointment_type_id": null, "is_active": true, "created_at": "2024-01-20T12:00:00Z" } }
400Bad Request
{ "error": "day_of_week, start_time, and end_time are required" }