API endpoints¶
Authentication¶
/login/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
User’s email address. |
Body (JSON) |
|
User’s password. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
JWT access token. |
Cookie (HTTP-only) |
|
JWT refresh token, stored by default in the |
Body (JSON, optional) |
|
When MFA is enabled and the user has it configured. The response contains a |
Body (JSON, optional) |
|
When MFA mode is REQUIRED but the user has not set it up yet. The response contains a |
URL Name: rest_login
Note
Django Rest Framework throttling enabled, see: https://www.django-rest-framework.org/api-guide/throttling/
/refresh/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Cookie (HTTP-only, default) |
|
Refresh token read automatically from the |
Body (JSON, optional) |
|
Refresh token sent explicitly in the request body when you are not using cookies ( |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
New JWT access token. |
Cookie (HTTP-only, default) |
|
New refresh token stored in the |
Body (JSON, optional) |
|
New refresh token returned in the response body when cookies are disabled. |
URL Name: token_refresh
/logout/ (POST) [Authenticated]¶
Request
Location |
Field |
Description |
|---|---|---|
Cookie (HTTP-only, default) |
|
Refresh token taken automatically from the |
Body (JSON, optional) |
|
Refresh token to invalidate when you are not using cookies ( |
Response
Status |
Description |
|---|---|
|
User successfully logged out and the refresh token is revoked. |
URL Name: rest_logout
/logout-all/ (POST) [Authenticated]¶
Request
Location |
Description |
|---|---|
N/A |
No request body or query parameters. |
Response
Status |
Description |
|---|---|
|
User successfully logged out from all devices. |
/password/reset/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
Email address to send the reset link to. |
Response
Status |
Description |
|---|---|
|
JSON response with a |
URL Name: rest_password_reset
Note
Django Rest Framework throttling enabled, see: https://www.django-rest-framework.org/api-guide/throttling/
Warning
Requires an email server configured.
/password/reset/confirm/<str:uidb64>/<str:token>/ (GET)¶
Response
Location |
Description |
|---|---|
HTML page |
Redirects to the UI configured by |
URL Name: password_reset_confirm
Note
uid and token are sent in email after calling /password/reset/
/password/reset/default/ (GET)¶
Response
Location |
Description |
|---|---|
HTML page |
Renders the default password reset form. |
URL Name: default_password_reset
Note
Used when PASSWORD_RESET_REDIRECT is not configured.
/password/reset/complete/ (GET)¶
Response
Location |
Description |
|---|---|
HTML page |
Renders the password reset complete page. |
URL Name: jwt_allauth_password_reset_complete
Note
Used when PASSWORD_RESET_REDIRECT is not configured.
/password/change/ (POST) [Authenticated]¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
New password. |
Body (JSON) |
|
Password confirmation. |
Body (JSON, optional) |
|
Current password (required if |
Response
Status |
Description |
|---|---|
|
Password changed successfully. Optionally logs the user out of other sessions when |
URL Name: rest_password_change
Note
OLD_PASSWORD_FIELD_ENABLED = True to use old_password (default).
Note
LOGOUT_ON_PASSWORD_CHANGE = True to logout from the remaining sessions.
/user/ (GET, PUT, PATCH) [Authenticated]¶
Request (PUT/PATCH)
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
User email address. |
Body (JSON, optional) |
|
User’s first name. |
Body (JSON, optional) |
|
User’s last name. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
User’s email address. |
Body (JSON) |
|
User’s first name. |
Body (JSON) |
|
User’s last name. |
URL Name: rest_user_details
Registration¶
/registration/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
Email address for the new user. |
Body (JSON) |
|
Password. |
Body (JSON) |
|
Password confirmation. |
Body (JSON, optional) |
|
First name. |
Body (JSON, optional) |
|
Last name. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON, optional) |
|
Authentication token when email verification is disabled. |
Body (JSON) |
|
Registered email address. |
Body (JSON) |
|
Message indicating that a verification e-mail has been sent when email verification is enabled. |
URL Name: rest_register
Note
Disabled when JWT_ALLAUTH_ADMIN_MANAGED_REGISTRATION = True (the open registration endpoint is removed in admin-managed mode).
/registration/user-register/ (POST) [Admin role]¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
Email address for the new user. |
Body (JSON) |
|
User role to assign to the new user. |
Body (JSON, optional) |
|
First name. |
Body (JSON, optional) |
|
Last name. |
Response
Status |
Description |
|---|---|
|
Verification e-mail sent to the invited user. |
URL Name: rest_user_register
Note
Enabled when JWT_ALLAUTH_ADMIN_MANAGED_REGISTRATION = True. Keeps the default /registration/ endpoint unchanged unless you enable this setting.
/registration/verification/<str:key>/ (GET)¶
Response
Location |
Description |
|---|---|
Redirect / HTML page |
Redirects to the UI configured by |
URL Name: account_confirm_email
Note
Disabled when EMAIL_VERIFICATION = False.
/registration/account_email_verification_sent/ (GET)¶
Response
Location |
Description |
|---|---|
HTML page |
Renders the email verification sent notification page. |
URL Name: account_email_verification_sent
Note
Disabled when EMAIL_VERIFICATION = False.
/registration/verified/ (GET)¶
Response
Location |
Description |
|---|---|
HTML page |
Renders the email verified confirmation page. |
URL Name: jwt_allauth_email_verified
Note
Disabled if EMAIL_VERIFIED_REDIRECT is defined or EMAIL_VERIFICATION = False.
Multi-Factor Authentication (MFA)¶
Note
Requires allauth.mfa in INSTALLED_APPS of your Django project and database migrations applied.
/mfa/setup/ (POST) [Authenticated]¶
Request
Location |
Description |
|---|---|
N/A |
No request body. The authenticated user (or MFA setup challenge) is used to determine which account to configure. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
OTPAuth URI for QR code generation. |
Body (JSON) |
|
Base32-encoded secret key. |
Body (JSON) |
|
SVG formatted QR code image. |
URL Name: mfa_setup
/mfa/activate/ (POST) [Authenticated]¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
TOTP code from the authenticator app. |
Body (JSON, optional) |
|
Challenge ID used in MFA bootstrap flows (login or registration) when MFA mode is |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
List of one-time recovery codes. |
Body (JSON, optional) |
|
Indicates successful activation (always |
Body (JSON, optional) |
|
Access token issued when MFA mode is |
Body (JSON, optional) |
|
Refresh token issued when MFA mode is |
URL Name: mfa_activate
/mfa/verify/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
MFA challenge ID from the login attempt. |
Body (JSON) |
|
TOTP code from the authenticator app. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
JWT access token. |
Cookie (HTTP-only) |
|
JWT refresh token set in the |
URL Name: mfa_verify
/mfa/verify-recovery/ (POST)¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
MFA challenge ID from the login attempt. |
Body (JSON) |
|
One-time recovery code. |
Response
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
JWT access token. |
Cookie (HTTP-only) |
|
JWT refresh token set in the |
URL Name: mfa_verify_recovery
/mfa/deactivate/ (POST) [Authenticated]¶
Request
Location |
Field |
Description |
|---|---|---|
Body (JSON) |
|
User’s password for confirmation. |
Response
Status |
Description |
|---|---|
|
MFA TOTP authenticator (and recovery codes) deactivated for the user. |
URL Name: mfa_deactivate
/mfa/authenticators/ (GET) [Authenticated]¶
Request
Location |
Description |
|---|---|
N/A |
No request body or query parameters. |
Response
Location |
Description |
|---|---|
Body (JSON) |
Array of authenticator objects with details about enabled MFA devices. |
URL Name: mfa_authenticators
Note
MFA TOTP can be configured with the JWT_ALLAUTH_MFA_TOTP_MODE setting:
'disabled'(default): MFA endpoints return 403 Forbidden when accessed.'optional': Users can set up MFA but it’s not required during login.'required': Users must set up MFA and provide TOTP code during login. Deactivation is blocked.