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

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

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

rules :RulesManager

Simple abstraction for performing CRUD operations on the rules endpoint.

Source:
Type:
  • RulesManager

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

users :UsersManager

Simple abstraction for performing CRUD operations on the users endpoint.

Source:
Type:
  • UsersManager

Methods

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

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

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

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}',  // Optional.
  email: '{USER_EMAIL}',  // Optional.
  new_password: '{PASSWORD}'
};

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

createRules(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.

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

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

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

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

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

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.deleteUserMultifcator(params, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Users accounts unlinked.
});

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);
});

getClientInfo() → {Object}

Return an object with information about the current client,

Source:
Returns:
Type:
Object

Object containing client information.

getClients(cbopt) → {Promise|undefined}

Get all Auth0 clients.

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

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getClients(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(data, cbopt) → {Promise|undefined}

Get all connections.

Source:
Parameters:
Name Type Attributes Description
data Object

Connection data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getConnections(function (err, connections) {
  console.log(connections.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) → {Promise|undefined}

Get the email provider.

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

Callback function.

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

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(data, cbopt) → {Promise|undefined}

Get all logs.

Source:
Parameters:
Name Type Attributes Description
data Object

Log data object.

cb function <optional>

Callback function.

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

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(data, cbopt) → {Promise|undefined}

Get all resource servers.

Source:
Parameters:
Name Type Attributes Description
data Object

Connection data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.getResourceServers(function (err, resourceServers) {
  console.log(resourceServers.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(cbopt) → {Promise|undefined}

Get all rules.

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

Callback function.

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

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);
});

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 logs per page.

page Number

Page number.

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);
});

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

Get all users.

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

Users params.

Name Type Attributes Description
per_page Number <optional>

Number of users per page.

page Number <optional>

Page number.

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.

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

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);
});

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 params = { id: USER_ID };
var data = {
  user_id: 'OTHER_USER_ID',
  connection_id: 'CONNECTION_ID'
};

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

  // Users linked.
});

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(function (err) {
  if (err) {
    // Handle error.
  }
});

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'
});

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

Update an existing connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Conneciton 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'
});

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);
});