API Base URLs
The headless API provides two base URLs for different client types:- Browser clients:
/_allauth/browser/v1/ - App clients:
/_allauth/app/v1/
Client Types
Browser Clients
For single-page applications on the same domain:- Uses Django sessions and CSRF tokens
- Authentication state stored in session cookies
- Requires
X-CSRFTokenheader in POST requests - No additional token management needed
App Clients
For mobile apps or cross-origin SPAs:- Uses session tokens or JWT tokens
- Authentication state stored in
X-Session-Tokenheader - No CSRF protection (stateless)
- Requires token storage in the client
Authentication API Endpoints
Get Configuration
Retrieve API configuration and available features:Get Session Status
Check current authentication status:User Registration (Signup)
Create Account
ACCOUNT_EMAIL_VERIFICATION = "mandatory", the user must verify their email before logging in.
Verify Email
When the user clicks the link in their email, extract the key from the URL and verify:Login Flows
Standard Login (Email/Password)
Login by Code (Passwordless)
Request a login code:Password Reset
Request Password Reset
Verify Reset Key
Reset Password
Logout
JWT Token Management
When using JWT token strategy, tokens are returned in themeta field:
Initial Authentication
After successful login or signup:Using Access Tokens
Include the access token in the Authorization header:Refreshing Tokens
When the access token expires, use the refresh token:Account Management
Get Email Addresses
Add Email Address
Change Password
Reauthentication
For sensitive operations, request reauthentication:Securing Your API Endpoints
Django REST Framework
Use the provided authentication classes:Django Ninja
Use the provided security classes:Error Handling
All error responses follow this format:200- Success400- Bad request (validation error)401- Not authenticated403- Forbidden (e.g., signup disabled)409- Conflict (e.g., invalid flow state)429- Rate limited500- Internal server error
Next Steps
- Configure CORS for cross-origin requests
- Customize JWT settings
- Explore the OpenAPI specification at
/_allauth/openapi.html
