Skip to main content

Endpoint

POST /api/user/settings
Update various user profile settings. All fields are optional - only provided fields will be updated.

Headers

Authorization
string
required
User authentication token received from login

Request body

email
string
New email address for the user
avatar_url
string
URL to user’s avatar image
description
string
User bio/description text
password
string
New password (will be hashed before storage)
custom_css
string
Custom CSS to style the user’s profile page
background_image
string
URL to background image for user’s profile

Response

message
string
Success message confirming settings update
error
string
Error message if the request failed

Status codes

  • 200: Settings updated successfully
  • 400: No fields to update or email already taken
  • 401: Unauthorized (invalid or missing token)
  • 500: Internal server error

Example request

curl -X POST https://api.example.com/api/user/settings \
  -H "Authorization: your-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "newemail@example.com",
    "avatar_url": "https://example.com/avatar.png",
    "description": "Updated bio",
    "custom_css": ".profile { color: blue; }"
  }'

Example responses

{
  "message": "settings updated successfully"
}

Notes

  • At least one field must be provided for update
  • Passwords are automatically hashed using Werkzeug’s password hashing
  • Email must be unique across all users
  • All fields are optional - only send what you want to update

Build docs developers (and LLMs) love