Phase 2 part 2: Split auth and user endpoints - Authentication: register, login, refresh_token, logout - Users: get_profile, update_profile, update_theme, change_password - Each endpoint in separate markdown file - Include request/response examples and error codes
45 lines
740 B
Markdown
45 lines
740 B
Markdown
# Update Theme
|
|
|
|
Update the current user's theme preference.
|
|
|
|
**Endpoint**: `PUT /api/users/me/theme`
|
|
**Auth**: Required
|
|
**Content-Type**: `application/json`
|
|
|
|
## Request Body
|
|
|
|
| Field | Type | Required | Description |
|
|
|--------|------|-----------|-------------|
|
|
| theme | string | Yes | Theme name (e.g., "tokyo-night", "dracula") |
|
|
|
|
### Example Request
|
|
|
|
```json
|
|
{
|
|
"theme": "dracula"
|
|
}
|
|
```
|
|
|
|
## Response (200 OK)
|
|
|
|
```json
|
|
{
|
|
"id": "uuid",
|
|
"email": "user@example.com",
|
|
"username": "john",
|
|
"theme": "dracula",
|
|
"role": "user"
|
|
}
|
|
```
|
|
|
|
## Error Responses
|
|
|
|
| Code | Description |
|
|
|------|-------------|
|
|
| 400 | Invalid theme name |
|
|
| 401 | Invalid or expired token |
|
|
|
|
## Try It Out
|
|
|
|
<!-- API Explorer will be inserted here in Phase 3 -->
|