import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.modules.rollback("id", {
module_version_id: "module_version_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.modules.rollback("id", {
module_version_id: "module_version_id",
});
}
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.RollbackActionModuleRequestParameters{
ModuleVersionID: "module_version_id",
}
mgmt.Actions.Modules.Rollback(
context.TODO(),
"id",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api post "actions/modules/id/rollback" --data '{
"module_version_id": "module_version_id"
}'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.Modules.RollbackAsync(
id: "id",
request: new RollbackActionModuleRequestParameters {
ModuleVersionId = "module_version_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.RollbackActionModuleRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().modules().rollback(
"id",
RollbackActionModuleRequestParameters
.builder()
.moduleVersionId("module_version_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Modules\Requests\RollbackActionModuleRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->modules->rollback(
'id',
new RollbackActionModuleRequestParameters([
'moduleVersionId' => 'module_version_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.modules.rollback(
id="id",
module_version_id="module_version_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.modules.rollback(
id: "id",
module_version_id: "module_version_id"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/modules/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"module_version_id": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"actions_using_module_total": 123,
"all_changes_published": true,
"latest_version_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"latest_version": {
"id": "<string>",
"version_number": 123,
"code": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z"
}
}Rollback an Actions Module to a previous version
Rolls back an Actions Module’s draft to a previously created version. This action copies the code, dependencies, and secrets from the specified version into the current draft.
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.modules.rollback("id", {
module_version_id: "module_version_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.actions.modules.rollback("id", {
module_version_id: "module_version_id",
});
}
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.RollbackActionModuleRequestParameters{
ModuleVersionID: "module_version_id",
}
mgmt.Actions.Modules.Rollback(
context.TODO(),
"id",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api post "actions/modules/id/rollback" --data '{
"module_version_id": "module_version_id"
}'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.Modules.RollbackAsync(
id: "id",
request: new RollbackActionModuleRequestParameters {
ModuleVersionId = "module_version_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.RollbackActionModuleRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().modules().rollback(
"id",
RollbackActionModuleRequestParameters
.builder()
.moduleVersionId("module_version_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Modules\Requests\RollbackActionModuleRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->modules->rollback(
'id',
new RollbackActionModuleRequestParameters([
'moduleVersionId' => 'module_version_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.modules.rollback(
id="id",
module_version_id="module_version_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.modules.rollback(
id: "id",
module_version_id: "module_version_id"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/modules/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"module_version_id": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"actions_using_module_total": 123,
"all_changes_published": true,
"latest_version_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"latest_version": {
"id": "<string>",
"version_number": 123,
"code": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique ID of the module to roll back.
Body
The unique ID of the module version to roll back to.
Response
The rollback was successful.
The unique ID of the module.
The name of the module.
The source code from the module's draft version.
The npm dependencies from the module's draft version.
Show child attributes
Show child attributes
The secrets from the module's draft version (names and timestamps only, values never returned).
Show child attributes
Show child attributes
The number of deployed actions using this module.
Whether all draft changes have been published as a version.
The version number of the latest published version. Omitted if no versions have been published.
Timestamp when the module was created.
Timestamp when the module was last updated.
The latest published version as a reference object. Omitted if no versions have been published.
Show child attributes
Show child attributes