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
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | A unique integer value identifying this user |
new_email | body | string(email) | true | The new email |
confirm | body | boolean | false | If 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
- JSON
{
"new_email": "string",
"confirm": "integer/boolean"
}
Example Request
- JavaScript
- Bash
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);
});
# You can also use wget
curl -X PATCH /api/v2/user/{id}/change_email/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H "Authorization: Bearer <token>"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | If confirm=1, the response body contains the validation code | None |
204 | No Content | If confirm=0, there is no body response | None |
Example responses
- 200
{
"validation_code": "string"
}