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.
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.
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.
function getRolesInfo(
options: GetRolesInfoOptions,
): Promise<GetRolesInfoResponse>;
Filter options.
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);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
function removeMember(userId: string): Promise<void>;
User ID of the team member to remove.
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);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.