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
+44 -6
View File
@@ -1,24 +1,59 @@
# Update Profile
Update the current user's profile information.
Update user profile information. Supports both self-edit and admin modes.
**Endpoints**:
- Self-edit: `PUT /api/auth/profile`
- Admin edit: `PUT /api/auth/profile/:id`
**Endpoint**: `PUT /api/auth/profile`
**Auth**: Required
**Content-Type**: `application/json`
## Request Body
## Self-Edit Mode
Users can update their own profile. All fields are optional.
### Request Body
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| username | string | No | New username (must be unique, 3-50 chars) |
| email | string | No | New email (must be unique, valid format) |
| first_name | string | No | User's first name |
| last_name | string | No | User's last name |
| theme | string | No | Theme preference |
### Example Request
```json
{
"username": "newusername",
"email": "newemail@example.com",
"first_name": "John",
"last_name": "Smith"
"last_name": "Smith",
"theme": "dracula"
}
```
## Admin Mode
Admins can update any user by providing the user ID in the URL. Additionally supports role changes.
**URL Parameter**: `:id` - Target user's UUID
### Additional Request Body Fields (Admin Only)
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| role | string | No | New role: "user" or "admin" |
### Example Admin Request
```json
{
"username": "newusername",
"email": "newemail@example.com",
"role": "admin"
}
```
@@ -31,7 +66,7 @@ Update the current user's profile information.
"username": "john",
"first_name": "John",
"last_name": "Smith",
"theme": "tokyo-night",
"theme": "dracula",
"role": "user",
"max_devices": 10,
"created_at": "2026-01-31T10:00:00Z"
@@ -42,5 +77,8 @@ Update the current user's profile information.
| Code | Description |
|------|-------------|
| 400 | Invalid input data |
| 400 | Invalid input data or invalid role |
| 401 | Invalid or expired token |
| 403 | Admin access required (admin mode only) |
| 404 | User not found (admin mode only) |
| 409 | Username or email already taken |