Webhooks
Webhooks provide a way for notifications to be delivered to an external web server when a Sieve job completes.
About webhooks
As an alternative to polling the Sieve API for a job to complete, webhooks allow Sieve to notify your API when results are ready. This eliminates unnecessary polling requests, and can get results back faster. In addition, webhooks can be triggered by the Sieve website, which can enable complex workflows with an accessible interface.
Webhooks in Sieve are delivered as POST requests. They are retried up to ten times using exponential backoff until a 200 status code is received.
Event types
The following is a full list of all webhook event types. Click the events to see the exact response payload.
Event | Description |
---|---|
job.start | Occurs when a job starts. |
job.complete | Occurs when a job completes, errors, or is cancelled. |
job.complete.no_output | Occurs when a job completes, errors, or is cancelled — excludes the output payload from the response. |
job.new_output | Occurs when a job produces a new output. |
Using webhooks via the HTTP API
The website webhook.site provides a great way to test webhooks. Copy the unique URL presented to you on the website.
Submit a new job by sending a POST request to the /v2/push
endpoint:
Once the job completes, you’ll receive a notification on webhook.site with the output of the job.
Using webhooks via the HTTP API
The website webhook.site provides a great way to test webhooks. Copy the unique URL presented to you on the website.
Submit a new job by sending a POST request to the /v2/push
endpoint:
Once the job completes, you’ll receive a notification on webhook.site with the output of the job.
Using webhooks via the Python client
Webhooks can also be set via the Python client with the webhooks
parameter.
The code will run as usual, with the added benefit of a webhook being triggered once the job is complete.
If a list of webhooks is specified via the REST API or Python client, this will override any webhooks set on the UI.