management package

management.auth0 module

class auth0.v3.management.auth0.Auth0(domain, token, rest_options=None)[source]

Bases: object

Provides easy access to all endpoint classes

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

management.blacklists module

class auth0.v3.management.blacklists.Blacklists(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 blacklists endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create(jti, aud=None)[source]

Adds a token to the blacklist.

Args:

jti (str): the jti of the JWT to blacklist.

aud (str, optional): The JWT’s aud claim. The client_id of the

application for which it was issued.

See: https://auth0.com/docs/api/management/v2#!/Blacklists/post_tokens

get(aud=None)[source]

Retrieves the jti and aud of all tokens in the blacklist.

Args:
aud (str, optional): The JWT’s aud claim. The client_id of the

application for which it was issued.

See: https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens

management.client_grants module

class auth0.v3.management.client_grants.ClientGrants(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 client grants endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all(audience=None, page=None, per_page=None, include_totals=False, client_id=None)[source]

Retrieves all client grants.

Args:
audience (str, optional): URL encoded audience of a Resource Server

to filter.

page (int, optional): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to False.

client_id (string, optional): The id of a client to filter.

See: https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants

create(body)[source]

Creates a client grant.

Args:

body (dict): Attributes for the new client grant.

See: https://auth0.com/docs/api/management/v2#!/Client_Grants/post_client_grants

delete(id)[source]

Deletes a client grant.

Args:

id (str): Id of client grant to delete.

See: https://auth0.com/docs/api/management/v2#!/Client_Grants/delete_client_grants_by_id

update(id, body)[source]

Modifies a client grant.

Args:

id (str): The id of the client grant to modify.

body (dict): Attributes to update.

See: https://auth0.com/docs/api/management/v2#!/Client_Grants/patch_client_grants_by_id

management.clients module

class auth0.v3.management.clients.Clients(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 applications endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all(fields=None, include_fields=True, page=None, per_page=None, extra_params=None)[source]

Retrieves a list of all the applications.

Important: The client_secret and encryption_key attributes can only be retrieved with the read:client_keys scope.

Args:
fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

extra_params (dictionary, optional): The extra parameters to add to

the request. The fields, include_fields, page and per_page values specified as parameters take precedence over the ones defined here.

See: https://auth0.com/docs/api/management/v2#!/Clients/get_clients

create(body)[source]

Create a new application.

Args:

body (dict): Attributes for the new application.

See: https://auth0.com/docs/api/v2#!/Clients/post_clients

delete(id)[source]

Deletes an application and all its related assets.

Args:

id (str): Id of application to delete.

See: https://auth0.com/docs/api/management/v2#!/Clients/delete_clients_by_id

get(id, fields=None, include_fields=True)[source]

Retrieves an application by its id.

Important: The client_secret, encryption_key and signing_keys attributes can only be retrieved with the read:client_keys scope.

Args:

id (str): Id of the application to get.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id

rotate_secret(id)[source]

Rotate a client secret. The generated secret is NOT base64 encoded.

Args:

id (str): Client ID of the application.

See: https://auth0.com/docs/api/management/v2#!/Clients/post_rotate_secret

update(id, body)[source]

Modifies an application.

Important: The client_secret, encryption_key and signing_keys attributes can only be updated with the update:client_keys scope.

Args:

id (str): Client ID of the application.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Clients/patch_clients_by_id

management.connections module

class auth0.v3.management.connections.Connections(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 connection endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all(strategy=None, fields=None, include_fields=True, page=None, per_page=None, extra_params=None)[source]

Retrieves all connections.

Args:
strategy (str, optional): Only retrieve connections of

this strategy type. (e.g: strategy=’amazon’)

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields. By default, all the fields will be retrieved.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

extra_params (dictionary, optional): The extra parameters to add to

the request. The fields, include_fields, page and per_page values specified as parameters take precedence over the ones defined here.

See: https://auth0.com/docs/api/management/v2#!/Connections/get_connections

Returns:

A list of connection objects.

create(body)[source]

Creates a new connection.

Args:
body (dict): Attributes used to create the connection. Mandatory

attributes are: ‘name’ and ‘strategy’.

See: https://auth0.com/docs/api/management/v2#!/Connections/post_connections

delete(id)[source]

Deletes a connection and all its users.

Args:

id: Id of the connection to delete.

See: https://auth0.com/docs/api/management/v2#!/Connections/delete_connections_by_id

Returns:

An empty dict.

delete_user_by_email(id, email)[source]

Deletes a specified connection user by its email.

Args:

id (str): The id of the connection (must be a database connection).

email (str): The email of the user to delete.

See: https://auth0.com/docs/api/management/v2#!/Connections/delete_users_by_email

Returns:

An empty dict.

get(id, fields=None, include_fields=True)[source]

Retrieve connection by id.

Args:

id (str): Id of the connection to get.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields. By default, all the fields will be retrieved.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id

Returns:

A connection object.

update(id, body)[source]

Modifies a connection.

Args:

id: Id of the connection.

body (dict): Specifies which fields are to be modified, and to what values.

See: https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id

Returns:

The modified connection object.

management.custom_domains module

class auth0.v3.management.custom_domains.CustomDomains(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 custom domains endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all()[source]

Retrieves all custom domains.

See: https://auth0.com/docs/api/management/v2#!/Custom_Domains/get_custom_domains

create_new(body)[source]

Configure a new custom domain.

Args:

body (str): The domain, tye and verification method in json.

See: https://auth0.com/docs/api/management/v2#!/Custom_Domains/post_custom_domains

delete(id)[source]

Deletes a grant.

Args:

id (str): The id of the custom domain to delete.

See: https://auth0.com/docs/api/management/v2#!/Custom_Domains/delete_custom_domains_by_id

get(id)[source]

Retrieves custom domain.

See: https://auth0.com/docs/api/management/v2#!/Custom_Domains/get_custom_domains_by_id

verify(id)[source]

Verify a custom domain.

Args:

id (str): The id of the custom domain to delete.

See: https://auth0.com/docs/api/management/v2#!/Custom_Domains/post_verify

management.device_credentials module

class auth0.v3.management.device_credentials.DeviceCredentials(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 connection endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create(body)[source]

Create a device public key.

Args:
body (dict): parameters for creating the public key (e.g: type,

device_name, client_id, etc).

See: https://auth0.com/docs/api/v2#!/Device_Credentials/post_device_credentials

delete(id)[source]

Delete credential.

Args:

id (str): The id of the credential to delete.

See: https://auth0.com/docs/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id

get(user_id, client_id, type, fields=None, include_fields=True)[source]

List device credentials.

Args:

user_id (str): The user_id of the devices to retrieve.

client_id (str): The client_id of the devices to retrieve.

type (str): The type of credentials (public_key, refresh_token).

fields (list, optional): A list of fields to include or exclude

(depending on include_fields) from the result. Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Device_Credentials/get_device_credentials

management.email_templates module

class auth0.v3.management.email_templates.EmailTemplates(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 email templates endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create(body)[source]

Create a new email template.

Args:

body (dict): Attributes for the new email template.

See: https://auth0.com/docs/api/management/v2#!/Email_Templates/post_email_templates

get(template_name)[source]

Retrieves an email template by its name.

Args:
template_name (str): Name of the email template to get.

Must be one of: ‘verify_email’, ‘reset_email’, ‘welcome_email’, ‘blocked_account’, ‘stolen_credentials’, ‘enrollment_email’, ‘change_password’, ‘password_reset’, ‘mfa_oob_code’.

See: https://auth0.com/docs/api/management/v2#!/Email_Templates/get_email_templates_by_templateName

update(template_name, body)[source]

Update an existing email template.

Args:
template_name (str): Name of the email template to update.

Must be one of: ‘verify_email’, ‘reset_email’, ‘welcome_email’, ‘blocked_account’, ‘stolen_credentials’, ‘enrollment_email’, ‘change_password’, ‘password_reset’, ‘mfa_oob_code’.

body (dict): Attributes to update on the email template.

See: https://auth0.com/docs/api/management/v2#!/Email_Templates/patch_email_templates_by_templateName

management.emails module

class auth0.v3.management.emails.Emails(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 email endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

config(body)[source]

Configure the email provider.

Args:

body (dict): attributes of the created email provider.

See: https://auth0.com/docs/api/v2#!/Emails/post_provider

delete()[source]

Delete the email provider. (USE WITH CAUTION)

See: https://auth0.com/docs/api/management/v2#!/Emails/delete_provider

get(fields=None, include_fields=True)[source]

Get the email provider.

Args:
fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Emails/get_provider

update(body)[source]

Update the email provider.

Args:

body (dict): attributes to update on the email provider

See: https://auth0.com/docs/api/v2#!/Emails/patch_provider

management.grants module

class auth0.v3.management.grants.Grants(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 grants endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all(page=None, per_page=None, include_totals=False, extra_params=None)[source]

Retrieves all grants.

Args:
page (int, optional): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to False.

extra_params (dictionary, optional): The extra parameters to add to

the request. The page, per_page, and include_totals values specified as parameters take precedence over the ones defined here.

See: https://auth0.com/docs/api/management/v2#!/Grants/get_grants

delete(id)[source]

Deletes a grant.

Args:

id (str): The id of the grant to delete.

See: https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id

management.guardian module

class auth0.v3.management.guardian.Guardian(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 guardian endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all_factors()[source]
Retrieves all factors. Useful to check factor enablement and

trial status.

See: https://auth0.com/docs/api/management/v2#!/Guardian/get_factors

create_enrollment_ticket(body)[source]

Creates an enrollment ticket for user_id

A useful way to send an email to a user, with a link that lead to

start the enrollment process.

Args:

body (dict): Details of the user to send the ticket to.

See: https://auth0.com/docs/api/management/v2#!/Guardian/post_ticket

delete_enrollment(id)[source]

Deletes an enrollment.

Useful when you want to force re-enroll.

Args:

id (str): The id of the device account to update.

See: https://auth0.com/docs/api/management/v2#!/Guardian/delete_enrollments_by_id

get_enrollment(id)[source]

Retrieves an enrollment. Useful to check its type and related metadata.

Args:

id (str): The id of the device account to update.

See: https://auth0.com/docs/api/management/v2#!/Guardian/get_enrollments_by_id

get_factor_providers(factor_name, name)[source]

Get Guardian SNS or SMS factor providers.

Returns provider configuration.

Args:

factor_name (str): Either push-notification or sms.

name (str): Name of the provider.

See: https://auth0.com/docs/api/management/v2#!/Guardian/get_sns

https://auth0.com/docs/api/management/v2#!/Guardian/get_twilio

get_templates()[source]

Get enrollment and verification templates.

Retrieve both templates. Useful to check if a different template than

default was set.

See: https://auth0.com/docs/api/management/v2#!/Guardian/get_templates

update_factor(name, body)[source]

Update Guardian factor. Useful to enable / disable factor.

Args:

name (str): Either push-notification or sms.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Guardian/put_factors_by_name

update_factor_providers(factor_name, name, body)[source]

Get Guardian factor providers.

Returns provider configuration.

Args:

factor_name (str): Either push-notification or sms.

name (str): Name of the provider.

body (dict): Details of the factor provider.

See: https://auth0.com/docs/api/management/v2#!/Guardian/put_twilio

update_templates(body)[source]

Update enrollment and verification SMS templates.

Useful to send custom messages on sms enrollment and verification.

Args:

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Guardian/put_templates

management.hooks module

class auth0.v3.management.hooks.Hooks(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Hooks endpoint implementation.

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

add_secrets(id, body)[source]

Add one or more secrets for an existing hook.

Args:

id (str): The id of the hook to add secrets to.

body (dict): Dict of key-value pairs where the value must be a string.

See: https://auth0.com/docs/api/management/v2#!/Hooks/post_secrets

all(enabled=True, fields=None, include_fields=True, page=None, per_page=None, include_totals=False)[source]

Retrieves a list of all hooks.

Args:
enabled (bool, optional): If provided, retrieves hooks that match

the value, otherwise all hooks are retrieved.

fields (list, optional): A list of fields to include or exclude

(depending on include_fields) from the result, empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise (defaults to true).

page (int, optional): The result’s page number (zero based).

per_page (int, optional): The amount of entries per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise.

See: https://auth0.com/docs/api/management/v2#!/Hooks/get_hooks

create(body)[source]

Creates a new Hook.

Args:
body (dict): Attributes for the newly created hook,

See: https://auth0.com/docs/api/v2#!/Hooks/post_hooks

delete(id)[source]

Deletes a hook.

Args:

id (str): The id of the hook to delete.

See: https://auth0.com/docs/api/management/v2#!/Hooks/delete_hooks_by_id

delete_secrets(id, body)[source]

Delete one or more existing secrets for an existing hook.

Args:

id (str): The id of the hook to add secrets to.

body (list): List of secret names to delete.

See: https://auth0.com/docs/api/management/v2#!/Hooks/delete_secrets

get(id, fields=None)[source]

Retrieves a hook by its ID.

Args:

id (str): The id of the hook to retrieve.

fields (list, optional): A list of fields to include or exclude

(depending on include_fields) from the result, empty to retrieve all fields.

See: https://auth0.com/docs/api/management/v2#!/Hooks/get_hooks_by_id

get_secrets(id)[source]

Retrieves a hook’s secrets.

Args:

id (str): The id of the hook to retrieve secrets from.

See: https://auth0.com/docs/api/management/v2#!/Hooks/get_secrets

update(id, body)[source]

Updates an existing hook.

Args:

id (str): The id of the hook to modify.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/v2#!/Hooks/patch_hooks_by_id

update_secrets(id, body)[source]

Update one or more existing secrets for an existing hook.

Args:

id (str): The id of the hook to add secrets to.

body (dict): Dict of key-value pairs where the value must be a string.

See: https://auth0.com/docs/api/management/v2#!/Hooks/patch_secrets

management.jobs module

class auth0.v3.management.jobs.Jobs(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 jobs endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

export_users(body)[source]

Export all users to a file using a long running job.

Check job status with get(). URL pointing to the export file will be included in the status once the job is complete.

Args:

body (dict): The details of the export users request.

See: https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports

get(id)[source]

Retrieves a job. Useful to check its status.

Args:

id (str): The id of the job.

See: https://auth0.com/docs/api/management/v2#!/Jobs/get_jobs_by_id

get_failed_job(id)[source]

Get failed job error details.

Args:

id (str): The id of the job.

See: https://auth0.com/docs/api/management/v2#!/Jobs/get_errors

get_results(job_id)[source]

Get results of a job

Args:

job_id (str): The id of the job.

Deprecation:

The /jobs/{id}/results endpoint was removed from the Management API. You can obtain the Job results by querying a Job by ID.

See: https://auth0.com/docs/api/management/v2#!/Jobs/get_jobs_by_id

import_users(connection_id, file_obj, upsert=False, send_completion_email=True, external_id=None)[source]

Imports users to a connection from a file.

Args:
connection_id (str): The connection id of the connection to which

users will be inserted.

file_obj (file): A file-like object to upload. The format for

this file is explained in: https://auth0.com/docs/bulk-import.

upsert (bool, optional): When set to False, pre-existing users that match on email address, user ID, or username

will fail. When set to True, pre-existing users that match on any of these fields will be updated, but only with upsertable attributes. Defaults to False. For a list of user profile fields that can be upserted during import, see the following article https://auth0.com/docs/users/references/user-profile-structure#user-profile-attributes.

send_completion_email (bool, optional): When set to True, an email will be sent to notify the completion of this job.

When set to False, no email will be sent. Defaults to True.

external_id (str, optional): Customer-defined ID.

See: https://auth0.com/docs/api/management/v2#!/Jobs/post_users_imports

send_verification_email(body)[source]

Send verification email.

Send an email to the specified user that asks them to click a link to verify their email address.

Args:

body (dict): Details of verification email request.

See: https://auth0.com/docs/api/v2#!/Jobs/post_verification_email

management.log_streams module

class auth0.v3.management.log_streams.LogStreams(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 log streams endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create(body)[source]

Creates a new log stream.

Args:

body (dict): the attributes for the role to create.

See: https://auth0.com/docs/api/management/v2/#!/Log_Streams/post_log_streams

delete(id)[source]

Delete a log stream.

Args:

id (str): The id of the log ste to delete.

See: https://auth0.com/docs/api/management/v2/#!/Log_Streams/delete_log_streams_by_id

get(id)[source]

Retrieves the data related to the log stream entry identified by id.

Args:

id (str): The id of the log stream to retrieve.

See: https://auth0.com/docs/api/management/v2/#!/Log_Streams/get_log_streams_by_id

list()[source]

Search log events.

Args: See: https://auth0.com/docs/api/management/v2/#!/Log_Streams/get_log_streams

update(id, body)[source]

Update a log stream with the attributes passed in ‘body’

Args:

id (str): The id of the log stream to update.

body (dict): the attributes to update on the log stream.

See: https://auth0.com/docs/api/management/v2/#!/Log_Streams/patch_log_streams_by_id

management.logs module

class auth0.v3.management.logs.Logs(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 logs endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

get(id)[source]

Retrieves the data related to the log entry identified by id.

Args:

id (str): The log_id of the log to retrieve.

See: https://auth0.com/docs/api/management/v2#!/Logs/get_logs_by_id

search(page=0, per_page=50, sort=None, q=None, include_totals=True, fields=None, from_param=None, take=None, include_fields=True)[source]

Search log events.

Args:
page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 50 results per page.

sort (str, optional): The field to use for sorting.

1 == ascending and -1 == descending. (e.g: date:1) When not set, the default value is up to the server.

q (str, optional): Query in Lucene query string syntax.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

from_param (str, optional): Log Event Id to start retrieving logs. You can

limit the amount of logs using the take parameter.

take (int, optional): The total amount of entries to retrieve when

using the from parameter. When not set, the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Logs/get_logs

management.organizations module

class auth0.v3.management.organizations.Organizations(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 organizations endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all_organization_connections(id, page=None, per_page=None)[source]

Retrieves a list of all the organization connections.

Args:

id (str): the ID of the organization.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_enabled_connections

all_organization_invitations(id, page=None, per_page=None)[source]

Retrieves a list of all the organization invitations.

Args:

id (str): the ID of the organization.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_invitations

all_organization_member_roles(id, user_id, page=None, per_page=None)[source]

Retrieves a list of all the roles from the given organization member.

Args:

id (str): the ID of the organization.

user_id (str): the ID of the user member of the organization.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_organization_member_roles

all_organization_members(id, page=None, per_page=None, include_totals=True, from_param=None, take=None)[source]

Retrieves a list of all the organization members.

Args:

id (str): the ID of the organization.

page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

from_param (str, optional): Checkpoint Id from which to begin retrieving results.

You can limit the number of entries using the take parameter.

take (int, optional): The total amount of entries to retrieve when

using the from parameter. When not set, the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_members

all_organizations(page=None, per_page=None, include_totals=True, from_param=None, take=None)[source]

Retrieves a list of all the organizations.

Args:
page (int): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

from_param (str, optional): Checkpoint Id from which to begin retrieving results.

You can limit the number of entries using the take parameter.

take (int, optional): The total amount of entries to retrieve when

using the from parameter. When not set, the default value is up to the server.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations

create_organization(body)[source]

Create a new organization.

Args:

body (dict): Attributes for the new organization.

See: https://auth0.com/docs/api/management/v2#!/Organizations/post_organizations

create_organization_connection(id, body)[source]

Adds a connection to an organization.

Args:

id (str): the ID of the organization.

body (dict): Attributes for the connection to add.

See: https://auth0.com/docs/api/management/v2#!/Organizations/post_enabled_connections

create_organization_invitation(id, body)[source]

Create an invitation to an organization.

Args:

id (str): the ID of the organization.

body (dict): Attributes for the invitation to create.

See: https://auth0.com/docs/api/management/v2#!/Organizations/post_invitations

create_organization_member_roles(id, user_id, body)[source]

Adds roles to a member of an organization.

Args:

id (str): the ID of the organization.

user_id (str): the ID of the user member of the organization.

body (dict): Attributes from the members to add.

See: https://auth0.com/docs/api/management/v2#!/Organizations/post_organization_member_roles

create_organization_members(id, body)[source]

Adds members to an organization.

Args:

id (str): the ID of the organization.

body (dict): Attributes from the members to add.

See: https://auth0.com/docs/api/management/v2#!/Organizations/post_members

delete_organization(id)[source]

Deletes an organization and all its related assets.

Args:

id (str): Id of organization to delete.

See: https://auth0.com/docs/api/management/v2#!/Organizations/delete_organizations_by_id

delete_organization_connection(id, connection_id)[source]

Deletes a connection from the given organization.

Args:

id (str): Id of organization.

connection_id (str): the ID of the connection to delete.

See: https://auth0.com/docs/api/management/v2#!/Organizations/delete_enabled_connections_by_connectionId

delete_organization_invitation(id, invitation_id)[source]

Deletes an invitation from the given organization.

Args:

id (str): Id of organization.

invitation_id (str): the ID of the invitation to delete.

See: https://auth0.com/docs/api/management/v2#!/Organizations/delete_invitations_by_invitation_id

delete_organization_member_roles(id, user_id, body)[source]

Deletes roles from a member of an organization.

Args:

id (str): Id of organization.

user_id (str): the ID of the user member of the organization.

body (dict): Attributes from the members to delete

See: https://auth0.com/docs/api/management/v2#!/Organizations/delete_organization_member_roles

delete_organization_members(id, body)[source]

Deletes members from the given organization.

Args:

id (str): Id of organization.

body (dict): Attributes from the members to delete

See: https://auth0.com/docs/api/management/v2#!/Organizations/delete_members

get_organization(id)[source]

Retrieves an organization by its ID.

Args:

id (str): Id of organization to retrieve.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations_by_id

get_organization_by_name(name=None)[source]

Retrieves an organization given its name.

Args:

name (str): The name of the organization to retrieve.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_name_by_name

get_organization_connection(id, connection_id)[source]

Retrieves an organization connection by its ID.

Args:

id (str): the ID of the organization.

connection_id (str): the ID of the connection.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_enabled_connections_by_connectionId

get_organization_invitation(id, invitaton_id)[source]

Retrieves an organization invitation by its ID.

Args:

id (str): the ID of the organization.

invitaton_id (str): the ID of the invitation.

See: https://auth0.com/docs/api/management/v2#!/Organizations/get_invitations_by_invitation_id

update_organization(id, body)[source]

Modifies an organization.

Args:

id (str): the ID of the organization.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Organizations/patch_organizations_by_id

update_organization_connection(id, connection_id, body)[source]

Modifies an organization.

Args:

id (str): the ID of the organization.

connection_id (str): the ID of the connection to update.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Organizations/patch_enabled_connections_by_connectionId

management.resource_servers module

class auth0.v3.management.resource_servers.ResourceServers(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 resource servers endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create(body)[source]

Create a new resource server.

Args:

body (dict): Attributes for the new resource Server.

See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/post_resource_servers

delete(id)[source]

Deletes a resource server.

Args:

id (str): Id of resource server to delete.

See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/delete_resource_servers_by_id

get(id)[source]

Retrieves a resource server by its id.

Args:

id (str): id of the resource server to get.

See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers_by_id

get_all(page=None, per_page=None, include_totals=False)[source]

Retrieves all resource servers

Args:
page (int, optional): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to False.

See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers

update(id, body)[source]

Modifies a resource server.

Args:

id (str): The id of the resource server to update.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/patch_resource_servers_by_id

management.rest module

class auth0.v3.management.rest.EmptyResponse(status_code)[source]

Bases: auth0.v3.management.rest.Response

class auth0.v3.management.rest.JsonResponse(response)[source]

Bases: auth0.v3.management.rest.Response

class auth0.v3.management.rest.PlainResponse(response)[source]

Bases: auth0.v3.management.rest.Response

class auth0.v3.management.rest.Response(status_code, content, headers)[source]

Bases: object

content()[source]
class auth0.v3.management.rest.RestClient(jwt, telemetry=True, timeout=5.0, options=None)[source]

Bases: object

Provides simple methods for handling all RESTful api endpoints.

Args:
telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. Overrides matching options passed to the constructor. (defaults to 3)

MAX_REQUEST_RETRIES()[source]
MAX_REQUEST_RETRY_DELAY()[source]
MAX_REQUEST_RETRY_JITTER()[source]
MIN_REQUEST_RETRY_DELAY()[source]
delete(url, params=None, data=None)[source]
file_post(url, data=None, files=None)[source]
get(url, params=None)[source]
patch(url, data=None)[source]
post(url, data=None)[source]
put(url, data=None)[source]
class auth0.v3.management.rest.RestClientOptions(telemetry=None, timeout=None, retries=None)[source]

Bases: object

Configuration object for RestClient. Used for configuring

additional RestClient options, such as rate-limit retries.

Args:
telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

retries (integer): In the event an API request returns a

429 response header (indicating rate-limit has been hit), the RestClient will retry the request this many times using an exponential backoff strategy, before raising a RateLimitError exception. 10 retries max. (defaults to 3)

management.roles module

class auth0.v3.management.roles.Roles(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 roles endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

add_permissions(id, permissions)[source]

Associates permissions with a role.

Args:

id (str): The role’s id.

permissions (list of str): A list of permission ids to associate to the role.

See https://auth0.com/docs/api/management/v2#!/Roles/post_role_permission_assignment

add_users(id, users)[source]

Assign users to a role.

Args:

id (str): The role’s id.

users (list of str): A list of users ids to add to this role.

See https://auth0.com/docs/api/management/v2#!/Roles/post_role_users

create(body)[source]

Creates a new role.

Args:

body (dict): the attributes for the role to create.

See: https://auth0.com/docs/api/v2#!/Roles/post_roles

delete(id)[source]

Delete a role.

Args:

id (str): The id of the role to delete.

See: https://auth0.com/docs/api/management/v2#!/Roles/delete_roles_by_id

get(id)[source]

Get a role.

Args:

id (str): The id of the role to retrieve.

See: https://auth0.com/docs/api/management/v2#!/Roles/get_roles_by_id

list(page=0, per_page=25, include_totals=True, name_filter=None)[source]

List or search roles.

Args:
page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

name_filter (str, optional): A case-insensitive filter to apply

to search for roles by name.

See: https://auth0.com/docs/api/management/v2#!/Roles/get_roles

list_permissions(id, page=0, per_page=25, include_totals=True)[source]

List the permissions associated to a role.

Args:

id (str): The role’s id.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

See https://auth0.com/docs/api/management/v2#!/Roles/get_role_permission

list_users(id, page=0, per_page=25, include_totals=True, from_param=None, take=None)[source]

List the users that have been associated with a given role.

Args:

id (str): The role’s id.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

from_param (str, optional): Checkpoint Id from which to begin retrieving results.

You can limit the number of entries using the take parameter.

take (int, optional): The total amount of entries to retrieve when

using the from parameter. When not set, the default value is up to the server.

See https://auth0.com/docs/api/management/v2#!/Roles/get_role_user

remove_permissions(id, permissions)[source]

Unassociates permissions from a role.

Args:

id (str): The role’s id.

permissions (list of str): A list of permission ids to unassociate from the role.

See https://auth0.com/docs/api/management/v2#!/Roles/delete_role_permission_assignment

update(id, body)[source]

Update a role with the attributes passed in ‘body’

Args:

id (str): The id of the role to update.

body (dict): the attributes to update on the role.

See: https://auth0.com/docs/api/management/v2#!/Roles/patch_roles_by_id

management.rules_configs module

class auth0.v3.management.rules_configs.RulesConfigs(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

RulesConfig endpoint implementation.

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all()[source]

Lists the config variable keys for rules.

See: https://auth0.com/docs/api/management/v2#!/Rules_Configs/get_rules_configs

set(key, value)[source]

Sets the rules config for a given key.

Args:

key (str): rules config key to set.

value (str): value to set for the rules config key.

See: https://auth0.com/docs/api/management/v2#!/Rules_Configs/put_rules_configs_by_key

unset(key)[source]

Removes the rules config for a given key.

Args:

key (str): rules config key to remove.

See: https://auth0.com/docs/api/management/v2#!/Rules_Configs/delete_rules_configs_by_key

management.rules module

class auth0.v3.management.rules.Rules(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Rules endpoint implementation.

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

all(stage='login_success', enabled=True, fields=None, include_fields=True, page=None, per_page=None, include_totals=False)[source]

Retrieves a list of all rules.

Args:
stage (str, optional): Retrieves rules that match the execution stage.

Defaults to login_success.

enabled (bool, optional): If provided, retrieves rules that match

the value, otherwise all rules are retrieved.

fields (list, optional): A list of fields to include or exclude

(depending on include_fields) from the result. Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

page (int, optional): The result’s page number (zero based). When not set,

the default value is up to the server.

per_page (int, optional): The amount of entries per page. When not set,

the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to False.

See: https://auth0.com/docs/api/management/v2#!/Rules/get_rules

create(body)[source]

Creates a new rule.

Args:

body (dict): Attributes for the newly created rule.

See: https://auth0.com/docs/api/v2#!/Rules/post_rules

delete(id)[source]

Delete a rule.

Args:

id (str): The id of the rule to delete.

See: https://auth0.com/docs/api/management/v2#!/Rules/delete_rules_by_id

get(id, fields=None, include_fields=True)[source]

Retrieves a rule by its ID.

Args:

id (str): The id of the rule to retrieve.

fields (list, optional): A list of fields to include or exclude

(depending on include_fields) from the result. Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Rules/get_rules_by_id

update(id, body)[source]

Update an existing rule

Args:

id (str): The id of the rule to modify.

body (dict): Attributes to modify.

See: https://auth0.com/docs/api/v2#!/Rules/patch_rules_by_id

management.stats module

class auth0.v3.management.stats.Stats(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 stats endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

active_users()[source]

Gets the active users count (logged in during the last 30 days).

Returns: An integer.

See: https://auth0.com/docs/api/management/v2#!/Stats/get_active_users

daily_stats(from_date=None, to_date=None)[source]

Gets the daily stats for a particular period.

Args:
from_date (str, optional): The first day of the period (inclusive) in

YYYYMMDD format.

to_date (str, optional): The last day of the period (inclusive) in

YYYYMMDD format.

See: https://auth0.com/docs/api/management/v2#!/Stats/get_daily

management.tenants module

class auth0.v3.management.tenants.Tenants(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 tenants endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

get(fields=None, include_fields=True)[source]

Get tenant settings.

Args:
fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Tenants/get_settings

update(body)[source]

Update tenant settings.

Args:

body (dict): the attributes to update in the tenant.

See: https://auth0.com/docs/api/v2#!/Tenants/patch_settings

management.tickets module

class auth0.v3.management.tickets.Tickets(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 tickets endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

create_email_verification(body)[source]

Create an email verification ticket.

Args:

body (dict): attributes to set on the email verification request.

See: https://auth0.com/docs/api/v2#!/Tickets/post_email_verification

create_pswd_change(body)[source]

Create password change ticket.

Args:

body (dict): attributes to set on the password change request.

See: https://auth0.com/docs/api/v2#!/Tickets/post_password_change

management.user_blocks module

class auth0.v3.management.user_blocks.UserBlocks(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 user blocks endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

get(id)[source]

Get a user’s blocks

Args:

id (str): The user_id of the user to retrieve.

See: https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks_by_id

get_by_identifier(identifier)[source]

Gets blocks by identifier

Args:

identifier (str): Should be any of: username, phone_number, email.

See: https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks

unblock(id)[source]

Unblock a user

Args:

id (str): The user_id of the user to update.

See: https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks_by_id

unblock_by_identifier(identifier)[source]

Unblocks by identifier

Args:

identifier (str): Should be any of: username, phone_number, email.

See: https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks

management.users_by_email module

class auth0.v3.management.users_by_email.UsersByEmail(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 users by email endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

search_users_by_email(email, fields=None, include_fields=True)[source]

List or search users.

Args:

email: Email to search.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be include in the result, False otherwise.

See: https://auth0.com/docs/api/management/v2#!/Users_By_Email/get_users_by_email

management.users module

class auth0.v3.management.users.Users(domain, token, telemetry=True, timeout=5.0, protocol='https', rest_options=None)[source]

Bases: object

Auth0 users endpoints

Args:

domain (str): Your Auth0 domain, e.g: ‘username.auth0.com’

token (str): Management API v2 Token

telemetry (bool, optional): Enable or disable Telemetry

(defaults to True)

timeout (float or tuple, optional): Change the requests

connect and read timeout. Pass a tuple to specify both values separately or a float to set both to it. (defaults to 5.0 for both)

rest_options (RestClientOptions): Pass an instance of

RestClientOptions to configure additional RestClient options, such as rate-limit retries. (defaults to None)

add_permissions(id, permissions)[source]

Assign permissions to a user.

Args:

id (str): The user’s id.

permissions (list of str): A list of permission ids to associated with the user.

See https://auth0.com/docs/api/management/v2#!/Users/post_permissions

add_roles(id, roles)[source]

Associate an array of roles with a user.

Args:

id (str): The user’s id.

roles (list of str): A list of roles ids to associated with the user.

See https://auth0.com/docs/api/management/v2#!/Users/post_user_roles

create(body)[source]

Creates a new user.

Args:

body (dict): the attributes to set on the user to create.

See: https://auth0.com/docs/api/v2#!/Users/post_users

delete(id)[source]

Delete a user.

Args:

id (str): The user_id of the user to delete.

See: https://auth0.com/docs/api/management/v2#!/Users/delete_users_by_id

delete_all_users()[source]

Deletes all users (USE WITH CAUTION). Deprecation: This endpoint is no longer available server-side.

Args:

delete_multifactor(id, provider)[source]

Delete a user’s multifactor provider.

Args:

id (str): The user’s id.

provider (str): The multifactor provider. Supported values ‘duo’

or ‘google-authenticator’.

See: https://auth0.com/docs/api/management/v2#!/Users/delete_multifactor_by_provider

get(id, fields=None, include_fields=True)[source]

Get a user.

Args:

id (str): The user_id of the user to retrieve.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be included in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id

get_guardian_enrollments(user_id)[source]

Retrieves all Guardian enrollments.

Args:

user_id (str): The user_id of the user to retrieve.

See: https://auth0.com/docs/api/management/v2#!/Users/get_enrollments

get_log_events(user_id, page=0, per_page=50, sort=None, include_totals=False)[source]

Retrieve every log event for a specific user id.

Args:

user_id (str): The user_id of the logs to retrieve.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 50 results per page.

sort (str, optional): The field to use for sorting. Use field:order

where order is 1 for ascending and -1 for descending. For example date:-1 When not set, the default value is up to the server.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to False.

See: https://auth0.com/docs/api/management/v2#!/Users/get_logs_by_user

invalidate_remembered_browsers(user_id)[source]

Invalidate all remembered browsers across all authentication factors for a user.

Args:

user_id (str): The user_id to invalidate remembered browsers for.

See: https://auth0.com/docs/api/management/v2#!/Users/post_invalidate_remember_browser

Link user accounts.

Links the account specified in the body (secondary account) to the account specified by the id param of the URL (primary account).

Args:
id (str): The user_id of the primary identity where you are linking

the secondary account to.

body (dict): the attributes to send as part of this request.

See: https://auth0.com/docs/api/v2#!/Users/post_identities

list(page=0, per_page=25, sort=None, connection=None, q=None, search_engine=None, include_totals=True, fields=None, include_fields=True)[source]

List or search users.

Args:
page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

sort (str, optional): The field to use for sorting.

1 == ascending and -1 == descending. (e.g: email:1) When not set, the default value is up to the server.

connection (str, optional): Connection filter.

q (str, optional): Query in Lucene query string syntax. Only fields

in app_metadata, user_metadata or the normalized user profile are searchable.

search_engine (str, optional): The version of the search_engine to use

when querying for users. Will default to the latest version available. See: https://auth0.com/docs/users/search.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

fields (list of str, optional): A list of fields to include or

exclude from the result (depending on include_fields). Leave empty to retrieve all fields.

include_fields (bool, optional): True if the fields specified are

to be include in the result, False otherwise. Defaults to True.

See: https://auth0.com/docs/api/management/v2#!/Users/get_users

list_organizations(id, page=0, per_page=25, include_totals=True)[source]

List the organizations that the user is member of.

Args:

id (str): The user’s id.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

See https://auth0.com/docs/api/management/v2#!/Users/get_organizations

list_permissions(id, page=0, per_page=25, include_totals=True)[source]

List the permissions associated to the user.

Args:

id (str): The user’s id.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

See https://auth0.com/docs/api/management/v2#!/Users/get_permissions

list_roles(id, page=0, per_page=25, include_totals=True)[source]

List the roles associated with a user.

Args:

id (str): The user’s id.

page (int, optional): The result’s page number (zero based). By default,

retrieves the first page of results.

per_page (int, optional): The amount of entries per page. By default,

retrieves 25 results per page.

include_totals (bool, optional): True if the query summary is

to be included in the result, False otherwise. Defaults to True.

See https://auth0.com/docs/api/management/v2#!/Users/get_user_roles

regenerate_recovery_code(user_id)[source]

Removes the current recovery token, generates and returns a new one

Args:

user_id (str): The user_id of the user identity.

See: https://auth0.com/docs/api/management/v2#!/Users/post_recovery_code_regeneration

remove_permissions(id, permissions)[source]

Removes permissions from a user.

Args:

id (str): The user’s id.

permissions (list of str): A list of permission ids to unassociate from the user.

See https://auth0.com/docs/api/management/v2#!/Users/delete_permissions

remove_roles(id, roles)[source]

Removes an array of roles from a user.

Args:

id (str): The user’s id.

roles (list of str): A list of roles ids to unassociate from the user.

See https://auth0.com/docs/api/management/v2#!/Users/delete_user_roles

Unlink a user account

Args:

id (str): The user_id of the user identity.

provider (str): The type of identity provider (e.g: facebook).

user_id (str): The unique identifier for the user for the identity.

See: https://auth0.com/docs/api/management/v2#!/Users/delete_user_identity_by_user_id

update(id, body)[source]

Update a user with the attributes passed in ‘body’

Args:

id (str): The user_id of the user to update.

body (dict): The attributes of the user to update.

See: https://auth0.com/docs/api/v2#!/Users/patch_users_by_id