Skip to main content

Change User's Email

This endpoint changes the email of the authenticated user

info

This operation requires authentication.

HTTP Request

PATCH /api/v2/user/{id}/change_email/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this user
new_emailbodystring(email)trueThe new email
confirmbodybooleanfalseIf confirm=1 (or true), the email is not changed directly but a validation code is generated to be used in the confirm call to validate the email.

Example Body Parameters

{
"new_email": "string",
"confirm": "integer/boolean"
}

Example Request


const inputBody = '{
"new_email": "string",
"confirm": "integer/boolean"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/change_email/',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKIf confirm=1, the response body contains the validation codeNone
204No ContentIf confirm=0, there is no body responseNone

Example responses

{
"validation_code": "string"
}