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.UpdateActionRequestContent{}
client.Actions.Update(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.update("id", {});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.update("id", {});
}
main();curl --request PATCH \
--url https://{tenantDomain}/api/v2/actions/actions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/actions/actions/{id}"
payload = {
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"supported_triggers": [
{
"compatible_triggers": [{ "version": "<string>" }],
"default_runtime": "<string>",
"runtimes": ["<string>"],
"status": "<string>",
"version": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/actions/actions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'module.exports = () => {}',
'dependencies' => [
[
'name' => '<string>',
'registry_url' => '<string>',
'version' => '<string>'
]
],
'modules' => [
[
'module_id' => '<string>',
'module_name' => '<string>',
'module_version_id' => '<string>',
'module_version_number' => 123
]
],
'name' => 'my-action',
'runtime' => 'node22',
'secrets' => [
[
'name' => 'mySecret',
'value' => 'mySecretValue'
]
],
'supported_triggers' => [
[
'compatible_triggers' => [
[
'version' => '<string>'
]
],
'default_runtime' => '<string>',
'runtimes' => [
'<string>'
],
'status' => '<string>',
'version' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/actions/actions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"module.exports = () => {}\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"registry_url\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"modules\": [\n {\n \"module_id\": \"<string>\",\n \"module_name\": \"<string>\",\n \"module_version_id\": \"<string>\",\n \"module_version_number\": 123\n }\n ],\n \"name\": \"my-action\",\n \"runtime\": \"node22\",\n \"secrets\": [\n {\n \"name\": \"mySecret\",\n \"value\": \"mySecretValue\"\n }\n ],\n \"supported_triggers\": [\n {\n \"compatible_triggers\": [\n {\n \"version\": \"<string>\"\n }\n ],\n \"default_runtime\": \"<string>\",\n \"runtimes\": [\n \"<string>\"\n ],\n \"status\": \"<string>\",\n \"version\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/actions/actions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"module.exports = () => {}\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"registry_url\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"modules\": [\n {\n \"module_id\": \"<string>\",\n \"module_name\": \"<string>\",\n \"module_version_id\": \"<string>\",\n \"module_version_number\": 123\n }\n ],\n \"name\": \"my-action\",\n \"runtime\": \"node22\",\n \"secrets\": [\n {\n \"name\": \"mySecret\",\n \"value\": \"mySecretValue\"\n }\n ],\n \"supported_triggers\": [\n {\n \"compatible_triggers\": [\n {\n \"version\": \"<string>\"\n }\n ],\n \"default_runtime\": \"<string>\",\n \"runtimes\": [\n \"<string>\"\n ],\n \"status\": \"<string>\",\n \"version\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}Actualizar Action
Actualiza una Action existente. Si esta Action está actualmente vinculada a un activador, al actualizarla no se verá afectado ningún flujo de usuario hasta que la Action se despliegue.
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.UpdateActionRequestContent{}
client.Actions.Update(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.update("id", {});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.actions.update("id", {});
}
main();curl --request PATCH \
--url https://{tenantDomain}/api/v2/actions/actions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"supported_triggers": [
{
"compatible_triggers": [
{
"version": "<string>"
}
],
"default_runtime": "<string>",
"runtimes": [
"<string>"
],
"status": "<string>",
"version": "<string>"
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/actions/actions/{id}"
payload = {
"code": "module.exports = () => {}",
"dependencies": [
{
"name": "<string>",
"registry_url": "<string>",
"version": "<string>"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
],
"name": "my-action",
"runtime": "node22",
"secrets": [
{
"name": "mySecret",
"value": "mySecretValue"
}
],
"supported_triggers": [
{
"compatible_triggers": [{ "version": "<string>" }],
"default_runtime": "<string>",
"runtimes": ["<string>"],
"status": "<string>",
"version": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/actions/actions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'module.exports = () => {}',
'dependencies' => [
[
'name' => '<string>',
'registry_url' => '<string>',
'version' => '<string>'
]
],
'modules' => [
[
'module_id' => '<string>',
'module_name' => '<string>',
'module_version_id' => '<string>',
'module_version_number' => 123
]
],
'name' => 'my-action',
'runtime' => 'node22',
'secrets' => [
[
'name' => 'mySecret',
'value' => 'mySecretValue'
]
],
'supported_triggers' => [
[
'compatible_triggers' => [
[
'version' => '<string>'
]
],
'default_runtime' => '<string>',
'runtimes' => [
'<string>'
],
'status' => '<string>',
'version' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/actions/actions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"module.exports = () => {}\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"registry_url\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"modules\": [\n {\n \"module_id\": \"<string>\",\n \"module_name\": \"<string>\",\n \"module_version_id\": \"<string>\",\n \"module_version_number\": 123\n }\n ],\n \"name\": \"my-action\",\n \"runtime\": \"node22\",\n \"secrets\": [\n {\n \"name\": \"mySecret\",\n \"value\": \"mySecretValue\"\n }\n ],\n \"supported_triggers\": [\n {\n \"compatible_triggers\": [\n {\n \"version\": \"<string>\"\n }\n ],\n \"default_runtime\": \"<string>\",\n \"runtimes\": [\n \"<string>\"\n ],\n \"status\": \"<string>\",\n \"version\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/actions/actions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"module.exports = () => {}\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"registry_url\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"modules\": [\n {\n \"module_id\": \"<string>\",\n \"module_name\": \"<string>\",\n \"module_version_id\": \"<string>\",\n \"module_version_number\": 123\n }\n ],\n \"name\": \"my-action\",\n \"runtime\": \"node22\",\n \"secrets\": [\n {\n \"name\": \"mySecret\",\n \"value\": \"mySecretValue\"\n }\n ],\n \"supported_triggers\": [\n {\n \"compatible_triggers\": [\n {\n \"version\": \"<string>\"\n }\n ],\n \"default_runtime\": \"<string>\",\n \"runtimes\": [\n \"<string>\"\n ],\n \"status\": \"<string>\",\n \"version\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}Autorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parámetros de ruta
El id de la Action que se va a actualizar.
Cuerpo
El código fuente de la Action.
La lista de módulos npm de terceros y sus versiones de los que depende esta Action.
Show child attributes
Show child attributes
La lista de módulos de Action y sus versiones que usa esta Action.
Show child attributes
Show child attributes
El nombre de una Action.
El entorno de ejecución de Node. Por ejemplo: node22; el valor predeterminado es node22
La lista de secrets incluidos en una Action o en una versión de una Action.
Show child attributes
Show child attributes
La lista de desencadenadores que admite esta Action. En este momento, una Action solo puede tener como objetivo un único desencadenador a la vez.
1Show child attributes
Show child attributes
Respuesta
Action actualizada correctamente.
Verdadero si se ha desplegado todo el contenido de una Action.
La fecha y hora en que esta Action se compiló correctamente.
El código fuente de la Action.
La fecha y hora en que se creó esta Action.
La lista de módulos npm de terceros y sus versiones de los que depende esta Action.
Show child attributes
Show child attributes
True si la Action debe desplegarse después de su creación.
La versión de la Action que está desplegada actualmente.
Show child attributes
Show child attributes
El id único de la Action.
installed_integration_id es la referencia de clave externa a la entidad InstalledIntegration.
Una integración define una unidad funcional autocontenida que los partners publican. Un partner puede crear una o varias de estas integraciones.
Show child attributes
Show child attributes
La lista de Action Modules y sus versiones que usa esta Action.
Show child attributes
Show child attributes
El nombre de una Action.
El entorno de ejecución de Node. Por ejemplo: node22; el valor predeterminado es node22
La lista de secrets incluidos en una Action o en una versión de una Action.
Show child attributes
Show child attributes
El estado de compilación de esta Action.
pending, building, packaged, built, retrying, failed La lista de desencadenadores que admite esta Action. En este momento, una Action solo puede tener como objetivo un único desencadenador a la vez.
1Show child attributes
Show child attributes
La fecha y hora en que se actualizó esta Action.