Back to Node Auth0

Class UsersClient

docs/classes/management.SDK.UsersClient-1.html

5.9.15.2 KB
Original Source

Class UsersClient

Index

Constructors

constructor

Methods

listassign

Properties

_options

Constructors

constructor

new UsersClient(options: BaseClientOptions): UsersClient

Parameters

Returns UsersClient

Methods

list

list(
id: string,
request?: ListRoleUsersRequestParameters,
requestOptions?: UsersClient.RequestOptions,
): Promise<Page<RoleUser, ListRoleUsersPaginatedResponseContent>>

Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles.

This endpoint supports two types of pagination:

  • Offset pagination
  • Checkpoint pagination

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

Checkpoint Pagination

To search by checkpoint, use the following parameters:

  • from: Optional id from which to start selection.
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.

Note : The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.

Parameters

  • id: string

ID of the role to retrieve a list of users associated with.

Request-specific configuration.

Returns Promise<Page<RoleUser, ListRoleUsersPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.roles.users.list("id", { from: "from", take: 1 })Copy

assign

assign(
id: string,
request: AssignRoleUsersRequestContent,
requestOptions?: UsersClient.RequestOptions,
): HttpResponsePromise<void>

Assign one or more users to an existing user role. To learn more, review Role-Based Access Control.

Note : New roles cannot be created through this action.

Parameters

  • id: string

ID of the role to assign users to.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.roles.users.assign("id", { users: ["users"] })Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listassign Properties _options