Update Availability
Bulk update availability schedules
PUT
/calendar/availabilityRequires
Bearer authenticationReplace all availability schedules with a new set. This is useful for setting up weekly availability in one request.
Request Body
schedulesarrayrequiredArray of availability slots to set.
day_of_weekintegerrequiredDay of week (0=Sunday through 6=Saturday).
start_timestringrequiredStart time in HH:MM:SS format.
end_timestringrequiredEnd time in HH:MM:SS format.
appointment_type_idstringOptional appointment type restriction.
PUT
/calendar/availabilitycurl -X PUT "https://api.vastal.agency/v1/calendar/availability" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "schedules": [ { "day_of_week": 1, "start_time": "09:00:00", "end_time": "17:00:00" }, { "day_of_week": 2, "start_time": "09:00:00", "end_time": "17:00:00" }, { "day_of_week": 3, "start_time": "09:00:00", "end_time": "17:00:00" }, { "day_of_week": 4, "start_time": "09:00:00", "end_time": "17:00:00" }, { "day_of_week": 5, "start_time": "09:00:00", "end_time": "12:00:00" } ] }'
const response = await fetch( 'https://api.vastal.agency/v1/calendar/availability', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ schedules: [ { day_of_week: 1, start_time: '09:00:00', end_time: '17:00:00' }, { day_of_week: 2, start_time: '09:00:00', end_time: '17:00:00' }, { day_of_week: 3, start_time: '09:00:00', end_time: '17:00:00' }, { day_of_week: 4, start_time: '09:00:00', end_time: '17:00:00' }, { day_of_week: 5, start_time: '09:00:00', end_time: '12:00:00' } ] }) } ); const data = await response.json();
import requests response = requests.put( 'https://api.vastal.agency/v1/calendar/availability', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'schedules': [ {'day_of_week': 1, 'start_time': '09:00:00', 'end_time': '17:00:00'}, {'day_of_week': 2, 'start_time': '09:00:00', 'end_time': '17:00:00'}, {'day_of_week': 3, 'start_time': '09:00:00', 'end_time': '17:00:00'}, {'day_of_week': 4, 'start_time': '09:00:00', 'end_time': '17:00:00'}, {'day_of_week': 5, 'start_time': '09:00:00', 'end_time': '12:00:00'} ] } ) data = response.json()
200Success
{ "schedules": [ { "id": "avail_1", "day_of_week": 1, "start_time": "09:00:00", "end_time": "17:00:00", "is_active": true }, { "id": "avail_2", "day_of_week": 2, "start_time": "09:00:00", "end_time": "17:00:00", "is_active": true }, { "id": "avail_3", "day_of_week": 3, "start_time": "09:00:00", "end_time": "17:00:00", "is_active": true }, { "id": "avail_4", "day_of_week": 4, "start_time": "09:00:00", "end_time": "17:00:00", "is_active": true }, { "id": "avail_5", "day_of_week": 5, "start_time": "09:00:00", "end_time": "12:00:00", "is_active": true } ] }