Auth0 Python SDK

5.0.0 · active · verified Tue Mar 17

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.

Warnings

Install

Imports

Quickstart

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'])

view raw JSON →