Create a schedule
Changed on Create a schedule for the authenticated user.
The point of creating schedules is for event types to be available at specific times.
The first goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.
1. If you passed `timeZone` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. The managed user can then change the default schedule via the `AvailabilitySettings` atom.
2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying
`"isDefault": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.
The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.
After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.
When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
Request
- The document declares no server URL.
- Auth: none declared. Required headers: Authorization, cal-api-version
Headers
value must be Bearer <token> where <token> is api key prefixed with cal_ or managed user access token
Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.
Request body
Example request
{
"name": "Catch up hours",
"timeZone": "Europe/Rome",
"availability": [
{
"days": [
"Monday",
"Tuesday"
],
"startTime": "17:00",
"endTime": "19:00"
},
{
"days": [
"Wednesday",
"Thursday"
],
"startTime": "16:00",
"endTime": "20:00"
}
],
"isDefault": true,
"overrides": [
{
"date": "2024-05-20",
"startTime": "18:00",
"endTime": "21:00"
}
]
}Response
Example response
{
"status": "success",
"data": {
"id": 254,
"ownerId": 478,
"name": "Catch up hours",
"timeZone": "Europe/Rome",
"availability": [
{
"days": [
"Monday",
"Tuesday"
],
"startTime": "17:00",
"endTime": "19:00"
},
{
"days": [
"Wednesday",
"Thursday"
],
"startTime": "16:00",
"endTime": "20:00"
}
],
"isDefault": true,
"overrides": [
{
"date": "2024-05-20",
"startTime": "18:00",
"endTime": "21:00"
}
]
}
}Changes
- breaking
removed the enum value
Fridayof the request property// - breaking
removed the enum value
Mondayof the request property// - breaking
removed the enum value
Saturdayof the request property// - breaking
removed the enum value
Sundayof the request property// - breaking
removed the enum value
Thursdayof the request property// - breaking
removed the enum value
Tuesdayof the request property// - breaking
removed the enum value
Wednesdayof the request property// - info
removed the pattern
TIME_FORMAT_HH_MMfrom the request property// - info
removed the pattern
TIME_FORMAT_HH_MMfrom the request property// - info
removed the pattern
TIME_FORMAT_HH_MMfrom the request property// - info
removed the pattern
TIME_FORMAT_HH_MMfrom the request property// - info
removed the
Fridayenum value from the///response property for the response status - info
removed the
Mondayenum value from the///response property for the response status - info
removed the
Saturdayenum value from the///response property for the response status - info
removed the
Sundayenum value from the///response property for the response status - info
removed the
Thursdayenum value from the///response property for the response status - info
removed the
Tuesdayenum value from the///response property for the response status - info
removed the
Wednesdayenum value from the///response property for the response status - info
the
///response's property patternTIME_FORMAT_HH_MMwas removed for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas removed for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas removed for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas removed for the status
- breaking
- breaking
request property
//was restricted to a list of enum values - breaking
added the pattern
TIME_FORMAT_HH_MMto the request property// - breaking
added the pattern
TIME_FORMAT_HH_MMto the request property// - breaking
added the pattern
TIME_FORMAT_HH_MMto the request property// - breaking
added the pattern
TIME_FORMAT_HH_MMto the request property// - warning
added the new
Fridayenum value to the///response property for the response status - warning
added the new
Mondayenum value to the///response property for the response status - warning
added the new
Saturdayenum value to the///response property for the response status - warning
added the new
Sundayenum value to the///response property for the response status - warning
added the new
Thursdayenum value to the///response property for the response status - warning
added the new
Tuesdayenum value to the///response property for the response status - warning
added the new
Wednesdayenum value to the///response property for the response status - info
added the new
Fridayenum value to the request property// - info
added the new
Mondayenum value to the request property// - info
added the new
Saturdayenum value to the request property// - info
added the new
Sundayenum value to the request property// - info
added the new
Thursdayenum value to the request property// - info
added the new
Tuesdayenum value to the request property// - info
added the new
Wednesdayenum value to the request property// - info
the
///response's property patternTIME_FORMAT_HH_MMwas added for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas added for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas added for the status - info
the
///response's property patternTIME_FORMAT_HH_MMwas added for the status
- breaking