You can use the Deskpro API to delete or disable individual users, or perform these actions on multiple users at once.
Deleting a user is permanent and will also delete their associated tickets and other content.
If you want to prevent a user from accessing your help desk without deleting their information, you can disable their account instead.
Delete a single user
To delete an individual user, use the following API endpoint:
DELETE /api/v2/people/{id}
Replace {id} with the ID of the user you want to delete.
For example, to delete user ID 123:
DELETE /api/v2/people/123
Delete multiple users
If you need to delete several users at once, you can use the mass actions API.
Use the following endpoint:
POST /api/v2/mass_actions/people
With the following JSON body:
{
"ids": [123, 456],
"params": {
"set_of_actions": ["delete"]
}
}
Replace 123 and 456 with the IDs of the users you want to delete.
You can include additional user IDs in the ids array to delete more users in the same request.
Disable a single user
If you want to prevent a user from accessing your help desk without deleting their account or associated information, you can disable them instead.
Use the following endpoint:
PUT /api/v2/people/{id}
With the following JSON body:
{
"is_disabled": true
}
Replace {id} with the ID of the user you want to disable.
To re-enable the user, use the same endpoint with is_disabled set to false:
{
"is_disabled": false
}
Disable multiple users
You can also disable multiple users at once using the mass actions API.
Use the following endpoint:
POST /api/v2/mass_actions/people
With the following JSON body:
{
"ids": [123, 456],
"params": {
"set_of_actions": ["disable"]
}
}
Replace 123 and 456 with the IDs of the users you want to disable.
You can also include a note explaining why the users were disabled:
{
"ids": [123, 456],
"params": {
"set_of_actions": ["disable"],
"add_note": "Disabled after account review"
}
}
Please note that the mass actions API supports disabling users, but not re-enabling them. To re-enable users, you will need to update each account individually using the PUT /api/v2/people/{id} endpoint.
Permissions
The agent associated with the API key must have the appropriate permissions to perform these actions.
To delete users, the agent must have the Can completely delete users permission. If you don't have the required permissions, please contact your Deskpro administrator.
Before deleting users
Deleting users through the API is permanent and cannot be undone.
If you need to retain their ticket history or other associated information, consider disabling their accounts instead.
If you have duplicate user accounts, you may also want to consider merging them rather than deleting one of the accounts and losing its associated information.