You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a23a8b5
Browse filesBrowse the repository at this point in the historyBrowse files
The webhook section that landed in `upgrading_to_v3.md` in 24a6fa8 described an intermediate API
(`WebhookCreate` + `WebhookCondition`) that never shipped publicly. Move the migration story
entirely into `upgrading_to_v4.md` and frame it against the actually-released v3.x `Webhook`
class: response fields dropped, `ignore_ssl_errors` / `do_not_retry` / `idempotency_key` kwargs
on `Actor.add_webhook` moved onto the `Webhook` model, and `WebhookCondition` removed.
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v3.md
-35Lines changed: 0 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,41 +67,6 @@ Some changes in the related model classes:
67
67
-`stats` field in `RequestQueueMetadata` - removed as it was unused.
68
68
-`RequestQueueHead` - replaced by `RequestQueueHeadWithLocks`.
69
69
70
-
## Webhook model changes
71
-
72
-
The SDK no longer ships its own `Webhook` Pydantic model. The webhook models from `apify-client` are now used directly:
73
-
74
-
-`apify.Webhook` is now an alias of `apify_client._models.WebhookRepresentation`. It still has the same shape used in `Actor.start`, `Actor.call`, and `Actor.call_task` (`event_types`, `request_url`, `payload_template`, `headers_template`).
75
-
-`Actor.add_webhook` now accepts an `apify.WebhookCreate` instance instead of `apify.Webhook` + separate kwargs. All fields (`ignore_ssl_errors`, `do_not_retry`, `idempotency_key`, `headers_template`, etc.) move onto the `WebhookCreate` instance. `condition` is required by the underlying type — pass `WebhookCondition()` when you do not need to scope to other resources.
from apify import Actor, WebhookCondition, WebhookCreate
92
-
93
-
await Actor.add_webhook(
94
-
WebhookCreate(
95
-
event_types=['ACTOR.RUN.FAILED'],
96
-
request_url='https://example.com',
97
-
condition=WebhookCondition(),
98
-
idempotency_key='my-key',
99
-
)
100
-
)
101
-
```
102
-
103
-
`WebhookCondition`, `WebhookCreate`, `WebhookRepresentation`, `WebhookEventType`, and `ActorPermissionLevel` are all re-exported from `apify` for convenience.
104
-
105
70
## Removed Actor.config property
106
71
-`Actor.config` property has been removed. Use `Actor.configuration` instead.
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v4.md
+15-35Lines changed: 15 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,31 +12,22 @@ Support for Python 3.10 has been dropped. The Apify Python SDK v4.x now requires
12
12
13
13
## Webhook API simplified
14
14
15
-
The webhook API has been unified behind a single SDK-level `Webhook` class. The low-level client models that v3 re-exported (`WebhookCreate`, `WebhookCondition`, `WebhookRepresentation`) are no longer part of the public `apify` namespace.
15
+
The `Webhook` model has been slimmed down to only the fields a user actually sets when defining a webhook. Server-populated response fields (`id`, `created_at`, `modified_at`, `user_id`, `is_ad_hoc`, `condition`, `last_dispatch`, `stats`) and the unused `WebhookCondition` helper class have been removed from the public namespace. The retry and idempotency kwargs that used to live on `Actor.add_webhook` have moved onto the `Webhook` instance itself, so a single object captures the full webhook definition.
16
16
17
-
The public `apify` namespace now exposes only:
17
+
### `Actor.add_webhook` — kwargs moved onto `Webhook`
18
18
19
-
-`apify.Webhook` — a new SDK-level model covering both ad-hoc (`Actor.start` / `Actor.call`) and persistent (`Actor.add_webhook`) use cases.
20
-
-`apify.WebhookEventType` — unchanged.
21
-
22
-
`apify.WebhookCondition`, `apify.WebhookCreate`, `apify.WebhookRepresentation`, and `apify.ActorPermissionLevel` have been removed from the public namespace. If you still need them, import directly from `apify_client._models` / `apify_client._literals`.
23
-
24
-
### `Actor.add_webhook`
25
-
26
-
`Actor.add_webhook` now takes the new `Webhook` instance directly. The `condition` argument is gone — the SDK automatically binds the webhook to the current Actor run.
19
+
`ignore_ssl_errors`, `do_not_retry`, and `idempotency_key` were previously kwargs on `Actor.add_webhook`. In v4 they are fields on the `Webhook` model.
27
20
28
21
**Before (v3.x):**
29
22
30
23
```python
31
-
from apify import Actor, WebhookCondition, WebhookCreate
### `idempotency_key` kwarg on `Actor.add_webhook` is deprecated
58
-
59
-
The v2-style `Actor.add_webhook(webhook, idempotency_key=...)` form still works but emits a `DeprecationWarning` and will be removed in v5.0.0. Set `idempotency_key` on the `Webhook` instance instead.
60
-
61
-
### Ad-hoc webhooks on `Actor.start` / `Actor.call` / `Actor.call_task`
62
-
63
-
The `webhooks` argument on these methods still accepts a `list[Webhook]`, but `Webhook` is now the new SDK class rather than an alias for `WebhookRepresentation`. The accepted fields (`event_types`, `request_url`, `payload_template`, `headers_template`) are unchanged, so most call sites just need to update the import.
50
+
The `idempotency_key` kwarg form on `Actor.add_webhook` still works for one more release but emits a `DeprecationWarning` and will be removed in v5.0.0. The `ignore_ssl_errors` and `do_not_retry` kwargs have been removed outright — set them on the `Webhook` instance.
64
51
65
-
**Before (v3.x):**
66
-
67
-
```python
68
-
from apify import Actor, Webhook
52
+
### `WebhookCondition` removed from public namespace
`apify.WebhookCondition` is no longer exported. It was only used as a placeholder argument to `Actor.add_webhook`; the SDK now binds the webhook to the current Actor run internally, so you do not need to construct a condition at all.
75
55
76
-
**Now (v4.0):**
56
+
### Ad-hoc webhooks on `Actor.start` / `Actor.call` / `Actor.call_task`
77
57
78
-
Same code — only the underlying class has changed. The import path remains `from apify import Webhook`.
58
+
The `webhooks` argument on these methods still accepts `list[Webhook]` and the fields used at the call site (`event_types`, `request_url`, `payload_template`, `headers_template`) are unchanged. No migration is needed for typical call sites.
79
59
80
60
## `Actor.new_client` retry and timeout parameters
0 commit comments