Create Staff Working Hours Schedule
const url = 'https://api.upvio.com/v1/businesses/example/staff/example/working-hours-schedules';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dateStart":"2026-04-15","dateEnd":"2026-04-15","workingHours":{"monday":[[900,1200],[1300,1700]],"tuesday":[[900,1200],[1300,1700]],"wednesday":[[900,1200],[1300,1700]],"thursday":[[900,1200],[1300,1700]],"friday":[[900,1200],[1300,1700]],"saturday":[[900,1200],[1300,1700]],"sunday":[[900,1200],[1300,1700]]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.upvio.com/v1/businesses/example/staff/example/working-hours-schedules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dateStart": "2026-04-15", "dateEnd": "2026-04-15", "workingHours": { "monday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "tuesday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "wednesday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "thursday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "friday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "saturday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "sunday": [ [ 900, 1200 ], [ 1300, 1700 ] ] } }'Experimental Feature. Subject to change. Create a Working Hours Schedule for a Staff. Must not conflict with an existing Working Hours Schedule.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The ID of the Business.
The ID of the Staff.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A configuration to define active hours.
object
A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]A group of active hours for a single day.
Example
[ [ 900, 1200 ], [ 1300, 1700 ]]Responses
Section titled “Responses”The created Working Hours Schedule.
object
A schedule to use with Staff to plan availability.
object
Unique identifier across the platform.
Time when the resource was created (ISO 8601 format).
Time when the resource was created (ISO 8601 format).
The ID of the Staff this resource belongs to.
A configuration to define active hours.
object
A group of active hours for a single day.
A group of active hours for a single day.
A group of active hours for a single day.
A group of active hours for a single day.
A group of active hours for a single day.
A group of active hours for a single day.
A group of active hours for a single day.
The timezone for this schedule
Example
{ "data": { "workingHours": { "monday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "tuesday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "wednesday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "thursday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "friday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "saturday": [ [ 900, 1200 ], [ 1300, 1700 ] ], "sunday": [ [ 900, 1200 ], [ 1300, 1700 ] ] }, "timezone": "America/New_York", "dateStart": "2024-01-01T00:00:00Z", "dateEnd": "2024-01-08T00:00:00Z" }}The staff ID is malformed, or the schedule does not start on a Sunday and end on a Saturday in the staff member’s timezone.
object
object
The specific error that occurred.
Human-readable description of the error.
Example
{ "error": { "code": 400, "type": "BadRequestError", "title": "Working Hours Schedule must start at the beginning of a week." }}The API key is missing or invalid, or the Business cannot be accessed with it.
object
object
The specific error that occurred.
Human-readable description of the error.
Example
{ "error": { "code": 403, "type": "UnauthorizedError", "title": "Invalid API token" }}The staff member does not exist.
object
object
The specific error that occurred.
Human-readable description of the error.
Example
{ "error": { "code": 404, "type": "NotFoundError", "title": "Resource not found" }}