upsert_webhook_subscriptions

toloka.client.TolokaClient.upsert_webhook_subscriptions | Source code

upsert_webhook_subscriptions(self, subscriptions: List[WebhookSubscription])

Creates subscriptions.

You can create a subscription and receive notifications about events. For example, when a pool is closed or a task's status changes, Toloka can send you a notification.

Parameters description

ParametersTypeDescription
subscriptionsList[WebhookSubscription]

A list of subscriptions to be created.

Examples:

result = toloka_client.upsert_webhook_subscriptions([
{
'webhook_url': 'https://awesome-requester.com/toloka-webhook',
'event_type': toloka.client.webhook_subscription.WebhookSubscription.EventType.ASSIGNMENT_CREATED,
'pool_id': '121212'
},
{
'webhook_url': 'https://awesome-requester.com/toloka-webhook',
'event_type': toloka.client.webhook_subscription.WebhookSubscription.EventType.POOL_CLOSED,
'pool_id': '121212'
}
])
print(len(result.items))

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming