Webhook
Fires a webhook every time a task is passed as input. Returns the same task as output.

Settings

URL. The url where to send the webhook.
Auth Type. The authentication method you'd like to use. Please see this section below for more information.
Logs. Whenever a task enters the Webhook stage and a webhook is fired or an error occurs, this is logged. Clicking on Logs allows you to scrutinize logs for all webhooks, with the format: [Date][Status] external_id
Authentication Methods
No Auth
A standard POST request to your URL with the JSON event payload.
On your server, you may accept the request without verification.
Server Code Examples
Secret (X-Hub-Signature)
What we send
A POST request containing the raw body.
Header: X-Hub-Signature:
<hex-encoded HMAC-SHA1 of the raw request body using your shared secret>
How verification works
Read the raw request body bytes.
Compute
HMAC-SHA1(secret, body)
and hex-encode it.Compare the computed digest to the
X-Hub-Signature
header using a constant-time comparison.Reject if they don’t match.
Server Code Examples
Bearer Token
What we send
A POST request containing the event payload.
Header:
Authorization: Bearer <your-configured-token>
How verification works
Read the Authorization header.
Check it equals
Bearer <token-you-configured>
.Reject if missing or mismatched.
Server Code Examples
General Recommendations
Respond with a 2xx status once you’ve accepted the event; do heavy work asynchronously. This helps webhooks flow.
Log the event ID and timestamp (if present) for idempotency/retries.
Keep your secret/token out of source control and rotate regularly.
Webhook Content
Sample Webhook Output
Differences between Webhook Output and Export
The batches
property provides batches as names.
"batches": [
"Le Croissànt"
]
The batches
property provides batches as IDs.
"batches": [
"651521e299f4bf0015872c91"
]
In the webhook output, batch names are provided in the batchNames
property.
stageHistory
field contains label contents.
stageHistory
field only contains metadata, no label contents.
Webhook Errors
In case the webhook cannot be sent (e.g. Ango Hub does not receive a 200 response), Ango Hub will keep the task in the Webhook stage and display a visual warning in the Workflow editor:

To view the tasks the webhooks of which were not sent, navigate to the Tasks tab and filter by stage from the left-hand side.
To attempt to send the webhook again, click on the Webhook stage, then click on the three dots on the top right of its settings panel, and click on Re-run.
Set Up a Sample Webhook Server (X-Hub-Signature Auth Method)
This sample is a minimum server setup you can use to test whether your webhook configuration is working or not.
Run this Python script, changing
your_secret_key
with a secret key of your choice.
Install ngrok on your system. Instructions on installing ngrok can be found here.
Once ngrok is installed, from the command line/terminal, run
ngrok http 127.0.0.1:5000
You will see a screen like the following. Copy the URL highlighted in red.

Go to your Ango Hub project and set up your workflow to have a Webhook stage plugged in. In this case, for example, the Webhook stage will fire every time a labeler submits a task in the Label stage:

Click on the Webhook plugin to open its settings.
In the URL field, paste the URL we copied before, adding
/hook
at the end. For example, if the URL provided by ngrok washttps://47f2-88-243-68-208.ngrok.io
, you will paste it and add/hook
at the end, forminghttps://47f2-88-243-68-208.ngrok.io/hook
.In the Secret field, type the secret key you entered in the Python script during step 1.
Save your workflow.
In your project, perform an action which would trigger a webhook. In our example above, it would be submitting a tasl from the Label stage.
If the webhook worked correctly, you will see a 200 OK
code in the ngrok window:

And the webhook content will be sent to your server where you ran the Python script. If you ran it in PyCharm, for example, you will see the webhook contents in the Run tab:

Last updated