Skip to main content

DELETE /api/users/{user_id}

Permanently removes a user account and all associated data (tasks, refresh tokens) from the system. This endpoint is restricted to administrators.
This action is permanent and cannot be undone. All tasks owned by the user will be deleted along with the account.
Restriction: Administrators cannot delete other administrator accounts. Attempting to delete an admin user returns 403.

Authentication

Requires a valid Bearer access token. The authenticated user must have the admin role.
Authorization: Bearer <access_token>

Path Parameters

user_id
integer
required
The ID of the user to delete.

Response

success
boolean
true when the deletion succeeds.
message
string
Human-readable confirmation that the user was deleted.

Errors

StatusDescription
401Missing or invalid access token.
403The authenticated user is not an admin, or the target user is an administrator.
404No user exists with the given user_id.

Example

curl -X DELETE "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/users/42" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "success": true,
  "message": "Usuario eliminado con exito"
}

Build docs developers (and LLMs) love