POST

Assign Working Hours Schedule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a staff member's working hours based on the specified schedule ID (SDK | REST).

Default working hours

By default, staff members work during the opening hours of the business's default location (SDK | REST).

Schedule ID

You can specify either the ID of the business's working hour schedule or the staff member's event schedule. The call fails if you specify a different schedule ID.

Staff event schedule

To customize a staff member's working hours, specify their event schedule ID as scheduleId. Refer to this sample flow (SDK | REST) for more details.

Business working hour schedule

To reset a staff member’s working hours to the default business hours, specify the ID of the business working hour schedule as scheduleId.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v1/staff-members/{staffMemberId}/assign-working-hours-schedule

Path Params
staffMemberIdstringRequired

ID of the staff member to assign the schedule to.

Body Params
scheduleIdstringRequiredformat GUID

ID of the schedule (SDK | REST) to assign to the staff member.

Must be either the staff member's event schedule ID or the working hour schedule ID for a business location.


fieldsArray <string>maxItems 3

Conditional fields to return.

Response Object
staffMemberStaffMember

Updated staff member.

Assign a custom working hours schedule to a staff member.
Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v1/staff-members/0954bbb2-88cd-445c-9827-44253eb8b039/assign-working-hours-schedule' \ -H 'Authorization: <AUTH>' \ -d '{ "scheduleId": "7c147d9e-89a8-4e2e-a723-b095db0610c1", "fields": ["RESOURCE_DETAILS"] }'
Response
JSON
{ "staffMember": { "id": "0954bbb2-88cd-445c-9827-44253eb8b039", "email": "MateusAraujoSantos1979@example.com", "name": "Mateus Araujo Santos", "resourceId": "136d9d9a-97ab-49fa-a0cf-ec24f500bd98", "default": false, "revision": "3", "createdDate": "2024-08-28T13:22:32.784Z", "updatedDate": "2024-08-28T14:16:11.948Z", "resource": { "id": "e0936563-7fd8-4e08-9db0-a327b2cb653e", "working_hours_schedules": [ { "id": "7c147d9e-89a8-4e2e-a723-b095db0610c1", "shared": false } ], "events_schedule": { "id": "7c147d9e-89a8-4e2e-a723-b095db0610c1" }, "uses_default_working_hours": false } } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?