using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Actions.CreateAsync(
new CreateActionRequestContent {
Name = "name",
SupportedTriggers = new List<ActionTrigger>(){
new ActionTrigger {
Id = ActionTriggerTypeEnum.PostLogin
},
}
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateActionRequestContent{
Name: "name",
SupportedTriggers: []*management.ActionTrigger{
&management.ActionTrigger{
Id: "id",
},
},
}
mgmt.Actions.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.ActionTrigger;
import com.auth0.client.mgmt.types.ActionTriggerTypeEnum;
import com.auth0.client.mgmt.types.CreateActionRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().create(
CreateActionRequestContent
.builder()
.name("name")
.supportedTriggers(
Arrays.asList(
ActionTrigger
.builder()
.id(ActionTriggerTypeEnum.POST_LOGIN)
.build()
)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Requests\CreateActionRequestContent;
use Auth0\SDK\API\Management\Types\ActionTrigger;
use Auth0\SDK\API\Management\Types\ActionTriggerTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->create(
new CreateActionRequestContent([
'name' => 'name',
'supportedTriggers' => [
new ActionTrigger([
'id' => ActionTriggerTypeEnum::PostLogin->value,
]),
],
]),
);
from auth0.management import ManagementClient, ActionTrigger
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.create(
name="name",
supported_triggers=[
ActionTrigger(
id="post-login",
)
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.create(
name: "name",
supported_triggers: [{
id: "post-login"
}]
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-action",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deploy": false,
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
]
}
'{
"all_changes_deployed": false,
"built_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"created_at": "2021-01-01T00:00:00.000Z",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deploy": false,
"deployed_version": {
"action": {
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
},
"action_id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"built_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"created_at": "2021-01-01T00:00:00.000Z",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deployed": true,
"errors": [
{
"id": "<string>",
"msg": "<string>",
"url": "<string>"
}
],
"id": "12a3b9e6-06e6-4a29-96bf-90c82fe79a0d",
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"number": 1,
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
},
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"installed_integration_id": "7d2bc0c9-c0c2-433a-9f4e-86ef80270aad",
"integration": {
"catalog_id": "awesome-auth0-integration",
"created_at": "2021-06-21T15:47:29.072Z",
"current_release": {
"id": "<string>",
"required_configuration": [
{
"default_value": "<string>",
"description": "<string>",
"label": "<string>",
"name": "<string>",
"optional": true,
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"placeholder": "<string>",
"required": true
}
],
"required_secrets": [
{
"default_value": "<string>",
"description": "<string>",
"label": "<string>",
"name": "<string>",
"optional": true,
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"placeholder": "<string>",
"required": true
}
],
"semver": {
"major": 1,
"minor": 1
},
"trigger": {
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
},
"description": "An awesome Auth0 integration",
"feature_type": "action",
"id": "8e9fe2d0-a2fc-4c8c-9e35-dae5afadb70b",
"logo": "<string>",
"name": "Example Auth0 integration",
"partner_id": "b8575c12-8d9d-4b5c-b28e-671fe9d39029",
"privacy_policy_url": "<string>",
"public_support_link": "<string>",
"short_description": "Awesome Auth0 integration",
"terms_of_use_url": "<string>",
"updated_at": "2021-06-21T15:47:29.072Z",
"url_slug": "awesome-auth0-integration-slug"
},
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
}Publier une Action
Créer une action. Une fois une action créée, elle doit être déployée, puis associée à un déclencheur avant d’être exécutée dans le cadre d’un flux.
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Actions.CreateAsync(
new CreateActionRequestContent {
Name = "name",
SupportedTriggers = new List<ActionTrigger>(){
new ActionTrigger {
Id = ActionTriggerTypeEnum.PostLogin
},
}
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateActionRequestContent{
Name: "name",
SupportedTriggers: []*management.ActionTrigger{
&management.ActionTrigger{
Id: "id",
},
},
}
mgmt.Actions.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.ActionTrigger;
import com.auth0.client.mgmt.types.ActionTriggerTypeEnum;
import com.auth0.client.mgmt.types.CreateActionRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().create(
CreateActionRequestContent
.builder()
.name("name")
.supportedTriggers(
Arrays.asList(
ActionTrigger
.builder()
.id(ActionTriggerTypeEnum.POST_LOGIN)
.build()
)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Requests\CreateActionRequestContent;
use Auth0\SDK\API\Management\Types\ActionTrigger;
use Auth0\SDK\API\Management\Types\ActionTriggerTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->create(
new CreateActionRequestContent([
'name' => 'name',
'supportedTriggers' => [
new ActionTrigger([
'id' => ActionTriggerTypeEnum::PostLogin->value,
]),
],
]),
);
from auth0.management import ManagementClient, ActionTrigger
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.create(
name="name",
supported_triggers=[
ActionTrigger(
id="post-login",
)
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.create(
name: "name",
supported_triggers: [{
id: "post-login"
}]
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-action",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deploy": false,
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
]
}
'{
"all_changes_deployed": false,
"built_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"created_at": "2021-01-01T00:00:00.000Z",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deploy": false,
"deployed_version": {
"action": {
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
},
"action_id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"built_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"created_at": "2021-01-01T00:00:00.000Z",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"deployed": true,
"errors": [
{
"id": "<string>",
"msg": "<string>",
"url": "<string>"
}
],
"id": "12a3b9e6-06e6-4a29-96bf-90c82fe79a0d",
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"number": 1,
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
},
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"installed_integration_id": "7d2bc0c9-c0c2-433a-9f4e-86ef80270aad",
"integration": {
"catalog_id": "awesome-auth0-integration",
"created_at": "2021-06-21T15:47:29.072Z",
"current_release": {
"id": "<string>",
"required_configuration": [
{
"default_value": "<string>",
"description": "<string>",
"label": "<string>",
"name": "<string>",
"optional": true,
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"placeholder": "<string>",
"required": true
}
],
"required_secrets": [
{
"default_value": "<string>",
"description": "<string>",
"label": "<string>",
"name": "<string>",
"optional": true,
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"placeholder": "<string>",
"required": true
}
],
"semver": {
"major": 1,
"minor": 1
},
"trigger": {
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
},
"description": "An awesome Auth0 integration",
"feature_type": "action",
"id": "8e9fe2d0-a2fc-4c8c-9e35-dae5afadb70b",
"logo": "<string>",
"name": "Example Auth0 integration",
"partner_id": "b8575c12-8d9d-4b5c-b28e-671fe9d39029",
"privacy_policy_url": "<string>",
"public_support_link": "<string>",
"short_description": "Awesome Auth0 integration",
"terms_of_use_url": "<string>",
"updated_at": "2021-06-21T15:47:29.072Z",
"url_slug": "awesome-auth0-integration-slug"
},
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
],
"updated_at": "2021-01-01T00:00:00.000Z"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
Le nom d’une action.
La liste des déclencheurs pris en charge par cette action. Pour le moment, une action ne peut cibler qu’un seul déclencheur à la fois.
1Show child attributes
Show child attributes
Le code source de l’action.
La liste des modules npm tiers et de leurs versions dont cette action dépend.
Show child attributes
Show child attributes
Vrai si l’action doit être déployée après sa création.
La liste des modules d’action et de leurs versions utilisés par cette action.
Show child attributes
Show child attributes
L’environnement d’exécution Node. Par exemple : node22; la valeur par défaut est node22
La liste des secrets inclus dans une action ou une version d’action.
Show child attributes
Show child attributes
Réponse
Action créée avec succès.
Vrai si tout le contenu d’une Action a été déployé.
La date et l’heure auxquelles cette action a été créée avec succès.
Le code source de l’action.
L’heure de création de cette action.
La liste des modules npm tiers et de leurs versions dont cette action dépend.
Show child attributes
Show child attributes
True si l’action doit être déployée après sa création.
La version de l’action actuellement déployée.
Show child attributes
Show child attributes
L’ID unique de l’action.
installed_integration_id est la référence de clé étrangère vers l’entité InstalledIntegration.
Une intégration définit une unité fonctionnelle autonome que les partenaires publient. Un partenaire peut créer une ou plusieurs de ces intégrations.
Show child attributes
Show child attributes
La liste des modules d’action et de leurs versions utilisés par cette action.
Show child attributes
Show child attributes
Le nom d’une action.
L’environnement d’exécution Node. Par exemple : node22; la valeur par défaut est node22
La liste des secrets inclus dans une action ou une version d’action.
Show child attributes
Show child attributes
Le statut de compilation de cette action.
pending, building, packaged, built, retrying, failed La liste des déclencheurs pris en charge par cette action. Pour le moment, une action ne peut cibler qu’un seul déclencheur à la fois.
1Show child attributes
Show child attributes
L’heure de la dernière mise à jour de cette action.