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
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.
| Input | Type | Description | |
|---|---|---|---|
user_id | string | Required | Auth0 user id |
roles | array of string | Required | Role ids to assign, e.g. rol_ZzDaGhmvLyqzP5fC |
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.
| Input | Type | Description | |
|---|---|---|---|
user_id | string | Required | Auth0 user id, e.g. auth0|507f1f77bcf86cd799439020 |
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).
| Input | Type | Description | |
|---|---|---|---|
user_id | string | Required | Auth0 user id |
per_page | integer | Optional | Results per page, 1 to 100 |
page | integer | Optional | Page index, first page is 0 |
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.
| Input | Type | Description | |
|---|---|---|---|
strategy | array of string | Optional | Only these strategies, e.g. auth0, google-oauth2, samlp |
per_page | integer | Optional | Results per page, 1 to 100 |
page | integer | Optional | Page index, first page is 0 |
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.
| Input | Type | Description | |
|---|---|---|---|
q | string | Optional | Lucene query, e.g. type:f or user_id:"auth0|507f1f77bcf86cd799439020" |
per_page | integer | Optional | Results per page, 1 to 100 |
page | integer | Optional | Page index, first page is 0 |
sort | string | Optional | e.g. date:-1 for newest first |
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.
| Input | Type | Description | |
|---|---|---|---|
name_filter | string | Optional | Case-insensitive name filter |
per_page | integer | Optional | Results per page, 1 to 100 |
page | integer | Optional | Page index, first page is 0 |
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.
| Input | Type | Description | |
|---|---|---|---|
q | string | Optional | Lucene query, e.g. email:"[email protected]" or blocked:true |
per_page | integer | Optional | Results per page, 1 to 100 |
page | integer | Optional | Page index, first page is 0 |
sort | string | Optional | field:order, e.g. created_at:-1 for newest first |
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).
| Input | Type | Description | |
|---|---|---|---|
user_id | string | Required | Auth0 user id |
blocked | boolean | Optional | true blocks the user from signing in, false unblocks |
user_metadata | object | Optional | Fields merged into user_metadata |
app_metadata | object | Optional | Fields merged into app_metadata |
await setu.execute({
userId: "user_1",
action: "auth0.update_user",
input: {
"user_id": "<user_id>"
},
});