Table of Contents

Class ActionsClient

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll
public class ActionsClient : IActionsClient
Inheritance
ActionsClient
Implements
Inherited Members
Extension Methods

Properties

Executions

public IExecutionsClient Executions { get; }

Property Value

IExecutionsClient

Modules

public IModulesClient Modules { get; }

Property Value

IModulesClient

Triggers

public ITriggersClient Triggers { get; }

Property Value

ITriggersClient

Versions

public IVersionsClient Versions { get; }

Property Value

IVersionsClient

Methods

CreateAsync(CreateActionRequestContent, RequestOptions?, CancellationToken)

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.

public WithRawResponseTask<CreateActionResponseContent> CreateAsync(CreateActionRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request CreateActionRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<CreateActionResponseContent>

Examples

await client.Actions.CreateAsync(
    new CreateActionRequestContent
    {
        Name = "name",
        SupportedTriggers = new List<ActionTrigger>()
        {
            new ActionTrigger { Id = ActionTriggerTypeEnum.PostLogin },
        },
    }
);

DeleteAsync(string, DeleteActionRequestParameters, RequestOptions?, CancellationToken)

Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted.

public Task DeleteAsync(string id, DeleteActionRequestParameters request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request DeleteActionRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

Task

Examples

await client.Actions.DeleteAsync("id", new DeleteActionRequestParameters { Force = true });

DeployAsync(string, RequestOptions?, CancellationToken)

Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.

public WithRawResponseTask<DeployActionResponseContent> DeployAsync(string id, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<DeployActionResponseContent>

Examples

await client.Actions.DeployAsync("id");

GetAsync(string, RequestOptions?, CancellationToken)

Retrieve an action by its ID.

public WithRawResponseTask<GetActionResponseContent> GetAsync(string id, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<GetActionResponseContent>

Examples

await client.Actions.GetAsync("id");

ListAsync(ListActionsRequestParameters, RequestOptions?, CancellationToken)

Retrieve all actions.

public Task<Pager<Action>> ListAsync(ListActionsRequestParameters request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request ListActionsRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

Task<Pager<Action>>

Examples

await client.Actions.ListAsync(
    new ListActionsRequestParameters
    {
        TriggerId = ActionTriggerTypeEnum.PostLogin,
        ActionName = "actionName",
        Deployed = true,
        Page = 1,
        PerPage = 1,
        Installed = true,
    }
);

TestAsync(string, TestActionRequestContent, RequestOptions?, CancellationToken)

Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected.

public WithRawResponseTask<TestActionResponseContent> TestAsync(string id, TestActionRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request TestActionRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<TestActionResponseContent>

Examples

await client.Actions.TestAsync(
    "id",
    new TestActionRequestContent
    {
        Payload = new Dictionary<string, object?>() { { "key", "value" } },
    }
);

UpdateAsync(string, UpdateActionRequestContent, RequestOptions?, CancellationToken)

Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed.

public WithRawResponseTask<UpdateActionResponseContent> UpdateAsync(string id, UpdateActionRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request UpdateActionRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<UpdateActionResponseContent>

Examples

await client.Actions.UpdateAsync("id", new UpdateActionRequestContent());