Mail a confirmation link to a new address.
const url = 'https://example.com/api/user/v1/me/email-change';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"hello@example.com"}'};
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/api/user/v1/me/email-change \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com" }'The address changes only once the code in the link comes back through /v1/me/email-change/confirm, valid for 15 minutes. Whether another account has the address is told only then.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "email": "hello@example.com"}Responses
Section titled “Responses”Accepted; the mail goes out shortly.
Nothing to report; the mail is on its way.
object
Example generated
{}The request is malformed.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}No access token, or one that is invalid or expired.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Headers
Section titled “Headers”The token isn’t a user’s, lacks the scope, or the request came from another origin.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The body is larger than 4 KiB.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Something failed on the server; the request ID leads to the log line.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}