Sample Flows

This article shares some typical use cases you can support, as well as an example flow that supports each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.

Periodically check and update company employees' account access

If your company has a Wix account with employees as team members, you may want to periodically check the access that each team member has to your account assets and the roles they have for each site.

  1. Call Search Team with any relevant filters.
  2. Review the returned lists of users and invites, and their assignments.
  3. If relevant, call Get Roles Info with any relevant filters, to retrieve a list of all roles that can be applied to your account's team members.
  4. If changes should be made to any team member's roles or access to account assets, call Update Team Member Assignments.
  5. If an employee leaves, or should have their access removed for any reason, call Remove Member.
Did this help?

getRolesInfo( )


Developer Preview

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

Retrieves all available roles in the requesting account, including predefined and custom roles.

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

Method Declaration
Copy
function getRolesInfo(
  options: GetRolesInfoOptions,
): Promise<GetRolesInfoResponse>;
Method Parameters
optionsGetRolesInfoOptions

Filter options.

Returns
Return Type:Promise<GetRolesInfoResponse>
Get available account roles 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 getRolesInfo(options) { const response = await users.getRolesInfo(options); }
Errors

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

Did this help?

removeMember( )


Developer Preview

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

Removes a team member from the requesting account.

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

Method Declaration
Copy
function removeMember(userId: string): Promise<void>;
Method Parameters
userIdstringRequired

User ID of the team member to remove.

Remove a team member from an account 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 removeMember(userId) { const response = await users.removeMember(userId); }
Errors

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

Did this help?