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
740 B
740 B
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
{
"theme": "dracula"
}
Response (200 OK)
{
"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 |