Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Auth0

Auth0

Auth0 Management API: list and search users, read and update them (block, unblock, metadata), see and assign roles, list connections and tenant logs.

8 actions API key 6 read2 write Calls auth0.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "auth0" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Assign roles to userwriteauth0.assign_user_rolesAssign one or more existing roles to an Auth0 user by role id. This grants the user the permissions of those roles.
InputTypeDescription
user_idstringRequiredAuth0 user id
rolesarray of stringRequiredRole ids to assign, e.g. rol_ZzDaGhmvLyqzP5fC
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.assign_user_roles",
  input: {
    "user_id": "<user_id>",
    "roles": []
  },
});
Get userreadauth0.get_userGet one Auth0 user by user id (for example auth0|507f1f77bcf86cd799439020), including profile, last login, block status and metadata.
InputTypeDescription
user_idstringRequiredAuth0 user id, e.g. auth0|507f1f77bcf86cd799439020
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.get_user",
  input: {
    "user_id": "<user_id>"
  },
});
Get user rolesreadauth0.get_user_rolesList the roles directly assigned to an Auth0 user (id, name and description of each role).
InputTypeDescription
user_idstringRequiredAuth0 user id
per_pageintegerOptionalResults per page, 1 to 100
pageintegerOptionalPage index, first page is 0
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.get_user_roles",
  input: {
    "user_id": "<user_id>"
  },
});
List connectionsreadauth0.list_connectionsList the identity connections of the Auth0 tenant (database, social, enterprise) with name and strategy, optionally filtered by strategy.
InputTypeDescription
strategyarray of stringOptionalOnly these strategies, e.g. auth0, google-oauth2, samlp
per_pageintegerOptionalResults per page, 1 to 100
pageintegerOptionalPage index, first page is 0
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.list_connections",
  input: {},
});
List logsreadauth0.list_logsList tenant log events (logins, failed logins, password changes, API operations). Filter with a Lucene query such as type:f for failed logins; newest first with sort date:-1.
InputTypeDescription
qstringOptionalLucene query, e.g. type:f or user_id:"auth0|507f1f77bcf86cd799439020"
per_pageintegerOptionalResults per page, 1 to 100
pageintegerOptionalPage index, first page is 0
sortstringOptionale.g. date:-1 for newest first
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.list_logs",
  input: {},
});
List rolesreadauth0.list_rolesList the roles defined in the Auth0 tenant, optionally filtered by name. Returns role ids needed to assign roles to users.
InputTypeDescription
name_filterstringOptionalCase-insensitive name filter
per_pageintegerOptionalResults per page, 1 to 100
pageintegerOptionalPage index, first page is 0
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.list_roles",
  input: {},
});
List or search usersreadauth0.list_usersList users in the Auth0 tenant or search them with a Lucene query such as email:"[email protected]" or blocked:true. Returns up to 100 per page; search is eventually consistent.
InputTypeDescription
qstringOptionalLucene query, e.g. email:"[email protected]" or blocked:true
per_pageintegerOptionalResults per page, 1 to 100
pageintegerOptionalPage index, first page is 0
sortstringOptionalfield:order, e.g. created_at:-1 for newest first
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.list_users",
  input: {},
});
Update userwriteauth0.update_userUpdate an Auth0 user: block or unblock sign-in with blocked, or merge fields into user_metadata or app_metadata (merged at the first level).
InputTypeDescription
user_idstringRequiredAuth0 user id
blockedbooleanOptionaltrue blocks the user from signing in, false unblocks
user_metadataobjectOptionalFields merged into user_metadata
app_metadataobjectOptionalFields merged into app_metadata
TypeScript
await setu.execute({
  userId: "user_1",
  action: "auth0.update_user",
  input: {
    "user_id": "<user_id>"
  },
});