Box Developer Documentation
Latest version

Delete user

delete
https://api.box.com/2.0
/users/:user_id

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Deletes a user. By default, this operation fails if the user still owns any content, was recently active, or recently joined the enterprise from a free account. To proceed, move their owned content first, or use the force parameter to delete the user and their files.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The ID of the user.

Query Parameters

booleanin queryoptional
true

Specifies whether to delete the user even if they still own files, were recently active, or recently joined the enterprise from a free account.

booleanin queryoptional
true

Whether the user will receive email notification of the deletion.

Response

none

Removes the user and returns an empty response.

application/jsonClient error

An unexpected client error.

delete
Delete user
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versioning strategy.


cURL
curl -i -X DELETE "https://api.box.com/2.0/users/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.users.deleteUserById(user.id);
Python v10
client.users.delete_user_by_id(user.id)
.NET v10
await client.Users.DeleteUserByIdAsync(userId: user.Id);
Swift v10
try await client.users.deleteUserById(userId: user.id)
Java v10
client.getUsers().deleteUserById(user.getId())
Java v5
BoxUser user = new BoxUser(api, "0");
user.delete(false, false);
Python v4
user_id = '33333'
client.user(user_id).delete(force=True)
.NET v6
await client.UsersManager.DeleteEnterpriseUserAsync("44444", notify: false, force: true);
Node v4
// Delete the user even if they still have files in their account
client.users.delete('123', {force: true})
    .then(() => {
        // deletion succeeded — no value returned
    });