management package

management.auth0 module

class auth0.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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

dict[str, str]

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.

Return type:

list[dict[str, str]]

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.branding module

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

Bases: object

Auth0 Branding 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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

rest_options (RestClientOptions): Pass an instance of

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

create_branding_theme(body)[source]

Create branding theme.

Args:

body (dict): The attributes to set on the theme.

See: https://auth0.com/docs/api/management/v2#!/Branding/post_branding_theme

delete_branding_theme(theme_id)[source]

Delete branding theme.

Return type:

Any

Args:

theme_id (str): The theme_id to delete branding theme for.

See: https://auth0.com/docs/api/management/v2#!/Branding/delete_branding_theme

delete_template_universal_login()[source]

Delete template for New Universal Login Experience. Requires “delete:branding” scope.

See: https://auth0.com/docs/api/management/v2#!/Branding/delete_universal_login

Return type:

Any

get()[source]

Retrieve branding settings. Requires “read:branding” scope.

See: https://auth0.com/docs/api/management/v2#!/Branding/get_branding

get_branding_theme(theme_id)[source]

Retrieve branding theme.

Args:

theme_id (str): The theme_id to retrieve branding theme for.

See: https://auth0.com/docs/api/management/v2#!/Branding/get_branding_theme

get_default_branding_theme()[source]

Retrieve default branding theme.

See: https://auth0.com/docs/api/management/v2#!/Branding/get_default_branding_theme

get_template_universal_login()[source]

Get template for New Universal Login Experience. Requires “read:branding” scope.

See: https://auth0.com/docs/api/management/v2#!/Branding/get_universal_login

update(body)[source]

Update branding settings. Requires “update:branding” scope.

Args:

body (dict): Attributes for the updated trigger binding.

See: https://auth0.com/docs/api/management/v2#!/Branding/patch_branding

update_branding_theme(theme_id, body)[source]

Update branding theme.

Args:

theme_id (str): The theme_id to update branding theme for. body (dict): The attributes to set on the theme.

See: https://auth0.com/docs/api/management/v2#!/Branding/patch_branding_theme

update_template_universal_login(body)[source]

Update template for New Universal Login Experience. Requires “update:branding” scope.

Args:

body (str): Complete HTML content to assign to the template. See linked API documentation for example.

See: https://auth0.com/docs/api/management/v2#!/Branding/put_universal_login

management.client_grants module

class auth0.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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, allow_any_organization=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.

allow_any_organization (bool, optional): Optional filter on allow_any_organization.

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.

Return type:

Any

Args:

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

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

get_organizations(id, page=None, per_page=None, include_totals=False, from_param=None, take=None)[source]

Get the organizations associated to a client grant.

Args:

id (str): Id of client grant.

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.

from_param (str, optional): Id to start retrieving entries. You can

limit the amount 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.

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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, 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.

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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, name=None)[source]

Retrieves all connections.

Return type:

list[dict[str, Any]]

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.

name (str): Provide the name of the connection to retrieve.

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.

Return type:

Any

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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, page=None, per_page=None, include_totals=False)[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.

page (int, optional): Page index of the results to return. First page is 0.

per_page (int, optional): Number of results per page.

include_totals (bool, optional): True to return results inside an object

that contains the total result count (True) or as a direct array of results (False, default).

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

management.email_templates module

class auth0.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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

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

Imports users to a connection from a file.

Return type:

dict[str, Any]

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

rest_options (RestClientOptions): Pass an instance of

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

add_client_grant(id, grant_id)[source]

Associate a client grant with an organization.

Args:

id (str): the ID of the organization.

grant_id (string) A Client Grant ID to add to the organization.

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

Retrieves a list of all the organization connections.

Return type:

list[dict[str, Any]]

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, include_totals=False)[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.

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

to be included in the result, False otherwise. Defaults to False. NOTE: returns start and limit, total count is not yet supported

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.

Return type:

list[dict[str, Any]]

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, fields=None, include_fields=True)[source]

Retrieves a list of all the organization members.

Member roles are not sent by default. Use fields=roles to retrieve the roles assigned to each listed member. To use this parameter, you must include the read:organization_member_roles scope in the token.

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.

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

exclude from the result (depending on include_fields). If fields is left blank, all fields (except roles) are returned.

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/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_client_grant(id, grant_id)[source]

Remove a client grant from an organization.

Args:

id (str): the ID of the organization.

grant_id (string) A Client Grant ID to remove from the organization.

delete_organization(id)[source]

Deletes an organization and all its related assets.

Return type:

Any

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.

Return type:

Any

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.

Return type:

Any

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_client_grants(id, audience=None, client_id=None, page=None, per_page=None, include_totals=False)[source]

Get client grants associated to an organization.

Args:

id (str): Id of organization.

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

to filter.

client_id (string, optional): The id of a client 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.

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.

Return type:

dict[str, Any]

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.prompts module

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

Bases: object

Auth0 prompts 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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

rest_options (RestClientOptions): Pass an instance of

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

get()[source]

Retrieves prompts settings.

See: https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts

get_custom_text(prompt, language)[source]

Retrieves custom text for a prompt in a specific language.

Args:

prompt (str): Name of the prompt.

language (str): Language to update.

See: https://auth0.com/docs/api/management/v2#!/Prompts/get_custom_text_by_language

update(body)[source]

Updates prompts settings.

See: https://auth0.com/docs/api/management/v2#!/Prompts/patch_prompts

update_custom_text(prompt, language, body)[source]

Updates custom text for a prompt in a specific language.

Args:

prompt (str): Name of the prompt.

language (str): Language to update.

body (dict): An object containing custom dictionaries for a group of screens.

See: https://auth0.com/docs/api/management/v2#!/Prompts/put_custom_text_by_language

management.resource_servers module

class auth0.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.roles module

class auth0.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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

Return type:

int

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

Gets the daily stats for a particular period.

Return type:

list[dict[str, Any]]

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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

Return type:

Any

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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.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)

protocol (str, optional): Protocol to use when making requests.

(defaults to “https”)

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

create_authentication_method(user_id, body)[source]

Creates an authentication method for a given user.

Args:

user_id (str): The user_id to create an authentication method for a given user. body (dict): the request body to create an authentication method for a given user.

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

delete(id)[source]

Delete a user.

Return type:

Any

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_authentication_method_by_id(user_id, authentication_method_id)[source]

Deletes an authentication method by ID.

Return type:

Any

Args:

user_id (str): The user_id to delete an authentication method by ID for. authentication_method_id (str): The authentication_method_id to delete an authentication method by ID for.

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

delete_authentication_methods(user_id)[source]

Deletes all authentication methods for the given user.

Return type:

Any

Args:

user_id (str): The user_id to delete all authentication methods for the given user for.

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

delete_authenticators(id)[source]

Delete a user’s MFA enrollments.

Return type:

Any

Args:

id (str): The user’s id.

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

delete_multifactor(id, provider)[source]

Delete a user’s multifactor provider.

Return type:

Any

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.

Return type:

dict[str, Any]

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_authentication_method_by_id(user_id, authentication_method_id)[source]

Gets an authentication method by ID.

Args:

user_id (str): The user_id to get an authentication method by ID for. authentication_method_id (str): The authentication_method_id to get an authentication method by ID for.

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

get_authentication_methods(user_id)[source]

Gets a list of authentication methods

Args:

user_id (str): The user_id to get a list of authentication methods for.

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

get_guardian_enrollments(user_id)[source]

Retrieve the first confirmed Guardian enrollment for a user.

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.

Return type:

Any

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.

Return type:

Any

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

Return type:

Any

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

update_authentication_method_by_id(user_id, authentication_method_id, body)[source]

Updates an authentication method.

Args:

user_id (str): The user_id to update an authentication method. authentication_method_id (str): The authentication_method_id to update an authentication method for. body (dict): the request body to update an authentication method.

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

update_authentication_methods(user_id, body)[source]

Updates all authentication methods for a user by replacing them with the given ones.

Args:

user_id (str): The user_id to update all authentication methods for. body (dict): the request body to update all authentication methods with.

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