docs: update API documentation for consolidated user management

Add documentation for delete_user and reset_user_password endpoints.
Update update_profile to reflect consolidated endpoint. Remove obsolete
documentation for individual update operations. Add profile guide for
end-users. Update API_CONSOLIDATION_PLAN.md with implementation status.
This commit is contained in:
2026-02-22 01:59:52 -05:00
parent 9ea0ec5a3e
commit ff25454901
9 changed files with 1024 additions and 968 deletions
+46
View File
@@ -0,0 +1,46 @@
# Delete User
Delete a user account. Supports both self-deletion and admin deletion.
**Endpoints**:
- Self-deletion: `DELETE /api/auth/profile`
- Admin deletion: `DELETE /api/auth/profile/:id`
**Auth**: Required
## Self-Deletion
Users can delete their own account. This permanently removes the user and all associated data.
**Endpoint**: `DELETE /api/auth/profile`
## Admin Deletion
Admins can delete any user account by providing the user ID in the URL.
**URL Parameter**: `:id` - Target user's UUID
**Endpoint**: `DELETE /api/auth/profile/:id`
## Response (200 OK)
```json
{
"message": "account deleted"
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 400 | Cannot delete the last admin |
| 401 | Invalid or expired token |
| 403 | Admin access required (trying to delete another user) |
| 404 | User not found (admin mode only) |
## Safety Rules
- The last remaining admin cannot be deleted
- Self-deletion requires the user to not be the last admin
- Admin deletion is restricted to admin role only