Set username
POST
/v1/auth/users/set_username/
const url = 'https://example.com/v1/auth/users/set_username/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"current_password":"example","new_username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/auth/users/set_username/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "current_password": "example", "new_username": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
current_password
required
string
new_username
required
Username
Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
string
Examplegenerated
{ "current_password": "example", "new_username": "example"}object
current_password
required
string
new_username
required
Username
Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
string
Responses
Section titled “Responses”Media typeapplication/json
object
current_password
required
string
new_username
required
Username
Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
string
Examplegenerated
{ "current_password": "example", "new_username": "example"}