> 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

# SearchTeam

# Package: accounts

# Namespace: RolesManagementService

# Method link: https://dev.wix.com/docs/api-reference/account-level/user-management/accounts/users/search-team.md

## Introduction

Retrieves a list of all team members of the requesting account with the specified filtering, sorting, and paging.

> **Important**: This call requires an account level API key and can't be authenticated with the standard authorization header. API keys are currently available to selected beta users only.

---

## REST API

### Schema

```
 Method: searchTeam
 Description: Retrieves a list of all team members of the requesting account with the specified filtering, sorting, and paging.  > **Important**: This call requires an account level API key and can't be authenticated with the standard authorization header. API keys are currently available to selected beta users only.  ## Filters  When using filters for dates, you must use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).  ## See also  To learn about working with *Search* methods, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md).  flynt-disable http-mapping-breaking-change
 URL: https://www.wixapis.com/roles-management/v3/team/search
 Method: POST
 Method parameters:
   param name: facets | type: array<facets> | description: Group data into categories (facets) and return the total count for each category.  For example, use `facets` to aggregate search results by team member, invite status, or role.  
                 - enum:
                 -     Roles: Total team members with each role.
                 -     InviteStatus: Total team members by [invite](https://dev.wix.com/docs/rest/account-level/user-management/accounts/account-invites/account-invite-object.md). `status`.
                 -     Users: Total team members.
   param name: filter | type: filter | description: Filter object for narrowing search results.  For example, to return only users with a specific role: `{"filter": {"roleId": "6600344420111308827"}}`  See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md) for more information.  Supported values: `inviteType` and `roleId`.  
   param name: orderBy | type: array<orderBy> | description: Field name and order to sort by.  
              - name: fieldName | type: OrderField | description: Field to sort by.  
                     - enum:
                     -     Name: Team member name.
                     -     JoinedAt: Date team member joined the account.
              - name: direction | type: Direction | description: Sort order.  
                     - enum:
                     -     ASC: Ascending.
                     -     DESC: Descending.
   param name: paging | type: Paging    
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
   param name: query | type: query | description: Free text to match in searchable fields.  For example, search for specific values in `name` or `email`.  
 Return type: SearchTeamResponse
  - name: facets | type: array<Facet> | description: Retrieved facets as specified in the request.  
     - name: facetType | type: FacetType | description: Type of facet.  
         - enum:
         -     Roles: Total team members with each role.
         -     InviteStatus: Total team members by [invite](https://dev.wix.com/docs/rest/account-level/user-management/accounts/account-invites/account-invite-object.md). `status`.
         -     Users: Total team members.
     - name: values | type: array<FacetValue> | description: Values and the amount of each. Values with a count of `0` aren't returned.  
        - name: value | type: string | description: Supported values: `Roles`, `InviteStatus`, `Users`.  
        - name: count | type: integer | description: Number of existing items for the `value`.  
  - name: teamMembers | type: array<TeamMemberV3> | description: Retrieved team members and sent invites that match the search criteria specified in the request.  Each file includes all standard `user` and `invite` information.  
     - ONE-OF: 
        - name: user | type: UserV3 | description: Existing team member data.  
           - name: id | type: string | description: User GUID.  
           - name: email | type: string | description: User's email address.  | validation: format EMAIL
           - name: name | type: Name | description: User's name, when provided.  
              - name: firstName | type: string | description: User's first name.  
              - name: lastName | type: string | description: User's last name.  
           - name: profileImage | type: string | description: URL to user's profile image, when provided.  
           - name: joinedTeamAt | type: string | description: Date the user joined the team.  | validation: format date-time
           - name: assignments | type: array<AssignmentV3> | description: Mapping of the user's access to an asset and their assigned role.  
              - name: policyId | type: string | description: Role assigned to the user. To retrieve all available roles, call Get Roles Info.  
              - name: assignmentId | type: string | description: Unique GUID for this specific assignment.  | read-only: true 
              - name: restrictions | type: Restriction | description: The asset where a user is assigned access in an assignment. When empty, the role covers all assets, with no restrictions to specific sites or folders.  
                 - ONE-OF: 
                    - name: conditions | type: Conditions | description: List of conditions restricting the user's access. Currently only folder conditions are supported.  
                       - name: conditions | type: array<Condition> | description: List of conditions.  
                          - name: conditionType | type: ConditionAttributeType | description: Condition type.  
                                     - enum: UNKNOWN_CONDITION_TYPE, FOLDER
                          - name: id | type: string | description: Condition GUID.  
                          - name: value | type: string | description: Expected value of the condition. When `conditionType` = "FOLDER", this is the folder path.  
                    - name: site | type: SiteRestriction | description: Site where the assignment restrictions apply.  
                       - name: id | type: string | description: Site GUID.  
                       - name: value | type: string | description: Site name.  
                    - name: locations | type: LocationsRestriction | description: Business locations where the assignment restrictions apply. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md).  
                       - name: ids | type: array<string> | description: Location GUIDs where the assignment restrictions apply.  | validation: maxItems 20, format GUID
              - name: subject | type: AssignedSubject | description: Identity assigned to the asset in an assignment, referred to as subject. Supported subjects include user GUIDs, account GUIDs, and app GUIDs.  
                 - name: id | type: string | description: Identity GUID.  | read-only: true | validation: format GUID
                 - name: subjectType | type: SubjectType | description: Identity type.  
                         - enum: UNKNOWN, ACCOUNT, USER, USER_GROUP, MEMBER_GROUP, VISITOR_GROUP, EXTERNAL_APP, ACCOUNT_GROUP, WIX_APP
        - name: invite | type: InviteV3 | description: Invited team member data.  
           - name: id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
           - name: email | type: string | description: Invitee's email address.  | validation: format EMAIL
           - name: status | type: InviteStatus | description: Invite status.  
                 - enum: Pending, Used, Deleted, Declined, Expired
           - name: acceptLink | type: string | description: URL of direct link to accept the invite.  
           - name: dateCreated | type: string | description: Date the invite was created.  | validation: format date-time
           - name: dateUpdated | type: string | description: Date the invite was last updated.  | validation: format date-time
           - name: assignments | type: array<InviteAssignmentV3> | description: A list of assignments that will be applied to the invitees when they accept the invite.  
              - name: policyId | type: string | description: Role GUID that will be assigned once the invite is accepted.  
              - name: restrictions | type: Restriction | description: Assets where the user will be assigned access. When empty, the role covers all assets, with no restrictions to specific sites or folders.  
           - name: expirationDate | type: string | description: Invite expiration date.  | validation: format date-time


```

### Examples

### Search for team members by filters
```curl
curl -X POST \
'https://www.wixapis.com/roles-management/v3/team/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
        "filter": {
          "roleId": "6600344420111308827"
        }
      }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.userManagement.users.searchTeam(options)
 Description: Retrieves a list of all team members of the requesting account with the specified filtering, sorting, and paging.  > **Important**: This call requires an account level API key and can't be authenticated with the standard authorization header. API keys are currently available to selected beta users only.  ## Filters  When using filters for dates, you must use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).  ## See also  To learn about working with *Search* methods, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md).  flynt-disable http-mapping-breaking-change
 Method parameters:
   param name: options | type: SearchTeamOptions  none  
        - name: query | type: string | description: Free text to match in searchable fields.  For example, search for specific values in `name` or `email`.  
        - name: orderBy | type: array<Ordering> | description: Field name and order to sort by.  
           - name: fieldName | type: OrderField | description: Field to sort by.  
                 - enum:
                 -     Name: Team member name.
                 -     JoinedAt: Date team member joined the account.
           - name: direction | type: Direction | description: Sort order.  
                 - enum:
                 -     ASC: Ascending.
                 -     DESC: Descending.
        - name: filter | type: object | description: Filter object for narrowing search results.  For example, to return only users with a specific role: `{"filter": {"roleId": "6600344420111308827"}}`  See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md) for more information.  Supported values: `inviteType` and `roleId`.  
        - name: facets | type: array<FacetType> | description: Group data into categories (facets) and return the total count for each category.  For example, use `facets` to aggregate search results by team member, invite status, or role.  
             - enum:
             -     Roles: Total team members with each role.
             -     InviteStatus: Total team members by [invite](https://dev.wix.com/docs/rest/account-level/user-management/accounts/account-invites/account-invite-object.md). `status`.
             -     Users: Total team members.
        - name: paging | type: Paging | description: Paging options.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
           - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
 Return type: PROMISE<SearchTeamResponse>
  - name: facets | type: array<Facet> | description: Retrieved facets as specified in the request.  
     - name: facetType | type: FacetType | description: Type of facet.  
         - enum:
         -     Roles: Total team members with each role.
         -     InviteStatus: Total team members by [invite](https://dev.wix.com/docs/rest/account-level/user-management/accounts/account-invites/account-invite-object.md). `status`.
         -     Users: Total team members.
     - name: values | type: array<FacetValue> | description: Values and the amount of each. Values with a count of `0` aren't returned.  
        - name: value | type: string | description: Supported values: `Roles`, `InviteStatus`, `Users`.  
        - name: count | type: integer | description: Number of existing items for the `value`.  
  - name: teamMembers | type: array<TeamMemberV3> | description: Retrieved team members and sent invites that match the search criteria specified in the request.  Each file includes all standard `user` and `invite` information.  
     - ONE-OF: 
        - name: user | type: UserV3 | description: Existing team member data.  
           - name: _id | type: string | description: User GUID.  
           - name: email | type: string | description: User's email address.  | validation: format EMAIL
           - name: name | type: Name | description: User's name, when provided.  
              - name: firstName | type: string | description: User's first name.  
              - name: lastName | type: string | description: User's last name.  
           - name: profileImage | type: string | description: URL to user's profile image, when provided.  
           - name: joinedTeamAt | type: Date | description: Date the user joined the team.  
           - name: assignments | type: array<AssignmentV3> | description: Mapping of the user's access to an asset and their assigned role.  
              - name: policyId | type: string | description: Role assigned to the user. To retrieve all available roles, call Get Roles Info.  
              - name: assignmentId | type: string | description: Unique GUID for this specific assignment.  | read-only: true 
              - name: restrictions | type: Restriction | description: The asset where a user is assigned access in an assignment. When empty, the role covers all assets, with no restrictions to specific sites or folders.  
                 - ONE-OF: 
                    - name: conditions | type: Conditions | description: List of conditions restricting the user's access. Currently only folder conditions are supported.  
                       - name: conditions | type: array<Condition> | description: List of conditions.  
                          - name: conditionType | type: ConditionAttributeType | description: Condition type.  
                                     - enum: UNKNOWN_CONDITION_TYPE, FOLDER
                          - name: _id | type: string | description: Condition GUID.  
                          - name: value | type: string | description: Expected value of the condition. When `conditionType` = "FOLDER", this is the folder path.  
                    - name: site | type: SiteRestriction | description: Site where the assignment restrictions apply.  
                       - name: _id | type: string | description: Site GUID.  
                       - name: value | type: string | description: Site name.  
                    - name: locations | type: LocationsRestriction | description: Business locations where the assignment restrictions apply. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md).  
                       - name: ids | type: array<string> | description: Location GUIDs where the assignment restrictions apply.  | validation: maxItems 20, format GUID
              - name: subject | type: AssignedSubject | description: Identity assigned to the asset in an assignment, referred to as subject. Supported subjects include user GUIDs, account GUIDs, and app GUIDs.  
                 - name: _id | type: string | description: Identity GUID.  | read-only: true | validation: format GUID
                 - name: subjectType | type: SubjectType | description: Identity type.  
                         - enum: UNKNOWN, ACCOUNT, USER, USER_GROUP, MEMBER_GROUP, VISITOR_GROUP, EXTERNAL_APP, ACCOUNT_GROUP, WIX_APP
        - name: invite | type: InviteV3 | description: Invited team member data.  
           - name: _id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
           - name: email | type: string | description: Invitee's email address.  | validation: format EMAIL
           - name: status | type: InviteStatus | description: Invite status.  
                 - enum: Pending, Used, Deleted, Declined, Expired
           - name: acceptLink | type: string | description: URL of direct link to accept the invite.  
           - name: dateCreated | type: Date | description: Date the invite was created.  
           - name: dateUpdated | type: Date | description: Date the invite was last updated.  
           - name: assignments | type: array<InviteAssignmentV3> | description: A list of assignments that will be applied to the invitees when they accept the invite.  
              - name: policyId | type: string | description: Role GUID that will be assigned once the invite is accepted.  
              - name: restrictions | type: Restriction | description: Assets where the user will be assigned access. When empty, the role covers all assets, with no restrictions to specific sites or folders.  
           - name: expirationDate | type: Date | description: Invite expiration date.  


```

### Examples

### Get account team members with an API key
```javascript
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { users } from "@wix/user-management";
const wixClient = createClient({
 modules: { users },
 auth: ApiKeyStrategy({
    apiKey: "MY-API-KEY",
  }),
});

async function searchTeam(options) {
  const response = await users.searchTeam(options);
}

```

### searchTeam (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { users } from '@wix/user-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { users },
  // Include the auth strategy and host as relevant
});


async function searchTeam(options) {
  const response = await myWixClient.users.searchTeam(options);
};
```

---