Change Username

Changes the authenticated user's username. A new JWT is returned in the Authorization header.

Headers
  • Authorization
    Type: string
    required

    JWT Bearer token. Format: Bearer <JWT>

Body·
required
application/json
  • newUsername
    Type: string
    min length:  
    3
    max length:  
    50
    required
Responses
  • 400

    Username has incorrect format or already exists.

  • application/json
Request Example for post/api/user/changeUsername
curl https://demo.api.whispchat.com/api/user/changeUsername \
  --request POST \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9...' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "newUsername": "johndoe_updated"
}'
No Body