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 723ec23
Browse filesBrowse the repository at this point in the historyBrowse files
refactor!: re-use apify-client models/literals instead of SDK duplicates
Drop SDK-side model/literal classes that the apify-client v3 already provides
to keep the SDK from drifting out of sync with the API schema:
- `apify.Webhook` is now an alias for `apify_client._models.WebhookRepresentation`.
- `ActorPermissionLevel`, `WebhookCondition`, `WebhookCreate`, `WebhookRepresentation`
are re-exported from `apify` for convenience.
- `Actor.add_webhook` takes a `WebhookCreate` instance instead of the SDK
`Webhook` plus separate kwargs; this also fixes a silent bug where
`headers_template` was discarded when forwarding to the API.
- Internal manual webhook serialization in `Actor.start/call/call_task` was
dropped — the client v3 accepts `WebhookRepresentation` directly.
- `RequestQueueStats` in storage_clients re-exports the client model (fields
are now `int | None`; arithmetic in tests guarded with `or 0`).
- Deleted unused dead code: `ProlongRequestLockResponse`, `KeyValueStoreKeyInfo`,
`KeyValueStoreListKeysPage`, and the now-empty `apify/_models.py` module.
`PricingModel` Literal moved to `_charging.py` (its only consumer).
BREAKING CHANGE: `Actor.add_webhook` signature changed; `apify.Webhook` no
longer has all the optional fields it used to expose.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v3.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,41 @@ 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
+
70
105
## Removed Actor.config property
71
106
-`Actor.config` property has been removed. Use `Actor.configuration` instead.
0 commit comments