using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
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/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateActionRequestContent{
Name: "name",
SupportedTriggers: []*management.ActionTrigger{
&management.ActionTrigger{
Id: "id",
},
},
}
client.Actions.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.actions.requests.CreateActionRequestContent;
import com.auth0.client.mgmt.types.ActionTrigger;
import com.auth0.client.mgmt.types.ActionTriggerTypeEnum;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.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\Management;
use Auth0\SDK\API\Management\Actions\Requests\CreateActionRequestContent;
use Auth0\SDK\API\Management\Types\ActionTrigger;
use Auth0\SDK\API\Management\Types\ActionTriggerTypeEnum;
$client = new Management(
token: '<token>',
);
$client->actions->create(
new CreateActionRequestContent([
'name' => 'name',
'supportedTriggers' => [
new ActionTrigger([
'id' => ActionTriggerTypeEnum::PostLogin->value,
]),
],
]),
);
from auth0.management import ManagementClient, ActionTrigger
client = ManagementClient(
token="<token>",
)
client.actions.create(
name="name",
supported_triggers=[
ActionTrigger(
id="post-login",
)
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>")
client.actions.create(
name: "name",
supported_triggers: [{
id: "post-login"
}]
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
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": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"deploy": false
}
'{
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"deployed_version": {
"id": "12a3b9e6-06e6-4a29-96bf-90c82fe79a0d",
"action_id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"deployed": true,
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"number": 1,
"errors": [
{
"id": "<string>",
"msg": "<string>",
"url": "<string>"
}
],
"action": {
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z"
},
"built_at": "2021-01-01T00:00:00.000Z",
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
},
"installed_integration_id": "7d2bc0c9-c0c2-433a-9f4e-86ef80270aad",
"integration": {
"id": "8e9fe2d0-a2fc-4c8c-9e35-dae5afadb70b",
"catalog_id": "awesome-auth0-integration",
"url_slug": "awesome-auth0-integration-slug",
"partner_id": "b8575c12-8d9d-4b5c-b28e-671fe9d39029",
"name": "Example Auth0 integration",
"description": "An awesome Auth0 integration",
"short_description": "Awesome Auth0 integration",
"logo": "<string>",
"feature_type": "action",
"terms_of_use_url": "<string>",
"privacy_policy_url": "<string>",
"public_support_link": "<string>",
"current_release": {
"id": "<string>",
"trigger": {
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
},
"semver": {
"major": 1,
"minor": 1
},
"required_secrets": [
{
"name": "<string>",
"required": true,
"optional": true,
"label": "<string>",
"description": "<string>",
"default_value": "<string>",
"placeholder": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
],
"required_configuration": [
{
"name": "<string>",
"required": true,
"optional": true,
"label": "<string>",
"description": "<string>",
"default_value": "<string>",
"placeholder": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
]
},
"created_at": "2021-06-21T15:47:29.072Z",
"updated_at": "2021-06-21T15:47:29.072Z"
},
"status": "built",
"built_at": "2021-01-01T00:00:00.000Z",
"deploy": false,
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
}Create an action
Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
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/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateActionRequestContent{
Name: "name",
SupportedTriggers: []*management.ActionTrigger{
&management.ActionTrigger{
Id: "id",
},
},
}
client.Actions.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.actions.requests.CreateActionRequestContent;
import com.auth0.client.mgmt.types.ActionTrigger;
import com.auth0.client.mgmt.types.ActionTriggerTypeEnum;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.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\Management;
use Auth0\SDK\API\Management\Actions\Requests\CreateActionRequestContent;
use Auth0\SDK\API\Management\Types\ActionTrigger;
use Auth0\SDK\API\Management\Types\ActionTriggerTypeEnum;
$client = new Management(
token: '<token>',
);
$client->actions->create(
new CreateActionRequestContent([
'name' => 'name',
'supportedTriggers' => [
new ActionTrigger([
'id' => ActionTriggerTypeEnum::PostLogin->value,
]),
],
]),
);
from auth0.management import ManagementClient, ActionTrigger
client = ManagementClient(
token="<token>",
)
client.actions.create(
name="name",
supported_triggers=[
ActionTrigger(
id="post-login",
)
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>")
client.actions.create(
name: "name",
supported_triggers: [{
id: "post-login"
}]
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.create({
name: "name",
supportedTriggers: [
{
id: "id",
},
],
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
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": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"deploy": false
}
'{
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"deployed_version": {
"id": "12a3b9e6-06e6-4a29-96bf-90c82fe79a0d",
"action_id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"version": "<string>",
"registry_url": "<string>"
}
],
"deployed": true,
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"updated_at": "2021-01-01T00:00:00.000Z"
}
],
"status": "built",
"number": 1,
"errors": [
{
"id": "<string>",
"msg": "<string>",
"url": "<string>"
}
],
"action": {
"id": "910b1053-577f-4d81-a8c8-020e7319a38a",
"name": "my-action",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"all_changes_deployed": false,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z"
},
"built_at": "2021-01-01T00:00:00.000Z",
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"supported_triggers": [
{
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
},
"installed_integration_id": "7d2bc0c9-c0c2-433a-9f4e-86ef80270aad",
"integration": {
"id": "8e9fe2d0-a2fc-4c8c-9e35-dae5afadb70b",
"catalog_id": "awesome-auth0-integration",
"url_slug": "awesome-auth0-integration-slug",
"partner_id": "b8575c12-8d9d-4b5c-b28e-671fe9d39029",
"name": "Example Auth0 integration",
"description": "An awesome Auth0 integration",
"short_description": "Awesome Auth0 integration",
"logo": "<string>",
"feature_type": "action",
"terms_of_use_url": "<string>",
"privacy_policy_url": "<string>",
"public_support_link": "<string>",
"current_release": {
"id": "<string>",
"trigger": {
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"version": "<string>"
}
]
},
"semver": {
"major": 1,
"minor": 1
},
"required_secrets": [
{
"name": "<string>",
"required": true,
"optional": true,
"label": "<string>",
"description": "<string>",
"default_value": "<string>",
"placeholder": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
],
"required_configuration": [
{
"name": "<string>",
"required": true,
"optional": true,
"label": "<string>",
"description": "<string>",
"default_value": "<string>",
"placeholder": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
]
},
"created_at": "2021-06-21T15:47:29.072Z",
"updated_at": "2021-06-21T15:47:29.072Z"
},
"status": "built",
"built_at": "2021-01-01T00:00:00.000Z",
"deploy": false,
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
The name of an action.
The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
1Show child attributes
Show child attributes
The source code of the action.
The list of third party npm modules, and their versions, that this action depends on.
Show child attributes
Show child attributes
The Node runtime. For example: node22, defaults to node22
The list of secrets that are included in an action or a version of an action.
Show child attributes
Show child attributes
The list of action modules and their versions used by this action.
Show child attributes
Show child attributes
True if the action should be deployed after creation.
レスポンス
Action successfully created.
The unique ID of the action.
The name of an action.
The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
1Show child attributes
Show child attributes
True if all of an Action's contents have been deployed.
The time when this action was created.
The time when this action was updated.
The source code of the action.
The list of third party npm modules, and their versions, that this action depends on.
Show child attributes
Show child attributes
The Node runtime. For example: node22, defaults to node22
The list of secrets that are included in an action or a version of an action.
Show child attributes
Show child attributes
The version of the action that is currently deployed.
Show child attributes
Show child attributes
installed_integration_id is the fk reference to the InstalledIntegration entity.
Integration defines a self contained functioning unit which partners publish. A partner may create one or many of these integrations.
Show child attributes
Show child attributes
The build status of this action.
pending, building, packaged, built, retrying, failed The time when this action was built successfully.
True if the action should be deployed after creation.
The list of action modules and their versions used by this action.
Show child attributes
Show child attributes