Returns a list of all users for the Enterprise along with their user_id,
public_name, and login.
The application and the authenticated user need to have the permission to look up users in the entire enterprise.
This operation is performed by calling function getUsers.
See the endpoint docs at API Reference.
await client.users.getUsers();- queryParams
GetUsersQueryParams- Query parameters of getUsers method
- headersInput
GetUsersHeadersInput- Headers of getUsers method
- cancellationToken
undefined | CancellationToken- Token used for request cancellation.
This function returns a value of type Users.
Returns all of the users in the enterprise.
Creates a new managed user in an enterprise. This endpoint is only available to users and applications with the right admin permissions.
This operation is performed by calling function createUser.
See the endpoint docs at API Reference.
await client.users.createUser({
name: userName,
login: userLogin,
isPlatformAccessOnly: true,
} satisfies CreateUserRequestBody);- requestBody
CreateUserRequestBody- Request body of createUser method
- optionalsInput
CreateUserOptionalsInput
This function returns a value of type UserFull.
Returns a user object for the newly created user.
Retrieves information about the user who is currently authenticated.
In the case of a client-side authenticated OAuth 2.0 application this will be the user who authorized the app.
In the case of a JWT, server-side authenticated application this will be the service account that belongs to the application by default.
Use the As-User header to change who this API call is made on behalf of.
This operation is performed by calling function getUserMe.
See the endpoint docs at API Reference.
await client.users.getUserMe();- queryParams
GetUserMeQueryParams- Query parameters of getUserMe method
- headersInput
GetUserMeHeadersInput- Headers of getUserMe method
- cancellationToken
undefined | CancellationToken- Token used for request cancellation.
This function returns a value of type UserFull.
Returns a single user object.
Retrieves information about a user in the enterprise.
The application and the authenticated user need to have the permission to look up users in the entire enterprise.
This endpoint also returns a limited set of information for external users who are collaborated on content owned by the enterprise for authenticated users with the right scopes. In this case, disallowed fields will return null instead.
This operation is performed by calling function getUserById.
See the endpoint docs at API Reference.
await client.users.getUserById(user.id);- userId
string- The ID of the user. Example: "12345"
- optionalsInput
GetUserByIdOptionalsInput
This function returns a value of type UserFull.
Returns a single user object.
Not all available fields are returned by default. Use the fields query parameter to explicitly request any specific fields using the fields parameter.
Updates a managed or app user in an enterprise. This endpoint is only available to users and applications with the right admin permissions.
This operation is performed by calling function updateUserById.
See the endpoint docs at API Reference.
await client.users.updateUserById(user.id, {
requestBody: { name: updatedUserName } satisfies UpdateUserByIdRequestBody,
} satisfies UpdateUserByIdOptionalsInput);- userId
string- The ID of the user. Example: "12345"
- optionalsInput
UpdateUserByIdOptionalsInput
This function returns a value of type UserFull.
Returns the updated user object.
Deletes a user. By default, this operation fails if the user
still owns any content.
To proceed, move their owned content first, or use the force parameter to delete
the user and their files.
This operation is performed by calling function deleteUserById.
See the endpoint docs at API Reference.
await client.users.deleteUserById(user.id);- userId
string- The ID of the user. Example: "12345"
- optionalsInput
DeleteUserByIdOptionalsInput
This function returns a value of type undefined.
Removes the user and returns an empty response.