Table of Contents

Class HooksClient

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll
public class HooksClient : IHooksClient
Inheritance
HooksClient
Implements
Inherited Members
Extension Methods

Properties

Secrets

public ISecretsClient Secrets { get; }

Property Value

ISecretsClient

Methods

CreateAsync(CreateHookRequestContent, RequestOptions?, CancellationToken)

Create a new hook.

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

Parameters

request CreateHookRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<CreateHookResponseContent>

Examples

await client.Hooks.CreateAsync(
    new CreateHookRequestContent
    {
        Name = "name",
        Script = "script",
        TriggerId = HookTriggerIdEnum.CredentialsExchange,
    }
);

DeleteAsync(string, RequestOptions?, CancellationToken)

Delete a hook.

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

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

Task

Examples

await client.Hooks.DeleteAsync("id");

GetAsync(string, GetHookRequestParameters, RequestOptions?, CancellationToken)

Retrieve a hook by its ID. Accepts a list of fields to include in the result.

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

Parameters

id string
request GetHookRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<GetHookResponseContent>

Examples

await client.Hooks.GetAsync("id", new GetHookRequestParameters { Fields = "fields" });

ListAsync(ListHooksRequestParameters, RequestOptions?, CancellationToken)

Retrieve all hooks. Accepts a list of fields to include or exclude in the result.

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

Parameters

request ListHooksRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

Task<Pager<Hook>>

Examples

await client.Hooks.ListAsync(
    new ListHooksRequestParameters
    {
        Page = 1,
        PerPage = 1,
        IncludeTotals = true,
        Enabled = true,
        Fields = "fields",
        TriggerId = HookTriggerIdEnum.CredentialsExchange,
    }
);

UpdateAsync(string, UpdateHookRequestContent, RequestOptions?, CancellationToken)

Update an existing hook.

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

Parameters

id string
request UpdateHookRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<UpdateHookResponseContent>

Examples

await client.Hooks.UpdateAsync("id", new UpdateHookRequestContent());