ManagementClient

management. ManagementClient

ManagementClient Management API SDK.

The Auth0 Management API is meant to be used by back-end servers or trusted parties performing administrative tasks. Generally speaking, anything that can be done through the Auth0 dashboard (and more) can also be done through this API.

Constructor

new ManagementClient(options)

Source:
Parameters:
Name Type Description
options Object

Options for the ManagementClient SDK. If a token is provided only the domain is required, other parameters are ignored. If no token is provided domain, clientId, clientSecret and scopes are required

Name Type Attributes Default Description
domain String

ManagementClient server domain.

token String <optional>

API access token.

clientId String <optional>

Management API Non Interactive Client Id.

clientSecret String <optional>

Management API Non Interactive Client Secret.

audience String <optional>

Management API Audience. By default is your domain's, e.g. the domain is tenant.auth0.com and the audience is http://tenant.auth0.com/api/v2/

scope String <optional>

Management API Scopes.

tokenProvider.enableCache Boolean <optional>
true

Enabled or Disable Cache.

tokenProvider.cacheTTLInSeconds Number <optional>

By default the expires_in value will be used to determine the cached time of the token, this can be overridden.

retry.enabled Boolean <optional>
true

Enabled or Disable Retry Policy functionality.

retry.maxRetries Number <optional>
10

Retry failed requests X times.

Examples

Initialize your client class with an API v2 token (you can generate one here) and a domain.

var ManagementClient = require('auth0').ManagementClient;
var auth0 = new ManagementClient({
  domain: '{YOUR_ACCOUNT}.auth0.com',
  token: '{YOUR_API_V2_TOKEN}'
});

Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant.

var ManagementClient = require('auth0').ManagementClient;
var auth0 = new ManagementClient({
  domain: '{YOUR_ACCOUNT}.auth0.com',
  clientId: '{YOUR_NON_INTERACTIVE_CLIENT_ID}',
  clientSecret: '{YOUR_NON_INTERACTIVE_CLIENT_SECRET}',
  scope: "read:users write:users",
  audience: 'https://{YOUR_TENANT_NAME}.auth0.com/api/v2/',
  tokenProvider: {
   enableCache: true,
   cacheTTLInSeconds: 10
 }
});

Members

blacklistedTokens :BlacklistedtokensManager

Simple abstraction for performing CRUD operations on the blacklisted tokens endpoint.

Source:
Type:
  • BlacklistedtokensManager

clientGrants :ClientGrantsManager

Simple abstraction for performing CRUD operations on the client grants endpoint.

Source:
Type:
  • ClientGrantsManager

clients :ClientsManager

Simple abstraction for performing CRUD operations on the clients endpoint.

Source:
Type:
  • ClientsManager

connections :ConnectionsManager

Simple abstraction for performing CRUD operations on the connections endpoint.

Source:
Type:
  • ConnectionsManager

customDomains :CustomDomainsManager

Simple abstraction for performing CRUD operations on the custom domains endpoint.

Source:
Type:
  • CustomDomainsManager

deviceCredentials :DeviceCredentialsManager

Simple abstraction for performing CRUD operations on the device credentials endpoint.

Source:
Type:
  • DeviceCredentialsManager

emailProvider :EmailProviderManager

Simple abstraction for performing CRUD operations on the email provider endpoint.

Source:
Type:
  • EmailProviderManager

emailTemplates :EmailTemplatesManager

Simple abstraction for performing CRUD operations on Auth0's Email Templates

Source:
Type:
  • EmailTemplatesManager

grants :GrantsManager

Simple abstraction for performing CRUD operations on the grants endpoint.

Source:
Type:
  • GrantsManager

guardian :GuardianManager

Simple abstraction for performing CRUD operations on the guardian endpoint.

Source:
Type:
  • GuardianManager

jobs :JobsManager

Jobs manager.

Source:
Type:
  • JobsManager

logs :LogsManager

Logs manager.

Source:
Type:
  • LogsManager

resourceServers :ResourceServersManager

Simple abstraction for performing CRUD operations on the resource servers endpoint.

Source:
Type:
  • ResourceServersManager

roles :RolesManager

Simple abstraction for performing CRUD operations on the roles endpoint.

Source:
Type:
  • RolesManager

rules :RulesManager

Simple abstraction for performing CRUD operations on the rules endpoint.

Source:
Type:
  • RulesManager

rulesConfigs :RulesConfigsManager

RulesConfigs manager.

Source:
Type:
  • RulesConfigsManager

stats :StatsManager

ManagementClient account statistics manager.

Source:
Type:
  • StatsManager

tenant :TenantManager

ManagementClient tenant settings manager.

Source:
Type:
  • TenantManager

tickets :TicketsManager

Tickets manager.

Source:
Type:
  • TicketsManager

userBlocks :UserBlocksManager

Simple abstraction for performing CRUD operations on the user-blocks endpoint.

Source:
Type:
  • UserBlocksManager

users :UsersManager

Simple abstraction for performing CRUD operations on the users endpoint.

Source:
Type:
  • UsersManager

Methods

addPermissionsInRole(data, cbopt) → {Promise|undefined}

Add permissions in a role

Source:
Parameters:
Name Type Attributes Description
params.id String

ID of the Role.

data Object

permissions data

Name Type Description
permissions String

Array of permissions

Name Type Description
permission_name String

Name of a permission

resource_server_identifier String

Identifier for a resource

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id :'ROLE_ID'};
var data = { "permissions" : [{"permission_name" :"do:something" ,"resource_server_identifier" :"test123" }]};

management.addPermissionsInRole(params, data, function (err, permissions) {
  console.log(permissions);
});

assignPermissionsToUser(params, data, cbopt) → {Promise|undefined}

Asign permissions to a user

Source:
Parameters:
Name Type Attributes Description
params Object

params object

Name Type Description
id String

user_id

data String

data object containing list of permissions

Name Type Description
permissions String

Array of permission IDs

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var parms =  { id : 'USER_ID'};
var data = { "permissions" : [{"permission_name" :"do:something" ,"resource_server_identifier" :"test123" }]};

management.assignPermissionsToUser(params, data, function (err) {
  if (err) {
    // Handle error.
  }

  // User assigned permissions.
});

assignRolestoUser(params, data, cbopt) → {Promise|undefined}

Asign roles to a user

Source:
Parameters:
Name Type Attributes Description
params Object

params object

Name Type Description
id String

user_id

data String

data object containing list of role IDs

Name Type Description
roles String

Array of role IDs

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var parms =  { id : 'USER_ID'};
var data = { "roles" :["role1"]};

management.assignRolestoUser(params, data, function (err) {
  if (err) {
    // Handle error.
  }

  // User assigned roles.
});

blacklistToken(token, cbopt) → {Promise|undefined}

Blacklist a new token.

Source:
Parameters:
Name Type Attributes Description
token Object

Token data.

Name Type Description
aud String

Audience (your app client ID).

jti String

The JWT ID claim.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var token = {
 aud: 'aud',
 jti: 'jti'
};

management.blacklistToken(token, function (err) {
  if (err) {
    // Handle error.
  }

  // Token blacklisted.
});

configureEmailProvider(data, cbopt) → {Promise|undefined}

Configure the email provider.

Source:
Parameters:
Name Type Attributes Description
data Object

The email provider data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.configureEmailProvider(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Email provider configured.
});

createClient(data, cbopt) → {Promise|undefined}

Create an Auth0 client.

Source:
Parameters:
Name Type Attributes Description
data Object

The client data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createClient(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Client created.
});

createClientGrant(data, cbopt) → {Promise|undefined}

Create an Auth0 client grant.

Source:
Parameters:
Name Type Attributes Description
data Object

The client data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.clientGrants.create(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Client grant created.
});

createConnection(data, cbopt) → {Promise|undefined}

Create a new connection.

Source:
Parameters:
Name Type Attributes Description
data Object

Connection data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createConnection(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Conection created.
});

createCustomDomain(data, cbopt) → {Promise|undefined}

Create an Auth0 Custom Domain.

Source:
Parameters:
Name Type Attributes Description
data Object

The custom domain data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createCustomDomain(data, function (err) {
  if (err) {
    // Handle error.
  }

  // CustomDomain created.
});

createDevicePublicKey(data, cbopt) → {Promise|undefined}

Create an Auth0 credential.

Source:
Parameters:
Name Type Attributes Description
data Object

The device credential data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createConnection(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Credential created.
});

createEmailVerificationTicket(cbopt) → {Promise}

Create an email verification ticket.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise
Example
var data = {
  user_id: '{USER_ID}',
  result_url: '{REDIRECT_URL}' // Optional redirect after the ticket is used.
};

auth0.createEmailVerificationTicket(data, function (err) {
  if (err) {
    // Handle error.
  }
});

createGuardianEnrollmentTicket(cbopt) → {Promise|undefined}

Create a Guardian enrollment ticket.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createGuardianEnrollmentTicket(function (err, ticket) {
  console.log(ticket);
});

createPasswordChangeTicket(cbopt) → {Promise}

Create a new password change ticket.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise
Example
var params = {
  result_url: '{REDIRECT_URL}',  // Redirect after using the ticket.
  user_id: '{USER_ID}'
};

// or

var params = {
  result_url: '{REDIRECT_URL}',  // Redirect after using the ticket.
  email: '{USER_EMAIL}',
  connection_id: '{CONNECTION}' // eg. con_00000000001
};

auth0.createPasswordChangeTicket(params, function (err) {
  if (err) {
    // Handle error.
  }
});

createResourceServer(data, cbopt) → {Promise|undefined}

Create a new resource server.

Source:
Parameters:
Name Type Attributes Description
data Object

Resource Server data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createResourceServer(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Resource Server created.
});

createRole(data, cbopt) → {Promise|undefined}

Create a new role.

Source:
Parameters:
Name Type Attributes Description
data Object

Role data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
data = {"name": "test1","description": "123"}
management.createRole(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Role created.
});

createRule(data, cbopt) → {Promise|undefined}

Create a new rule.

Source:
Parameters:
Name Type Attributes Description
data Object

Rule data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createRule(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Rule created.
});

createUser(data, cbopt) → {Promise|undefined}

Create a new user.

Source:
Parameters:
Name Type Attributes Description
data Object

User data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.createUser(data, function (err) {
  if (err) {
    // Handle error.
  }

  // User created.
});

deleteAllUsers(cbopt) → {Promise|undefined}

Delete all users.

Deprecated:
  • This method will be removed in the next major release.
Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.deleteAllUsers(function (err) {
  if (err) {
    // Handle error.
  }

  // Users deleted
});

deleteClient(params, cbopt) → {Promise|undefined}

Delete an Auth0 client.

Source:
Parameters:
Name Type Attributes Description
params Object

Client parameters.

Name Type Description
client_id String

Application client ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteClient({ client_id: CLIENT_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Client deleted.
});

deleteClientGrant(params, cbopt) → {Promise|undefined}

Delete an Auth0 client grant.

Source:
Parameters:
Name Type Attributes Description
params Object

Client parameters.

Name Type Description
id String

Client grant ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.clientGrants.delete({ id: GRANT_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Grant deleted.
});

deleteConnection(params, cbopt) → {Promise|undefined}

Delete an existing connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Connection parameters.

Name Type Description
id String

Connection ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteConnection({ id: CONNECTION_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Conection deleted.
});

deleteCustomDomain(params, cbopt) → {Promise|undefined}

Delete a Custom Domain.

Source:
Parameters:
Name Type Attributes Description
params Object

Custom Domain parameters.

Name Type Description
id String

Custom Domain ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteCustomDomain({ id: CUSTOM_DOMAIN_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // CustomDomain deleted.
});

deleteDeviceCredential(params, cbopt) → {Promise|undefined}

Delete an Auth0 device credential.

Source:
Parameters:
Name Type Attributes Description
params Object

Credential parameters.

Name Type Description
id String

Device credential ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: CREDENTIAL_ID };

management.deleteDeviceCredential(params, function (err) {
  if (err) {
    // Handle error.
  }

  // Credential deleted.
});

deleteEmailProvider(cbopt) → {Promise|undefined}

Delete email provider.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteEmailProvider(function (err) {
  if (err) {
    // Handle error.
  }

  // Email provider deleted.
});

deleteGuardianEnrollment(data, cbopt) → {Promise|undefined}

Delete a user's Guardian enrollment.

Source:
Parameters:
Name Type Attributes Description
data Object

The Guardian enrollment data object.

Name Type Description
id String

The Guardian enrollment id.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Email provider deleted.
});

deleteResourceServer(params, cbopt) → {Promise|undefined}

Delete an existing resource server.

Source:
Parameters:
Name Type Attributes Description
params Object

Resource Server parameters.

Name Type Description
id String

Resource Server ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteResourceServer({ id: RESOURCE_SERVER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Resource Server deleted.
});

deleteRole(params, cbopt) → {Promise|undefined}

Delete an existing role.

Source:
Parameters:
Name Type Attributes Description
params Object

Role parameters.

Name Type Description
id String

Role ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteRole({ id: ROLE_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Role deleted.
});

deleteRule(params, cbopt) → {Promise|undefined}

Delete an existing rule.

Source:
Parameters:
Name Type Attributes Description
params Object

Rule parameters.

Name Type Description
id String

Rule ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
auth0.deleteRule({ id: RULE_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Rule deleted.
});

deleteRulesConfig(params, cbopt) → {Promise|undefined}

Delete rules config.

Source:
Parameters:
Name Type Attributes Description
params Object

Rule Configs parameters.

Name Type Description
key String

Rule Configs key.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.deleteRulesConfig({ key: RULE_CONFIG_KEY }, function (err) {
  if (err) {
    // Handle error.
  }

  // Rules Config deleted.
});

deleteUser(params, cbopt) → {Promise|undefined}

Delete a user by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.deleteUser({ id: USER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // User deleted.
});

deleteUserMultifactor(params, cbopt) → {Promise|undefined}

Delete a multifactor provider for a user.

Source:
Parameters:
Name Type Attributes Description
params Object

Data object.

Name Type Description
id String

The user id.

provider String

Multifactor provider.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };

management.deleteUserMultifactor(params, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Users accounts unlinked.
});

deleteUserMultifcator(params, cbopt) → {Promise|undefined}

Delete a multifactor provider for a user.

Deprecated:
  • The function name has a typo. We're shipping this so it doesn't break compatibility. Use deleteUserMultifactor instead.
Source:
Parameters:
Name Type Attributes Description
params Object

Data object.

Name Type Description
id String

The user id.

provider String

Multifactor provider.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };

management.deleteUserMultifcator(params, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Users accounts unlinked.
});

exportUsers(data, cbopt) → {Promise|undefined}

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

Source:
Parameters:
Name Type Attributes Description
data Object

Users export data.

Name Type Attributes Description
connection_id String <optional>

The connection id of the connection from which users will be exported

format String <optional>

The format of the file. Valid values are: "json" and "csv".

limit Number <optional>

Limit the number of records.

fields Array.<Object> <optional>

A list of fields to be included in the CSV. If omitted, a set of predefined fields will be exported.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = {
  connection_id: 'con_0000000000000001',
  format: 'csv',
  limit: 5,
  fields: [
    {
      "name": "user_id"
    },
    {
      "name": "name"
    },
    {
      "name": "email"
    },
    {
      "name": "identities[0].connection",
      "export_as": "provider"
    },
    {
      "name": "user_metadata.some_field"
    }
  ]
}

management.exportUsers(data, function (err, results) {
  if (err) {
    // Handle error.
  }

  // Retrieved job.
  console.log(results);
});

getAccessToken() → {Promise}

Returns the access_token.

Source:
Returns:
Type:
Promise

Promise returning an access_token.

getActiveUsersCount(cbopt) → {Promise|undefined}

Get a the active users count.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getActiveUsersCount(function (err, usersCount) {
  if (err) {
    // Handle error.
  }

  console.log(usersCount);
});

getBlacklistedTokens(cbopt) → {Promise|undefined}

Get all blacklisted tokens.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getBlacklistedTokens(function (err, tokens) {
  console.log(tokens.length);
});

getClient(params, cbopt) → {Promise|undefined}

Get an Auth0 client.

Source:
Parameters:
Name Type Attributes Description
params Object

Client parameters.

Name Type Description
client_id String

Application client ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getClient({ client_id: CLIENT_ID }, function (err, client) {
  if (err) {
    // Handle error.
  }

  console.log(client);
});

getClientGrants(paramsopt, cbopt) → {Promise|undefined}

Get all Auth0 Client Grants.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Client Grants parameters.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getClientGrants(params, function (err, grants) {
  console.log(grants.length);
});

getClients(paramsopt, cbopt) → {Promise|undefined}

Get all Auth0 clients.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Clients parameters.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getClients(params, function (err, clients) {
  console.log(clients.length);
});

getConnection(params, cbopt) → {Promise|undefined}

Get an Auth0 connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Connection parameters.

Name Type Description
id String

Connection ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getConnection({ id: CONNECTION_ID }, function (err, connection) {
  if (err) {
    // Handle error.
  }

  console.log(connection);
});

getConnections(paramsopt, cbopt) → {Promise|undefined}

Get all connections.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Connections params.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getConnections(params, function (err, connections) {
  console.log(connections.length);
});

getCustomDomain(params, cbopt) → {Promise|undefined}

Get a Custom Domain.

Source:
Parameters:
Name Type Attributes Description
params Object

Custom Domain parameters.

Name Type Description
id String

Custom Domain ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getCustomDomain({ id: CUSTOM_DOMAIN_ID }, function (err, customDomain) {
  if (err) {
    // Handle error.
  }

  console.log(customDomain);
});

getCustomDomains() → {Promise|undefined}

Get all Auth0 CustomDomains.

Source:
Returns:
Type:
Promise | undefined
Example
management.getCustomDomains(function (err, customDomains) {
  console.log(customDomains.length);
});

getDailyStats(params, cbopt) → {Promise|undefined}

Get the daily stats.

Source:
Parameters:
Name Type Attributes Description
params Object

Stats parameters.

Name Type Description
from String

The first day in YYYYMMDD format.

to String

The last day in YYYYMMDD format.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  from: '{YYYYMMDD}',  // First day included in the stats.
  to: '{YYYYMMDD}'  // Last day included in the stats.
};

management.getDaily(params, function (err, stats) {
  if (err) {
    // Handle error.
  }

  console.log(stats);
});

getDeviceCredentials(cbopt) → {Promise|undefined}

Get all Auth0 credentials.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getDeviceCredentials(function (err, credentials) {
  console.log(credentials.length);
});

getEmailProvider(cbopt, paramsopt) → {Promise|undefined}

Get the email provider.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

params Object <optional>

Clients parameters.

Name Type Attributes Description
fields Number <optional>

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve: name, enabled, settings fields.

include_fields Number <optional>

true if the fields specified are to be excluded from the result, false otherwise (defaults to true)

Returns:
Type:
Promise | undefined
Example
management.getEmailProvider(function (err, provider) {
  console.log(provider.length);
});

getGrants(params, cbopt) → {Promise|undefined}

Get all Auth0 Grants.

Source:
Parameters:
Name Type Attributes Description
params Object

Grants parameters.

Name Type Description
per_page Number

Number of results per page.

page Number

Page number, zero indexed.

include_totals Boolean

true if a query summary must be included in the result, false otherwise. Default false;

user_id String

The user_id of the grants to retrieve.

client_id String

The client_id of the grants to retrieve.

audience String

The audience of the grants to retrieve.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  per_page: 10,
  page: 0,
  include_totals: true,
  user_id: USER_ID,
  client_id: CLIENT_ID,
  audience: AUDIENCE
};

management.getGrants(params, function (err, grants) {
  console.log(grants.length);
});

getGuardianEnrollment(data, cbopt) → {Promise|undefined}

Get a single Guardian enrollment.

Source:
Parameters:
Name Type Attributes Description
data Object

The Guardian enrollment data object.

Name Type Description
id String

The Guardian enrollment id.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollment) {
  console.log(enrollment);
});

getGuardianEnrollments(data, cbopt) → {Promise|undefined}

Get a list of a user's Guardian enrollments.

Source:
Parameters:
Name Type Attributes Description
data Object

The user data object.

Name Type Description
id String

The user id.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getGuardianEnrollments({ id: USER_ID }, function (err, enrollments) {
  console.log(enrollments);
});

getJob(params, cbopt) → {Promise|undefined}

Get a job by its ID.

Source:
Parameters:
Name Type Attributes Description
params Object

Job parameters.

Name Type Description
id String

Job ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  id: '{JOB_ID}'
};

management.getJob(params, function (err, job) {
  if (err) {
    // Handle error.
  }

  // Retrieved job.
  console.log(job);
});

getLog(params, cbopt) → {Promise|undefined}

Get an Auth0 log.

Source:
Parameters:
Name Type Attributes Description
params Object

Log parameters.

Name Type Description
id String

Event ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getLog({ id: EVENT_ID }, function (err, log) {
  if (err) {
    // Handle error.
  }

  console.log(log);
});

getLogs(paramsopt, cbopt) → {Promise|undefined}

Get all logs.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Logs params.

Name Type Attributes Description
q String <optional>

Search Criteria using Query String Syntax

page Number <optional>

Page number. Zero based

per_page Number <optional>

The amount of entries per page

sort String <optional>

The field to use for sorting.

fields String <optional>

A comma separated list of fields to include or exclude

include_fields Boolean <optional>

true if the fields specified are to be included in the result, false otherwise.

include_totals Boolean <optional>

true if a query summary must be included in the result, false otherwise. Default false

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings and the search query. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 2
};

management.getLogs(params, function (err, logs) {
  console.log(logs.length);
});

getPermissionsInRole(roleIdopt, cbopt) → {Promise|undefined}

Get permissions for a given role

Source:
Parameters:
Name Type Attributes Description
roleId String <optional>

Id of the role

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Examples
var params =  { id :'ROLE_ID'};

This method takes a roleId and returns all permissions within that role

management.getPermissionsInRole(params, function (err, permissions) {
  console.log(permissions);
});

getResourceServer(params, cbopt) → {Promise|undefined}

Get a Resource Server.

Source:
Parameters:
Name Type Attributes Description
params Object

Resource Server parameters.

Name Type Description
id String

Resource Server ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getResourceServer({ id: RESOURCE_SERVER_ID }, function (err, resourceServer) {
  if (err) {
    // Handle error.
  }

  console.log(resourceServer);
});

getResourceServers(paramsopt, cbopt) → {Promise|undefined}

Get all resource servers.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Resource Servers parameters.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getResourceServers(params, function (err, resourceServers) {
  console.log(resourceServers.length);
});

getRole(params, cbopt) → {Promise|undefined}

Get an Auth0 role.

Source:
Parameters:
Name Type Attributes Description
params Object

Role parameters.

Name Type Description
id String

Role ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getRole({ id: ROLE_ID }, function (err, role) {
  if (err) {
    // Handle error.
  }

  console.log(role);
});

getRoles(paramsopt, cbopt) → {Promise|undefined}

Get all roles.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Roles parameters.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getRoles(params, function (err, roles) {
  console.log(roles.length);
});

getRule(params, cbopt) → {Promise|undefined}

Get an Auth0 rule.

Source:
Parameters:
Name Type Attributes Description
params Object

Rule parameters.

Name Type Description
id String

Rule ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getRule({ id: RULE_ID }, function (err, rule) {
  if (err) {
    // Handle error.
  }

  console.log(rule);
});

getRules(paramsopt, cbopt) → {Promise|undefined}

Get all rules.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Rules parameters.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.getRules(params, function (err, rules) {
  console.log(rules.length);
});

getRulesConfigs() → {Promise|undefined}

Get rules config.

Source:
Returns:
Type:
Promise | undefined
Example
management.getRulesConfigs(function (err, rulesConfigs) {
  if (err) {
    // Handle error.
  }

  // Get Rules Configs.
});

getTenantSettings(cbopt) → {Promise|undefined}

Get the tenant settings..

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getSettings(function (err, settings) {
  if (err) {
    // Handle error.
  }

  console.log(settings);
});

getUser(data, cbopt) → {Promise|undefined}

Get a user by its id.

Source:
Parameters:
Name Type Attributes Description
data Object

The user data object.

Name Type Description
id String

The user id.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getUser({ id: USER_ID }, function (err, user) {
  console.log(user);
});

getUserBlocks(params, cbopt) → {Promise|undefined}

Get user blocks by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.getUserBlocks({ id: USER_ID }, function (err, blocks) {
  if (err) {
    // Handle error.
  }

  console.log(blocks);
});

getUserBlocksByIdentifier(params, cbopt) → {Promise|undefined}

Get user blocks by its identifier.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
identifier String

The user identifier, any of: username, phone_number, email.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.getUserBlocksByIdentifier({ identifier: USER_ID }, function (err, blocks) {
  if (err) {
    // Handle error.
  }

  console.log(blocks);
});

getUserLogs(params, cbopt) → {Promise|undefined}

Get user's log events.

Source:
Parameters:
Name Type Attributes Description
params Object

Get logs data.

Name Type Description
id String

User id.

per_page Number

Number of results per page.

page Number

Page number, zero indexed.

sort String

The field to use for sorting. Use field:order where order is 1 for ascending and -1 for descending. For example date:-1.

include_totals Boolean

true if a query summary must be included in the result, false otherwise. Default false;

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, page: 0, per_page: 50, sort: 'date:-1', include_totals: true };

management.getUserLogs(params, function (err, logs) {
  if (err) {
    // Handle error.
  }

  console.log(logs);
});

getUserPermissions(params, cbopt) → {Promise|undefined}

Get user's permissions

Source:
Parameters:
Name Type Attributes Description
params Object

Get permissions data.

Name Type Description
id String

User id.

per_page Number

Number of results per page.

page Number

Page number, zero indexed.

sort String

The field to use for sorting. Use field:order where order is 1 for ascending and -1 for descending. For example date:-1.

include_totals Boolean

true if a query summary must be included in the result, false otherwise. Default false;

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, page: 0, per_page: 50, sort: 'date:-1', include_totals: true };

management.getUserPermissions(params, function (err, logs) {
  if (err) {
    // Handle error.
  }

  console.log(logs);
});

getUserRoles(params, cbopt) → {Promise|undefined}

Get user's roles

Source:
Parameters:
Name Type Attributes Description
params Object

Get roles data.

Name Type Description
id String

User id.

per_page Number

Number of results per page.

page Number

Page number, zero indexed.

sort String

The field to use for sorting. Use field:order where order is 1 for ascending and -1 for descending. For example date:-1.

include_totals Boolean

true if a query summary must be included in the result, false otherwise. Default false;

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, page: 0, per_page: 50, sort: 'date:-1', include_totals: true };

management.getUserRoles(params, function (err, logs) {
  if (err) {
    // Handle error.
  }

  console.log(logs);
});

getUsers(paramsopt, cbopt) → {Promise|undefined}

Get all users.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Users params.

Name Type Attributes Description
search_engine Number <optional>

The version of the search engine to use.

per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  search_engine: 'v3',
  per_page: 10,
  page: 0
};

auth0.getUsers(params, function (err, users) {
  console.log(users.length);
});

getUsersByEmail(emailopt, cbopt) → {Promise|undefined}

Get users for a given email address

Source:
Parameters:
Name Type Attributes Description
email String <optional>

Email Address of users to locate

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an email address as the first argument, and returns all users with that email address

auth0.getUsersByEmail(email, function (err, users) {
  console.log(users);
});

getUsersInRole(roleIdopt, cbopt) → {Promise|undefined}

Get users in a given role

Source:
Parameters:
Name Type Attributes Description
roleId String <optional>

Id of the role

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Examples
var params =  { id :'ROLE_ID'};

This method takes a roleId and returns all users within that role

management.getUsersInRole(params, function (err, users) {
  console.log(users);
});

importUsers(data, cbopt) → {Promise|undefined}

Given a path to a file and a connection id, create a new job that imports the users contained in the file and associate them with the given connection.

Source:
Parameters:
Name Type Attributes Description
data Object

Users import data.

Name Type Description
connectionId String

Connection for the users insertion.

users String

Path to the users data file.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  connection_id: '{CONNECTION_ID}',
  users: '{PATH_TO_USERS_FILE}'
};

management.get(params, function (err) {
  if (err) {
    // Handle error.
  }
});

linkUsers(userId, params, cbopt) → {Promise|undefined}

Link the user with another account.

Source:
Parameters:
Name Type Attributes Description
userId String

ID of the primary user.

params Object

Secondary user data.

Name Type Description
user_id String

ID of the user to be linked.

connection_id String

ID of the connection to be used.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var userId = 'USER_ID';
var params = {
  user_id: 'OTHER_USER_ID',
  connection_id: 'CONNECTION_ID'
};

management.linkUsers(userId, params, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Users linked.
});

regenerateRecoveryCode(data, cbopt) → {Promise|undefined}

Generate new Guardian recovery code.

Source:
Parameters:
Name Type Attributes Description
data Object

The user data object.

Name Type Description
id String

The user id.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.regenerateRecoveryCode({ id: USER_ID }, function (err, newRecoveryCode) {
  console.log(newRecoveryCode);
});

removePermissionsFromRole(data, cbopt) → {Promise|undefined}

Remove permissions from a role

Source:
Parameters:
Name Type Attributes Description
params.id String

ID of the Role.

data Object

permissions data

Name Type Description
permissions String

Array of permissions

Name Type Description
permission_name String

Name of a permission

resource_server_identifier String

Identifier for a resource

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id :'ROLE_ID'};
var data = { "permissions" : [{"permission_name" :"do:something" ,"resource_server_identifier" :"test123" }]};

management.removePermissionsFromRole(params, data, function (err, permissions) {
  console.log(permissions);
});

removePermissionsFromUser(params, data, cbopt) → {Promise|undefined}

Remove permissions from a user

Source:
Parameters:
Name Type Attributes Description
params Object

params object

Name Type Description
id String

user_id

data String

data object containing list of permission IDs

Name Type Description
permissions String

Array of permission IDs

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var parms =  { id : 'USER_ID'};
var data = { "permissions" : [{"permission_name" :"do:something" ,"resource_server_identifier" :"test123" }]};

management.removePermissionsFromUser(params, data, function (err) {
  if (err) {
    // Handle error.
  }

  // User assigned permissions.
});

removeRolesFromUser(params, data, cbopt) → {Promise|undefined}

Remove roles from a user

Source:
Parameters:
Name Type Attributes Description
params Object

params object

Name Type Description
id String

user_id

data String

data object containing list of role IDs

Name Type Description
roles String

Array of role IDs

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var parms =  { id : 'USER_ID'};
var data = { "roles" :["role1"]};

management.removeRolesFromUser(params, data, function (err) {
  if (err) {
    // Handle error.
  }

  // User assigned roles.
});

sendEmailVerification(data, cbopt) → {Promise|undefined}

Send a verification email to a user.

Source:
Parameters:
Name Type Attributes Description
data Object

User data object.

Name Type Description
user_id String

ID of the user to be verified.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
	user_id: '{USER_ID}'
};

management.sendEmailVerification(params, function (err) {
  if (err) {
    // Handle error.
  }
});

setRulesConfig(params, data, cbopt) → {Promise|undefined}

Set a new rules config.

Source:
Parameters:
Name Type Attributes Description
params Object

Rule Config parameters.

Name Type Description
key String

Rule Config key.

data Object

Rule Config Data parameters.

Name Type Description
value String

Rule Config Data value.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { key: RULE_CONFIG_KEY };
var data =   { value: RULES_CONFIG_VALUE };

management.setRulesConfig(params, data, function (err, rulesConfig) {
  if (err) {
    // Handle error.
  }

  // Rules Config set.
});

unblockUser(params, cbopt) → {Promise|undefined}

Unblock an user by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
identifier String

The user identifier, any of: username, phone_number, email.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.unblockUserByIdentifier({ identifier: USER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // User unblocked.
});

unblockUser(params, cbopt) → {Promise|undefined}

Unblock an user by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.unblockUser({ id: USER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // User unblocked.
});

unlinkUsers(params, cbopt) → {Promise|undefined}

Unlink the given accounts.

Source:
Parameters:
Name Type Attributes Description
params Object

Linked users data.

Name Type Description
id String

Primary user ID.

provider String

Identity provider in use.

user_id String

Secondary user ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID, provider: 'auht0', user_id: OTHER_USER_ID };

management.unlinkUsers(params, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Users accounts unlinked.
});

updateAppMetadata(params, metadata, cbopt) → {Promise|undefined}

Update the app metadata for a user.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

metadata Object

New app metadata.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID };
var metadata = {
  foo: 'bar'
};

management.updateAppMetadata(params, metadata, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Updated user.
  console.log(user);
});

updateClient(params, data, cbopt) → {Promise|undefined}

Update an Auth0 client.

Source:
Parameters:
Name Type Attributes Description
params Object

Client parameters.

Name Type Description
client_id String

Application client ID.

data Object

Updated client data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = { name: 'newClientName' };
var params = { client_id: CLIENT_ID };

management.updateClient(params, data, function (err, client) {
  if (err) {
    // Handle error.
  }

  console.log(client.name);  // 'newClientName'
});

updateClientGrant(params, data, cbopt) → {Promise|undefined}

Update an Auth0 client grant.

Source:
Parameters:
Name Type Attributes Description
params Object

Client parameters.

Name Type Description
id String

Client grant ID.

data Object

Updated client data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = {
  client_id: CLIENT_ID,
  audience: AUDIENCE,
  scope: []
};
var params = { id: CLIENT_GRANT_ID };

management.clientGrants.update(params, data, function (err, grant) {
  if (err) {
    // Handle error.
  }

  console.log(grant.id);
});

updateConnection(params, data, cbopt) → {Promise|undefined}

Update an existing connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Connection parameters.

Name Type Description
id String

Connection ID.

data Object

Updated connection data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = { name: 'newConnectionName' };
var params = { id: CONNECTION_ID };

management.updateConnection(params, data, function (err, connection) {
  if (err) {
    // Handle error.
  }

  console.log(connection.name);  // 'newConnectionName'
});

updateEmailProvider(params, data, cbopt) → {Promise|undefined}

Update the email provider.

Source:
Parameters:
Name Type Attributes Description
params Object

Email provider parameters.

data Object

Updated email provider data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.updateEmailProvider(params, data, function (err, provider) {
  if (err) {
    // Handle error.
  }

  // Updated email provider.
  console.log(provider);
});

updateResourceServer(params, data, cbopt) → {Promise|undefined}

Update an existing resource server.

Source:
Parameters:
Name Type Attributes Description
params Object

Resource Server parameters.

Name Type Description
id String

Resource Server ID.

data Object

Updated Resource Server data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = { name: 'newResourceServerName' };
var params = { id: RESOURCE_SERVER_ID };

management.updateResourceServer(params, data, function (err, resourceServer) {
  if (err) {
    // Handle error.
  }

  console.log(resourceServer.name);  // 'newResourceServerName'
});

updateRole(params, data, cbopt) → {Promise|undefined}

Update an existing role.

Source:
Parameters:
Name Type Attributes Description
params Object

Role parameters.

Name Type Description
id String

Role ID.

data Object

Updated role data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: ROLE_ID };
var data = { name: 'my-role'};
management.updateRole(params, data, function (err, role) {
  if (err) {
    // Handle error.
  }

  console.log(role.name); // 'my-role'.
});

updateRule(params, data, cbopt) → {Promise|undefined}

Update an existing rule.

Source:
Parameters:
Name Type Attributes Description
params Object

Rule parameters.

Name Type Description
id String

Rule ID.

data Object

Updated rule data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = { id: RULE_ID };
var data = { name: 'my-rule'};
management.updateRule(params, data, function (err, rule) {
  if (err) {
    // Handle error.
  }

  console.log(rule.name); // 'my-rule'.
});

updateTenantSettings(data, cbopt) → {Promise|undefined}

Update the tenant settings.

Source:
Parameters:
Name Type Attributes Description
data Object

The new tenant settings.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.updateTenantSettings(data, function (err) {
  if (err) {
    // Handle error.
  }
});

updateUser(params, data, cbopt) → {Promise|undefined}

Update a user by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user parameters.

Name Type Description
id String

The user id.

data Object

New user data.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID };

management.updateUser(params, data, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Updated user.
  console.log(user);
});

updateUserMetadata(params, metadata, cbopt) → {Promise|undefined}

Update the user metadata for a user.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

metadata Object

New user metadata.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
var params = { id: USER_ID };
var metadata = {
  address: '123th Node.js Street'
};

management.updateUserMetadata(params, metadata, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Updated user.
  console.log(user);
});

verifyCustomDomain(params, cbopt) → {Promise|undefined}

Verify a Custom Domain.

Source:
Parameters:
Name Type Attributes Description
params Object

Custom Domain parameters.

Name Type Description
id String

Custom Domain ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.verifyCustomDomain({ id: CUSTOM_DOMAIN_ID }, function (err, customDomain) {
  if (err) {
    // Handle error.
  }

  console.log(customDomain);
});