EmailChangeService¶
- class EmailChangeService[source]¶
Methods
Verify the new-email code and complete the email change.
Verify the old-email code and send a code to the new email.
Initiate an email change.
- confirm_new(json_body, *, token)[source]¶
Verify the new-email code and complete the email change.
Only valid for sessions in pending_new_confirm status. On success, the user’s email is updated and marked as verified.
Does not require authentication — the token in the URL is the credential. IP-bound to the initiating client.
- Parameters:
json_body (
ConfirmNewEmailChangeData) – The body of the request. SeeConfirmNewEmailChangeDatafor information about the possible fields. You can provide this data as aConfirmNewEmailChangeDataor as a dictionary.token (
str) – The email change session identifier.
- Returns:
The new email address.
- Return type:
- confirm_old(json_body, *, token)[source]¶
Verify the old-email code and send a code to the new email.
Only valid for sessions in pending_old_confirm status (Path B: no-password users). On success, transitions to pending_new_confirm and sends a code to the new email. Call email_change.confirm_new next.
Does not require authentication — the token in the URL is the credential. IP-bound to the initiating client.
- Parameters:
json_body (
ConfirmOldEmailChangeData) – The body of the request. SeeConfirmOldEmailChangeDatafor information about the possible fields. You can provide this data as aConfirmOldEmailChangeDataor as a dictionary.token (
str) – The email change session identifier.
- Returns:
An empty response on success.
- Return type:
- create(json_body)[source]¶
Initiate an email change.
If the user has a password and provides old_password, the flow skips old-email verification and goes straight to new-email verification (call email_change.confirm_new).
If the user has no password (SSO/LTI), old-email verification is required first (call email_change.confirm_old, then email_change.confirm_new).
- Parameters:
json_body (
CreateEmailChangeData) – The body of the request. SeeCreateEmailChangeDatafor information about the possible fields. You can provide this data as aCreateEmailChangeDataor as a dictionary.
- Returns:
An email change session identifier.
- Return type: