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 and clientSecret (or clientAssertionSigningKey) are required.
|
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
}
});
Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant, providing a Private Key using the private_key_jwt token endpoint auth method.
var ManagementClient = require('auth0').ManagementClient;
var auth0 = new ManagementClient({
domain: '{YOUR_ACCOUNT}.auth0.com',
clientId: '{YOUR_NON_INTERACTIVE_CLIENT_ID}',
clientAssertionSigningKey: fs.readFileSync('private-key.pem'),
scope: "read:users write:users"
});
Members
actions :ActionsManager
Simple abstraction for performing CRUD operations on the actions endpoint.
- Source:
Type:
blacklistedTokens :BlacklistedTokensManager
Simple abstraction for performing CRUD operations on the blacklisted tokens endpoint.
- Source:
Type:
branding :BrandingManager
Simple abstraction for performing CRUD operations on the branding endpoint.
- Source:
Type:
clientCredentials :module:management.ClientCredentialsManager
Simple abstraction for performing CRUD operations on the client credentials endpoint.
- Source:
Type:
-
module:management.ClientCredentialsManager
clientGrants :ClientGrantsManager
Simple abstraction for performing CRUD operations on the client grants endpoint.
- Source:
Type:
clients :ClientsManager
Simple abstraction for performing CRUD operations on the clients endpoint.
- Source:
Type:
connections :ConnectionsManager
Simple abstraction for performing CRUD operations on the connections endpoint.
- Source:
Type:
customDomains :CustomDomainsManager
Simple abstraction for performing CRUD operations on the custom domains endpoint.
- Source:
Type:
deviceCredentials :DeviceCredentialsManager
Simple abstraction for performing CRUD operations on the device credentials endpoint.
- Source:
Type:
emailProvider :EmailProviderManager
Simple abstraction for performing CRUD operations on the email provider endpoint.
- Source:
Type:
emailTemplates :EmailTemplatesManager
Simple abstraction for performing CRUD operations on Auth0's Email Templates
- Source:
Type:
grants :GrantsManager
Simple abstraction for performing CRUD operations on the grants endpoint.
- Source:
Type:
guardian :GuardianManager
Simple abstraction for performing CRUD operations on the guardian endpoint.
- Source:
Type:
hooks :HooksManager
Simple abstraction for performing CRUD operations on the hooks endpoint.
- Source:
Type:
resourceServers :ResourceServersManager
Simple abstraction for performing CRUD operations on the resource servers endpoint.
- Source:
Type:
roles :RolesManager
Simple abstraction for performing CRUD operations on the roles endpoint.
- Source:
Type:
rules :RulesManager
Simple abstraction for performing CRUD operations on the rules endpoint.
- Source:
Type:
userBlocks :UserBlocksManager
Simple abstraction for performing CRUD operations on the user-blocks endpoint.
- Source:
Type:
users :UsersManager
Simple abstraction for performing CRUD operations on the users endpoint.
- Source:
Type:
Methods
addHookSecrets(params, data, cbopt) → {Promise|undefined}
Add hook screts.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
data |
object
|
Secrets key/value pairs |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: 'HOOK_ID' }
var data = { DB_PASSWORD: 'password1', API_TOKEN: 'secret' }
management.addHookScrets(params, data, function (err, secrets) {
if (err) {
// Handle error.
}
// Hook secrets created.
});
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
|
||||||||||||||||
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}
Assign permissions to a user
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
params object
|
|||||||
data |
string
|
data object containing list of permissions
|
|||||||
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}
Assign roles to a user
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
params object
|
|||||||
data |
object
|
data object containing list 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.
});
assignUsersToRole(data, cbopt) → {Promise|undefined}
Assign users to a role
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params.id |
string
|
ID of the Role. |
||||||||||||||||
data |
object
|
permissions data
|
||||||||||||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id :'ROLE_ID'};
var data = { "users" : ["userId1","userId2"]};
management.roles.assignUsers(params, data, function (err, user) {
if (err) {
// Handle error.
}
// permissions added.
});
blacklistToken(token, cbopt) → {Promise|undefined}
Blacklist a new token.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
token |
object
|
Token data.
|
||||||||||
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.
}
// Connection 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.
});
createEmailTemplate(data, cbopt) → {Promise|undefined}
Create a new Email Template.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
object
|
Email Template data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.createEmailTemplate(data, function (err) {
if (err) {
// Handle error.
// Email Template 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);
});
createHook(data, cbopt) → {Promise|undefined}
Create a new hook.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
object
|
Hook data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.createHook(data, function (err) {
if (err) {
// Handle error.
}
// Hook created.
});
createLogStream(data, cbopt) → {Promise|undefined}
Create a new Log Stream.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
object
|
Log Stream data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.createLogStream(data, function (err) {
if (err) {
// Handle error.
}
// Log Stream created.
});
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
});
deleteBrandingUniversalLoginTemplate(params, data, cbopt) → {Promise|undefined}
Delete the new universal login template.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Branding parameters (leave empty). |
|
data |
object
|
Branding data (leave empty). |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deleteBrandingUniversalLoginTemplate(template, function (err) {
if (err) {
// Handle error.
}
});
deleteClient(params, cbopt) → {Promise|undefined}
Delete an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Client parameters.
|
|||||||
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.
|
|||||||
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.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deleteConnection({ id: CONNECTION_ID }, function (err) {
if (err) {
// Handle error.
}
// Connection deleted.
});
deleteCustomDomain(params, cbopt) → {Promise|undefined}
Delete a Custom Domain.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Custom Domain parameters.
|
|||||||
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.
|
|||||||
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.
});
deleteGrant(params, cbopt) → {Promise|undefined}
Delete an Auth0 grant.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Grant parameters.
|
||||||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = {
id: GRANT_ID,
user_id: USER_ID
};
management.deleteGrant(params, function (err) {
if (err) {
// Handle error.
}
// Grant 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.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err) {
if (err) {
// Handle error.
}
// Email provider deleted.
});
deleteHook(params, cbopt) → {Promise|undefined}
Delete an existing hook.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
auth0.deleteHook({ id: HOOK_ID }, function (err) {
if (err) {
// Handle error.
}
// Hook deleted.
});
deleteLogStream(params, cbopt) → {Promise|undefined}
Delete an existing Log Stream.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Log Stream parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deleteLogStream({ id: LOG_STREAM_ID }, function (err) {
if (err) {
// Handle error.
}
// Log Stream deleted.
});
deleteResourceServer(params, cbopt) → {Promise|undefined}
Delete an existing resource server.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Resource Server parameters.
|
|||||||
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.
|
|||||||
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.
|
|||||||
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.
|
|||||||
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..
|
|||||||
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.
|
||||||||||
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.
- The function name has a typo.
We're shipping this so it doesn't break compatibility.
Use
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Data object.
|
||||||||||
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.
|
|||||||||||||||||||||
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);
});
getBrandingSettings(params, data, cbopt) → {Promise|undefined}
Get the branding settings..
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Branding parameters. |
|
data |
object
|
Branding data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getBrandingSettings(data, function (err, branding) {
if (err) {
// Handle error.
}
// Branding
console.log(branding);
});
getBrandingUniversalLoginTemplate(params, data, cbopt) → {Promise|undefined}
Get the new universal login template.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Branding parameters (leave empty). |
|
data |
object
|
Branding data (leave empty). |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getBrandingUniversalLoginTemplate(data, function (err, template) {
if (err) {
// Handle error.
}
// Branding
console.log(template);
});
getClient(params, cbopt) → {Promise|undefined}
Get an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Client parameters.
|
|||||||||||||
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.
|
||||||||||||
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.
|
||||||||||||
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.
|
|||||||
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.
|
||||||||||||
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.
|
|||||||
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);
});
getCustomTextByLanguage(params, cbopt) → {Promise|undefined}
Retrieve custom text for a specific prompt and language.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Data object.
|
||||||||||
cb |
function
|
<optional> |
Callback function |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { prompt: PROMPT_NAME, language: LANGUAGE };
management.prompts.getCustomTextByLanguage(params, function (err, customText) {
console.log('CustomText', customText);
});
getDailyStats(params, cbopt) → {Promise|undefined}
Get the daily stats.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Stats parameters.
|
||||||||||
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(params, cbopt) → {Promise|undefined}
Get all Auth0 credentials.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Credential parameters. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = {user_id: "USER_ID"};
management.getDeviceCredentials(params, 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.
|
Returns:
- Type:
-
Promise
|undefined
Example
management.getEmailProvider(function (err, provider) {
console.log(provider.length);
});
getEmailTemplate(params, cbopt) → {Promise|undefined}
Get an Auth0 Email Template.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Email Template parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getEmailTemplate({ name: EMAIL_TEMPLATE_NAME }, function (err, emailTemplate) {
if (err) {
// Handle error.
}
console.log(emailTemplate);
});
getGrants(params, cbopt) → {Promise|undefined}
Get all Auth0 Grants.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Grants parameters.
|
||||||||||||||||||||||
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.
|
|||||||
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.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianEnrollments({ id: USER_ID }, function (err, enrollments) {
console.log(enrollments);
});
getGuardianFactorProvider(params, cbopt) → {Promise|undefined}
Get Guardian factor provider configuration
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor provider parameters. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getFactorProvider({ name: 'sms', provider: 'twilio'}, function (err, provider) {
console.log(provider);
});
getGuardianFactors(cbopt) → {Promise|undefined}
Get a list of Guardian factors and statuses.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianFactors(function (err, factors) {
console.log(factors.length);
});
getGuardianFactorSettings(params, cbopt) → {Promise|undefined}
Get the settings of a Guardian factor.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor parameters. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianFactorSettings({ name: 'duo' }, function (err, settings) {
console.log(settings);
});
getGuardianFactorTemplates(params, cbopt) → {Promise|undefined}
Get Guardian enrollment and verification factor templates
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor parameters. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianFactorTemplates({ name: 'sms' }, function (err, templates) {
console.log(templates);
});
getGuardianPhoneFactorMessageTypes(cbopt) → {Promise|undefined}
Get the Guardian phone factor's message types
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianPhoneFactorMessageTypes(function (err, messageTypes) {
console.log(messageTypes);
});
getGuardianPhoneFactorSelectedProvider(cbopt) → {Promise|undefined}
Get the Guardian phone factor's selected provider
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianPhoneFactorSelectedProvider(function (err, selectedProvider) {
console.log(selectedProvider);
});
getGuardianPolicies(cbopt) → {Promise|undefined}
Get enabled Guardian policies
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getGuardianPolicies(function (err, policies) {
console.log(policies);
});
getHook(params, cbopt) → {Promise|undefined}
Get an Auth0 hook.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getHook({ id: HOOK_ID }, function (err, hook) {
if (err) {
// Handle error.
}
console.log(hook);
});
getHooks(paramsopt, cbopt) → {Promise|undefined}
Get all hooks.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
<optional> |
Hooks parameters.
|
||||||||||||
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.getHooks(params, function (err, hooks) {
console.log(hooks.length);
});
getHookSecrets(params, cbopt) → {Promise|undefined}
Get an Auth0 hook's secrets.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: HOOK_ID }
management.getHookSecrets(params, function (err, secrets) {
if (err) {
// Handle error.
}
console.log(secrets);
});
getJob(params, cbopt) → {Promise|undefined}
Get a job by its ID.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Job parameters.
|
|||||||
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);
});
getJobErrors(params, cbopt) → {Promise|undefined}
Given a job ID, retrieve the failed/errored items
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Job parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = {
id: '{JOB_ID}'
};
management.jobs.errors(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.
|
|||||||
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.
|
||||||||||||||||||||||||||||||||
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);
});
getLogStream(params, cbopt) → {Promise|undefined}
Get an Auth0 Log Stream.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Log Stream parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getLogStream({ id: LOG_STREAM_ID }, function (err, logStream) {
if (err) {
// Handle error.
}
console.log(logStream);
});
getLogStreams(cbopt) → {Promise|undefined}
Get all Log Streams.
management.getLogStreams( function (err, logStreams) { console.log(logStreams.length); });
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
getMigrations(cbopt) → {Promise|undefined}
Get migrations flags
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getMigrations(function (err, migrations) {
if (err) {
// Handle error.
}
// Migration flags
console.log(migrations.flags);
});
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);
});
getPromptsSettings(cbopt) → {Promise|undefined}
Get prompts settings..
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.getPromptsSettings(function (err, settings) {
console.log(settings);
});
getResourceServer(params, cbopt) → {Promise|undefined}
Get a Resource Server.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Resource Server parameters.
|
|||||||
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.
|
||||||||||||
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.
|
|||||||
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.
|
||||||||||||
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.
|
|||||||
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.
|
||||||||||||
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(cbopt) → {Promise|undefined}
Get rules config.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
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.
|
|||||||
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..
|
|||||||
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..
|
|||||||
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.
|
|||||||||||||||||||
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.
|
|||||||||||||||||||
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.
|
|||||||||||||||||||
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.
|
||||||||||||||||||||
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',
q: 'name:*jane*',
per_page: 10,
page: 0
};
auth0.getUsers(params, function (err, users) {
console.log(users.length);
});
getUsersByEmail(emailopt, optionsopt, cbopt) → {Promise|undefined}
Get users for a given email address
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
email |
string
|
<optional> |
Email address of user(s) to find |
||||||||||||
options |
object
|
<optional> |
Additional options to pass to the endpoint
|
||||||||||||
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(idopt, cbopt) → {Promise|undefined}
Get users in a given role
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string
|
<optional> |
Id of the role |
params.per_page |
number
|
<optional> |
Number of results per page. |
params.page |
number
|
<optional> |
Page number, zero indexed. |
params.from |
string
|
<optional> |
Optional id from which to start selection. |
params.take |
number
|
<optional> |
The total amount of entries to retrieve when using the from parameter. Defaults to 50. |
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Examples
var params = {
id: 'ROLE_ID',
per_page: 50,
page: 0
};
This method takes a roleId and returns all users within that role. Supports offset (page, per_page) and checkpoint pagination (from, take). You must use checkpoint pagination to retrieve beyond the first 1000 records.
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 or JSON string and associate them with the given connection.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object
|
Users import data.
|
|||||||||||||||||||||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = {
connection_id: '{CONNECTION_ID}',
users: '{PATH_TO_USERS_FILE}' // or users_json: '{USERS_JSON_STRING}'
};
management.importUsers(params, function (err) {
if (err) {
// Handle error.
}
});
importUsersJob(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 or JSON string and associate them with the given connection.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object
|
Users import data.
|
|||||||||||||||||||||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = {
connection_id: '{CONNECTION_ID}',
users: '{PATH_TO_USERS_FILE}' // or users_json: '{USERS_JSON_STRING}'
};
management.importUsersJob(params, function (err) {
if (err) {
// Handle error.
}
});
invalidateRememberBrowser(data, cbopt) → {Promise|undefined}
Invalidate all remembered browsers for MFA.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
data |
object
|
The user data object.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.invalidateRememberBrowser({ id: USER_ID }, function (err) {
if (err) {
// Handle error.
}
// Invalidated all remembered browsers.
});
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.
|
||||||||||||||||
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.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.regenerateRecoveryCode({ id: USER_ID }, function (err, newRecoveryCode) {
console.log(newRecoveryCode);
});
removeHookSecrets(params, data, cbopt) → {Promise|undefined}
Delete an existing hook.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
data |
object
|
Secrets key/value pairs |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: HOOK_ID }
var data = ['API_TOKEN', 'DB_PASSWORD']
auth0.removeHookSecrets(params, data, function (err) {
if (err) {
// Handle error.
}
// Hook deleted.
});
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
|
||||||||||||||||
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
|
|||||||
data |
string
|
data object containing list 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
|
|||||||
data |
string
|
data object containing list 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.
|
||||||||||||||||||||||||||||||
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.
}
});
setBrandingUniversalLoginTemplate(params, template, cbopt) → {Promise|undefined}
Set the new universal login template.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Branding parameters (leave empty). |
|
template |
object
|
Branding data (object with template field). |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.setBrandingUniversalLoginTemplate({}, { template: "a template" }, function (err, template) {
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.
|
|||||||
data |
object
|
Rule Config Data parameters.
|
|||||||
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..
|
|||||||
cb |
function
|
<optional> |
Callback function |
Returns:
- Type:
-
Promise
|undefined
Example
management.unblockUser({ id: USER_ID }, function (err) {
if (err) {
// Handle error.
}
// User unblocked.
});
unblockUserByIdentifier(params, cbopt) → {Promise|undefined}
Unblock an user by its id.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
The user data object..
|
|||||||
cb |
function
|
<optional> |
Callback function |
Returns:
- Type:
-
Promise
|undefined
Example
management.unblockUserByIdentifier({ identifier: 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.
|
|||||||||||||
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..
|
|||||||
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);
});
updateBrandingSettings(params, data, cbopt) → {Promise|undefined}
Update the branding settings.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Branding parameters. |
|
data |
object
|
Updated branding data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateBrandingSettings(data, function (err, branding) {
if (err) {
// Handle error.
}
// Updated branding
console.log(branding);
});
updateClient(params, data, cbopt) → {Promise|undefined}
Update an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Client parameters.
|
|||||||
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.
|
|||||||
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.
|
|||||||
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'
});
updateCustomTextByLanguage(params, cbopt) → {Promise|undefined}
Set custom text for a specific prompt.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
Data object.
|
|||||||||||||
cb |
function
|
<optional> |
Callback function |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { prompt: PROMPT_NAME, language: LANGUAGE, body: BODY_OBJECT };
management.prompts.updateCustomTextByLanguage(params, function (err, customText) {
console.log('CustomText', customText);
});
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);
});
updateEmailTemplate(params, data, cbopt) → {Promise|undefined}
Update an existing Email Template.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Email Template parameters.
|
|||||||
data |
object
|
Updated Email Template data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = { from: 'new@email.com' };
var params = { name: EMAIL_TEMPLATE_NAME };
management.updateEmailTemplates(params, data, function (err, emailTemplate) {
if (err) {
// Handle error.
}
console.log(emailTemplate.from); // 'new@email.com'
});
updateGuardianFactor(params, data, cbopt) → {Promise|undefined}
Update Guardian Factor
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor parameters. |
|
data |
object
|
Updated factor data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianFactor({ name: 'sms' }, {
enabled: true
}, function (err, factor) {
console.log(factor);
});
updateGuardianFactorProvider(params, data, cbopt) → {Promise|undefined}
Update Guardian's factor provider
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor provider parameters. |
|
data |
object
|
Updated Factor provider data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianFactorProvider({ name: 'sms', provider: 'twilio' }, {
messaging_service_sid: 'XXXXXXXXXXXXXX',
auth_token: 'XXXXXXXXXXXXXX',
sid: 'XXXXXXXXXXXXXX'
}, function (err, provider) {
console.log(provider);
});
updateGuardianFactorSettings(params, data, cbopt) → {Promise|undefined}
Update a Guardian's factor settings
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor parameters. |
|
data |
object
|
Updated Factor settings data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianFactorSettings(
{ name: 'webauthn-roaming' },
{ userVerification: 'discouraged', overrideRelyingParty: false },
function (err, settings) {
console.log(settings);
})
updateGuardianFactorTemplates(params, data, cbopt) → {Promise|undefined}
Update Guardian enrollment and verification factor templates
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Factor parameters. |
|
data |
object
|
Updated factor templates data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianFactorTemplates({ name: 'sms' }, {
enrollment_message: "{{code}} is your verification code for {{tenant.friendly_name}}. Please enter this code to verify your enrollment.",
verification_message: "{{code}} is your verification code for {{tenant.friendly_name}}"
}, function (err, templates) {
console.log(templates);
});
updateGuardianPhoneFactorMessageTypes(params, data, cbopt) → {Promise|undefined}
Update the Guardian phone factor's message types
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Parameters. |
|||||||
data |
object
|
Updated selected provider data.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianPhoneFactorMessageTypes({}, {
message_types: ['sms', 'voice']
}, function (err, factor) {
console.log(factor);
});
updateGuardianPhoneFactorSelectedProvider(params, data, cbopt) → {Promise|undefined}
Update the Guardian phone factor's selected provider
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Parameters. |
|||||||
data |
object
|
Updated selected provider data.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianPhoneFactorSelectedProvider({}, {
provider: 'twilio'
}, function (err, factor) {
console.log(factor);
});
updateGuardianPolicies(params, data, cbopt) → {Promise|undefined}
Update enabled Guardian policies
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
object
|
Parameters. |
|
data |
Array.<string>
|
Policies to enable. Empty array disables all policies. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updateGuardianPolicies({}, [
'all-applications'
], function (err, policies) {
console.log(policies);
});
updateHook(params, data, cbopt) → {Promise|undefined}
Update an existing hook.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
data |
object
|
Updated hook data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: HOOK_ID };
var data = { name: 'my-hook'};
management.updateHook(params, data, function (err, hook) {
if (err) {
// Handle error.
}
console.log(hook.name); // 'my-hook'.
});
updateHookSecrets(params, data, cbopt) → {Promise|undefined}
Update an existing hook.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Hook parameters.
|
|||||||
data |
object
|
Secrets key/value pairs |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: HOOK_ID };
var data = { API_TOKEN: 'updated-secret'};
management.updateHookSecrets(params, data, function (err, secrets) {
if (err) {
// Handle error.
}
console.log(secrets)
});
updateLogStream(params, data, cbopt) → {Promise|undefined}
Update an existing Log Stream.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Rule parameters.
|
|||||||
data |
object
|
Updated rule data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: LOG_STREAM_ID };
var data = { name: 'my-log-stream'};
management.updateLogStream(params, data, function (err, logStream) {
if (err) {
// Handle error.
}
console.log(logStream.name); // 'my-log-stream'.
});
updateMigrations(data, cbopt) → {Promise|undefined}
Update the tenant migrations.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
object
|
Updated migrations data. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
data = { flags: { migration: true } };
management.updateMigrations(data, function (err, migrations) {
if (err) {
// Handle error.
}
// Updated migrations flags
console.log(migrations.flags);
});
updatePromptsSettings(data, cbopt) → {Promise|undefined}
Update prompts settings.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
object
|
The new prompts settings. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.updatePromptsSettings(data, function (err) {
if (err) {
// Handle error.
}
});
updateResourceServer(params, data, cbopt) → {Promise|undefined}
Update an existing resource server.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object
|
Resource Server parameters.
|
|||||||
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.
|
|||||||
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.
|
|||||||
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.
|
|||||||
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..
|
|||||||
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.
|
|||||||
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);
});