Confirm Email Change
POST
/api/users/me/email/change/confirm
const url = 'https://example.com/api/users/me/email/change/confirm';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"token":"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/api/users/me/email/change/confirm \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Confirm a pending email change with the token mailed to the new address.
The new address comes from current_user.pending_email (set server-side when the change was requested), never from client input — the token alone doesn’t encode it, so trusting a client-resubmitted email would let the confirm step cut over to an address that was never actually proven reachable.
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
EmailChangeConfirm
Confirm a pending email change with the token mailed to the new address.
object
token
required
Token
string
Example generated
{ "token": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleValidation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}