Skip to main content
Version: Next

WebhookClient

Client for managing a specific webhook.

Webhooks allow you to receive notifications when specific events occur in your Actors or tasks. This client provides methods to get, update, delete, and test webhooks, as well as retrieve webhook dispatches.

@example
const client = new ApifyClient({ token: 'my-token' });
const webhookClient = client.webhook('my-webhook-id');

// Get webhook details
const webhook = await webhookClient.get();

// Update webhook
await webhookClient.update({
isEnabled: true,
eventTypes: ['ACTOR.RUN.SUCCEEDED'],
requestUrl: 'https://example.com/webhook'
});

// Test webhook
await webhookClient.test();
@see

Hierarchy

  • ResourceClient
    • WebhookClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

delete

  • delete(): Promise<void>

dispatches

get

  • get(): Promise<undefined | Webhook>

test

update

  • update(newFields): Promise<Webhook>