Back to Node Auth0

Class HooksClient

docs/classes/management.SDK.HooksClient.html

5.9.18.9 KB
Original Source

Class HooksClient

Index

Accessors

secrets

Constructors

constructor

Methods

listcreategetdeleteupdate

Properties

_options_secrets

Accessors

secrets

get secrets(): SecretsClient

Returns SecretsClient

Constructors

constructor

new HooksClient(options: BaseClientOptions): HooksClient

Parameters

Returns HooksClient

Methods

list

list(
request?: ListHooksRequestParameters,
requestOptions?: HooksClient.RequestOptions,
): Promise<Page<Hook, ListHooksOffsetPaginatedResponseContent>>

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

Parameters

Request-specific configuration.

Returns Promise<Page<Hook, ListHooksOffsetPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.hooks.list({ page: 1, per_page: 1, include_totals: true, enabled: true, fields: "fields", triggerId: "credentials-exchange" })Copy

create

create(
request: CreateHookRequestContent,
requestOptions?: HooksClient.RequestOptions,
): HttpResponsePromise<CreateHookResponseContent>

Create a new hook.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<CreateHookResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.hooks.create({ name: "name", script: "script", triggerId: "credentials-exchange" })Copy

get

get(
id: string,
request?: GetHookRequestParameters,
requestOptions?: HooksClient.RequestOptions,
): HttpResponsePromise<GetHookResponseContent>

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

Parameters

  • id: string

ID of the hook to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<GetHookResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.hooks.get("id", { fields: "fields" })Copy

delete

delete(
id: string,
requestOptions?: HooksClient.RequestOptions,
): HttpResponsePromise<void>

Delete a hook.

Parameters

  • id: string

ID of the hook to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.hooks.delete("id")Copy

update

update(
id: string,
request?: UpdateHookRequestContent,
requestOptions?: HooksClient.RequestOptions,
): HttpResponsePromise<UpdateHookResponseContent>

Update an existing hook.

Parameters

  • id: string

ID of the hook to update.

Request-specific configuration.

Returns HttpResponsePromise<UpdateHookResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.hooks.update("id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Protected_secrets

_secrets: SecretsClient | undefined

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Accessors secrets Constructors constructor Methods listcreategetdeleteupdate Properties _options_secrets