> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md

## Article Content:

# About the Staff Members API

The Staff Members API enables you to manage the staff of a business and their
working hour schedules. If a staff member is a Wix user, they can manage their
own schedule through the dashboard.

A business's staff isn't limited to the people who deliver services to
customers. Receptionists, managers, and cashiers are staff members too. They
have working hours and appear in the staff list, but customers can't book them.
The `serviceProvider` field marks which staff members are bookable.

With the Staff Members API, you can:

- Manage staff members.
- Manage staff schedules.
- Retrieve the business's service providers, or its entire staff.
- Promote and demote staff members between service providers and non-providers.
- Connect and disconnect Wix users to staff members.

## Service providers

`serviceProvider` drives both which staff appear in booking flows and which staff the read methods
return by default.

Set it when you create a staff member, with the `serviceProvider` field of
[Create Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/create-staff-member.md).
Change it afterward by calling
[Set Service Provider](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/set-service-provider.md).
Promoting a staff member also grants the Wix user connected to them the Staff role, if they don't
already have it. Demoting doesn't revoke that role, and doesn't remove the staff member's working
hours, service assignments, or existing bookings. They just stop appearing in booking flows, and the
call is reversible.

The API provides 2 sets of read methods, which differ in the staff they return by default:

- [Query Staff Members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/query-staff-members.md), [Search Staff Members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/search-staff-members.md), and [Count Staff Members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/count-staff-members.md) return only service providers, unless you pass an explicit `serviceProvider` filter. Use them for booking flows, such as letting a customer choose who delivers a service.
- [Query Staff Members V2](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/query-staff-members-v2.md), [Search Staff Members V2](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/search-staff-members-v2.md), and [Count Staff Members V2](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/count-staff-members-v2.md) return the entire staff, including staff members who don't provide services. Use them for team management flows, such as a staff directory or a working hours planner. To narrow the results to service providers only, filter by `serviceProvider`.

## Before you begin

It’s important to note the following points before starting to code:

- [Wix Bookings](https://www.wix.com/app-market/web-solution/bookings)
  must be installed on a site before you can use the Staff Members API.
- Wix Bookings automatically manages a special [resource type](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md)
  for all staff members. To avoid data conflicts, don't use the [Resources V2](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction.md)
  and [Resource Types V2](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md)
  APIs to manage staff.
- By default, staff members work during the opening hours of the business's [default location](https://dev.wix.com/docs/rest/business-management/locations/introduction.md).
  You can define custom hours by calling [Assign Working Hours Schedule to Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/assign-working-hours-schedule.md)
  and then creating `WORKING_HOURS` events with the [Calendar Events V3 API](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md).
  See [how Wix Bookings uses the Calendar APIs](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration.md)
  and the [set a staff member's weekly working hours sample flow](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md)
  for more details.
- To block a staff member's availability for vacation days or time off, create an `OPAQUE` event on their event schedule using the [Calendar Events V3 API](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). See the [block a staff member's availability for a vacation day sample flow](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).
- To get a staff member's event schedule ID, call [Get Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/get-staff-member.md) with `RESOURCE_DETAILS` in the `fields` parameter and read the `resource.eventsSchedule.id` field.
- `name`, `email`, and `phone` hold personally identifiable information. You can sort on them in the
  Search methods, but the Query methods reject a sort on any of them with an `INVALID_SORT` error.
  For the fields you can filter and sort by, see
  [Filtering and Sorting](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/filtering-and-sorting.md).

## Use cases

- [Connect a staff member to a Wix user](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).
- [Build a staff directory of the entire team](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).
- [Make a staff member bookable](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).
- [Set a staff member's weekly working hours](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).
- [Block a staff member's availability for a vacation day](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md).

## Terminology

- __Staff member__: An individual who works for the business. Some staff members
  deliver services to customers, and others, such as receptionists and managers,
  don't.
- __Service provider__: A staff member who delivers services to customers and
  who customers can book. Indicated by the `serviceProvider` field.
- __Resource__: An asset, such as a meeting room or equipment, needed to
  deliver services to customers.
- __Resource type__: A classification that connects resources, making them
  bookable.
- __Working hour schedule__:
  A [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md)
  defining when a staff member is available for bookings. Learn more about [how Wix Bookings uses the Calendar APIs](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration.md).
- __Wix user__: An individual logged into their account on **.wix.com**.
  This includes site owners, collaborators, and app owners. Not all staff
  members are Wix users, and not all users connected to a Wix Bookings site are staff members. Learn more about [identities](https://dev.wix.com/docs/rest/articles/getting-started/about-identities.md).

For a comprehensive glossary of Wix Bookings terms, see [Terminology](https://dev.wix.com/docs/rest/business-solutions/bookings/terminology.md).

## See also

- Related APIs:
  - [Services](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction.md)
  - [Calendar APIs](https://dev.wix.com/docs/rest/business-management/calendar/introduction.md)
  - [Calendar Events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md)
  - [Calendar Schedules](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md)
  - [Resources](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction.md)
  - [Resource Types](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md)
  - [Locations](https://dev.wix.com/docs/rest/business-management/locations/introduction.md)
- How business owners can:
  - [Manage their resources](https://support.wix.com/en/article/wix-bookings-managing-your-resources).
  - [Manage their staff](https://support.wix.com/en/managing-your-staff).
  
## SDK Setup
  `@wix/bookings`

To use the API, install the `@wix/bookings` package.

#### Install the package

Follow the installation instructions for your development environment.

| Development environment | Installation method |
|--|--|
| Wix sites (editor or IDE) | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor.md). |
| Wix sites (local IDE) | Run `wix install @wix/bookings` using the [Wix CLI](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-with-the-wix-cli.md).|
| Blocks apps | Use the same installation method as Wix sites. |
| CLI and self-hosted apps | Run `npm install @wix/bookings` or `yarn add @wix/bookings`. |
| Headless sites and apps | Run `npm install @wix/bookings` or `yarn add @wix/bookings`. |

#### Import the package

To import the package in your code:

```js
import { staffMembers } from '@wix/bookings'
```

#### Import types

Types for this API are accessed through the `staffMembers` namespace you already imported above, as `staffMembers.<TypeName>`, using any type name shown in these docs.
  