Skip to main content

WebhookCollectionClientAsync

apify_client.clients.WebhookCollectionClientAsync

Async sub-client for manipulating webhooks.

Index

Methods

Methods

create

  • async create(*, event_types, request_url, payload_template, actor_id, actor_task_id, actor_run_id, ignore_ssl_errors, do_not_retry, idempotency_key, is_ad_hoc): dict
  • Create a new webhook.

    You have to specify exactly one out of actor_id, actor_task_id or actor_run_id.

    https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/create-webhook


    Parameters

    • event_types: list[WebhookEventType]keyword-only

      List of event types that should trigger the webhook. At least one is required.

    • request_url: strkeyword-only

      URL that will be invoked once the webhook is triggered.

    • payload_template: str | None = Nonekeyword-only

      Specification of the payload that will be sent to request_url

    • actor_id: str | None = Nonekeyword-only

      Id of the actor whose runs should trigger the webhook.

    • actor_task_id: str | None = Nonekeyword-only

      Id of the actor task whose runs should trigger the webhook.

    • actor_run_id: str | None = Nonekeyword-only

      Id of the actor run which should trigger the webhook.

    • ignore_ssl_errors: bool | None = Nonekeyword-only

      Whether the webhook should ignore SSL errors returned by request_url

    • do_not_retry: bool | None = Nonekeyword-only

      Whether the webhook should retry sending the payload to request_url upon failure.

    • idempotency_key: str | None = Nonekeyword-only

      A unique identifier of a webhook. You can use it to ensure that you won’t create the same webhook multiple times.

    • is_ad_hoc: bool | None = Nonekeyword-only

      Set to True if you want the webhook to be triggered only the first time the condition is fulfilled. Only applicable when actor_run_id is filled.

    Returns dict

    The created webhook

list

  • async list(*, limit, offset, desc): ListPage[dict]

  • Parameters

    • limit: int | None = Nonekeyword-only

      How many webhooks to retrieve

    • offset: int | None = Nonekeyword-only

      What webhook to include as first when retrieving the list

    • desc: bool | None = Nonekeyword-only

      Whether to sort the webhooks in descending order based on their date of creation

    Returns ListPage[dict]

    The list of available webhooks matching the specified filters.