Change Username
Changes the authenticated user's username. A new JWT is returned in the Authorization header.
Headers
- Type: stringAuthorizationrequired
JWT Bearer token. Format:
Bearer <JWT>
Body·
required
application/json
- Type: stringnew
Username min length:3max length:50required
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