The Management API client provides programmatic access to the Auth0 Management API v2, enabling automation of tenant configuration, user management, and administrative operations. Version 5.0 introduced a complete rewrite of the Management API client, generated from Auth0's OpenAPI specifications using Fern.
For information about user authentication flows and token acquisition, see Authentication API. For details on the underlying HTTP infrastructure, see HTTP Infrastructure.
The v5.0 release represents a fundamental architectural change to the Management API client:
Key Changes:
domain instead of full base_urlApiError exception hierarchy replacing legacy Auth0ErrorBackward Compatibility: The Authentication API remains fully backward compatible. Only the Management API client underwent breaking changes.
Sources: CHANGELOG.md3-39 README.md33-39
Version 5.0 introduces two levels of abstraction for Management API access:
Sources: README.md68-157 CHANGELOG.md10-27
The ManagementClient is the recommended way to interact with the Management API. It provides automatic token management and simplified initialization.
Key Features:
domain parameter (e.g., "your-tenant.auth0.com") instead of full base_urlclient_id and client_secretSources: README.md68-89 CHANGELOG.md17
The Auth0 base client provides manual token management and requires a full base_url. It offers lower-level control for advanced use cases.
When to Use Base Client:
Sources: README.md109-157
Both ManagementClient and Auth0 have async counterparts for non-blocking operations.
Note: When constructing a custom httpx client for async usage, use httpx.AsyncClient() instead of httpx.Client().
For detailed async patterns and examples, see Asynchronous Support.
Sources: README.md91-185
Version 5.0 restructures the Management API into modular sub-clients, each representing a specific resource type. This provides better code organization and improved discoverability.
Available Sub-Clients: The Management API provides 20+ sub-clients for different resource types including:
users - User managementorganizations - Organization managementactions - Auth0 Actions (extensibility)roles - Role-based access controlclients - Application managementconnections - Authentication connectionsbranding - Tenant brandingFor detailed sub-client structure and architecture, see Sub-Client Architecture (v5).
Sources: CHANGELOG.md12 README.md74-108
Version 5.0 introduces strongly-typed request and response objects using Pydantic models, replacing generic dictionaries.
Compile-Time Validation:
Runtime Validation:
Self-Documenting:
Sources: CHANGELOG.md14 CHANGELOG.md24
Version 5.0 introduces a new exception hierarchy with the ApiError base class, replacing the legacy Auth0Error.
When the API returns a non-success status code (4xx or 5xx), an ApiError is raised with:
status_code - HTTP status code (e.g., 400, 401, 429, 500)body - Parsed response body containing error detailsCommon Error Codes:
400 - Bad Request (validation errors)401 - Unauthorized (invalid or expired token)403 - Forbidden (insufficient permissions)404 - Not Found (resource doesn't exist)429 - Too Many Requests (rate limit exceeded)500 - Internal Server ErrorSources: README.md187-201 CHANGELOG.md15
Version 5.0 provides built-in pagination support with SyncPager and AsyncPager objects that automatically handle page fetching.
Version 5.0 changes pagination defaults:
include_totals=True is now the default for list operationsFor detailed pagination patterns, see Pagination.
Sources: README.md203-236 CHANGELOG.md16 CHANGELOG.md23
The Management API client supports advanced customization through request options and custom HTTP clients.
Default Retry Behavior:
For detailed HTTP configuration options, see HTTP Client Configuration.
Sources: README.md284-321
Sources: README.md54-82 auth0/management/auth0.py42-58
The Management SDK supports asynchronous operations through the AsyncAuth0 class. For complete details, see Asynchronous Support.
Sources: auth0/management/__init__.py34-37
Refresh this wiki
This wiki was recently refreshed. Please wait 1 day to refresh again.