Auth0 Python SDK

raw JSON →
5.0.0 verified Tue May 12 auth: no python install: verified quickstart: stale

Official Auth0 SDK for Python. Current version is 5.0.0 (Feb 2026). Three separate API generations exist (v3, v4, v5) with incompatible import paths and response types. The 'auth0.v3' namespace was removed in v4. v5 rewrites the Management API responses from dicts to Pydantic models. Enormous tutorial and LLM corpus still references auth0.v3 imports.

pip install auth0-python
error ModuleNotFoundError: No module named 'auth0.v3'
cause The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.
fix
Update import statements to use the new structure without 'v3', e.g., 'from auth0.authentication import GetToken'.
error ImportError: cannot import name 'Auth0' from 'auth0.v3.management'
cause The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.
fix
Update import statements to use the new structure without 'v3', e.g., 'from auth0.management import Auth0'.
error AttributeError: module 'auth0' has no attribute 'v3'
cause The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.
fix
Update import statements to use the new structure without 'v3', e.g., 'from auth0.authentication import GetToken'.
error TypeError: 'dict' object is not callable
cause In version 5.0.0, Management API responses were changed from dictionaries to Pydantic models, affecting how responses are accessed.
fix
Update code to access attributes of the Pydantic models directly, e.g., 'response.attribute_name' instead of 'response['attribute_name']'.
error TypeError: 'User' object is not subscriptable
cause In version 5.0.0, Management API responses were changed from dictionaries to Pydantic models, making them non-subscriptable.
fix
Access attributes directly using dot notation, e.g., 'user.id' instead of 'user['id']'.
breaking 'from auth0.v3.management import Auth0' and 'from auth0.v3.authentication import ...' raise ModuleNotFoundError on auth0-python >= 4.0. The auth0.v3 namespace was fully removed in v4.
fix Replace 'from auth0.v3.management import Auth0' with 'from auth0.management import ManagementClient'. Replace 'from auth0.v3.authentication import ...' with 'from auth0.authentication import ...'.
breaking v5 Management API responses are Pydantic models, not dicts. user['email'] raises TypeError. user.get('email') returns None silently instead of the value.
fix Use attribute access: user.email. To convert to dict for legacy code: user.model_dump().
breaking Management API tokens expire after 24 hours. The v4 Auth0() class does not refresh tokens automatically. Long-running processes silently start returning 401s.
fix Use ManagementClient with client_id + client_secret (v5) for automatic token caching and refresh. Or re-acquire token on each run.
breaking v5 pagination changed. The v4 pattern of manual page= loops with include_totals=True returns a SyncPager in v5, not a dict. result['users'] raises TypeError.
fix Iterate directly: 'for user in client.users.list(): ...' — SyncPager handles pagination automatically.
gotcha Auth0 domain format must be bare domain only: 'your-tenant.auth0.com'. Do NOT prefix with 'https://'. Passing the full URL causes connection errors.
fix domain='your-tenant.auth0.com' not domain='https://your-tenant.auth0.com'
gotcha client_credentials audience must exactly match the API identifier in Auth0 dashboard. For the Management API it is 'https://{domain}/api/v2/' — note the trailing slash. Omitting it returns an invalid token.
fix audience=f'https://{domain}/api/v2/' # trailing slash required
gotcha AsyncManagementClient requires aiohttp which is not auto-installed by auth0-python. ImportError at runtime if missing.
fix pip install aiohttp alongside auth0-python when using async client.
python os / libc status wheel install import disk
3.10 alpine (musl) - - 1.11s 89.6M
3.10 slim (glibc) - - 0.82s 91M
3.11 alpine (musl) - - 1.49s 101.9M
3.11 slim (glibc) - - 1.24s 103M
3.12 alpine (musl) - - 1.58s 87.5M
3.12 slim (glibc) - - 1.53s 89M
3.13 alpine (musl) - - 1.49s 86.9M
3.13 slim (glibc) - - 1.48s 88M
3.9 alpine (musl) - - 1.06s 90.1M
3.9 slim (glibc) - - 0.95s 92M

Management API access using v5 ManagementClient with client credentials.

from auth0.authentication import GetToken
from auth0.management import ManagementClient

domain = 'your-tenant.auth0.com'

# Option A: ManagementClient with client credentials (auto token refresh)
client = ManagementClient(
    domain=domain,
    client_id='YOUR_CLIENT_ID',
    client_secret='YOUR_CLIENT_SECRET',
)

# v5: responses are Pydantic models, not dicts
user = client.users.get('auth0|123456')
print(user.email)  # attribute access, not user['email']

# Option B: manual token then client
token_client = GetToken(
    domain=domain,
    client_id='YOUR_CLIENT_ID',
    client_secret='YOUR_CLIENT_SECRET',
)
tokens = token_client.client_credentials(
    audience=f'https://{domain}/api/v2/'
)
client2 = ManagementClient(domain=domain, token=tokens['access_token'])