TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.versions.list("actionId", {
page: 1,
per_page: 1,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.versions.list("actionId", {
page: 1,
per_page: 1,
});
}
main();
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.ListActionVersionsRequestParameters{
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
}
mgmt.Actions.Versions.List(
context.TODO(),
"actionId",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "actions/actions/actionId/versions" --query "page=1" --query "per_page=1"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Actions;
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.Versions.ListAsync(
actionId: "actionId",
request: new ListActionVersionsRequestParameters {
Page = 1,
PerPage = 1
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().versions().list(
"actionId",
ListActionVersionsRequestParameters
.builder()
.page(1)
.perPage(1)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Versions\Requests\ListActionVersionsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->versions->list(
'actionId',
new ListActionVersionsRequestParameters([
'page' => 1,
'perPage' => 1,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.versions.list(
action_id="actionId",
page=1,
per_page=1,
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.versions.list(
action_id: "actionId",
page: 1,
per_page: 1
)
curl --request GET \
--url https://{tenantDomain}/api/v2/actions/actions/{actionId}/versions \
--header 'Authorization: Bearer <token>'{
"total": 1,
"page": 0,
"per_page": 20,
"versions": [
{
"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": [
{
"id": "post-login",
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"id": "post-login",
"version": "<string>"
}
],
"binding_policy": "trigger-bound"
}
],
"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": [
{
"id": "post-login",
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"id": "post-login",
"version": "<string>"
}
],
"binding_policy": "trigger-bound"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
}
]
}Récupérer les versions d'une action
Récupérer toutes les versions d’une action. Une version d’action est créée chaque fois qu’une action est déployée. Une fois créée, une version d’action est immuable.
GET
https://{tenantDomain}/api/v2
/
actions
/
actions
/
{actionId}
/
versions
TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.versions.list("actionId", {
page: 1,
per_page: 1,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.versions.list("actionId", {
page: 1,
per_page: 1,
});
}
main();
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.ListActionVersionsRequestParameters{
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
}
mgmt.Actions.Versions.List(
context.TODO(),
"actionId",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "actions/actions/actionId/versions" --query "page=1" --query "per_page=1"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Actions;
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.Versions.ListAsync(
actionId: "actionId",
request: new ListActionVersionsRequestParameters {
Page = 1,
PerPage = 1
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().versions().list(
"actionId",
ListActionVersionsRequestParameters
.builder()
.page(1)
.perPage(1)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Versions\Requests\ListActionVersionsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->versions->list(
'actionId',
new ListActionVersionsRequestParameters([
'page' => 1,
'perPage' => 1,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.versions.list(
action_id="actionId",
page=1,
per_page=1,
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.versions.list(
action_id: "actionId",
page: 1,
per_page: 1
)
curl --request GET \
--url https://{tenantDomain}/api/v2/actions/actions/{actionId}/versions \
--header 'Authorization: Bearer <token>'{
"total": 1,
"page": 0,
"per_page": 20,
"versions": [
{
"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": [
{
"id": "post-login",
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"id": "post-login",
"version": "<string>"
}
],
"binding_policy": "trigger-bound"
}
],
"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": [
{
"id": "post-login",
"version": "<string>",
"status": "<string>",
"runtimes": [
"<string>"
],
"default_runtime": "<string>",
"compatible_triggers": [
{
"id": "post-login",
"version": "<string>"
}
],
"binding_policy": "trigger-bound"
}
],
"modules": [
{
"module_id": "<string>",
"module_name": "<string>",
"module_version_id": "<string>",
"module_version_number": 123
}
]
}
]
}Autorisations
bearerAuthoAuth2ClientCredentials