Webhooks

Webhooks provide an easy and reliable way to configure the Apify platform to carry out an action (e.g. a HTTP request to another service)
when a certain system event occurs. For example, you can use webhooks to start another actor when an actor run finishes or fails.

The webhook is defined by the event that triggers the webhook and action that is performed on behalf of the event.

Events

Webhooks are currently available for actor run events, with new types in the pipeline.

Actor run

Actor run events are triggered when an actor run gets created or transitions into a new state.
Webhook can be defined for all runs of an actor at its detail page or for a
specific actor task at its detail page. In that case, the webhook is performed
only for runs started for that task.

ACTOR.RUN.CREATED - New actor run has been created.

ACTOR.RUN.SUCCEEDED - Actor run finished with status SUCCEEDED

ACTOR.RUN.FAILED - Actor run finished with status FAILED

ACTOR.RUN.ABORTED - Actor run finished with status ABORTED

ACTOR.RUN.TIMEDOUT - Actor run finished with status TIMEDOUT

Actions

Currently, the HTTP request can be performed on behalf of an event. New actions will come later.

HTTP request

This action is performed by the HTTP POST request to the provided URL with JSON payload containing info about the event
and the object of the actor run:

Ad hoc webhooks

An ad hoc webhook is a one-time webhook created for a certain actor run when starting the run using Apify
API. It's triggered at most once when the given run transitions into
the appreciated state.
Ad hoc webhooks can be defined using a URL parameter webhooks added to the API endpoint
that starts an actor or actor task: