Skip to main content
Instead of polling for task updates, you can configure a callback_url on each task to receive push notifications when the task status changes.

Setting up webhooks

Add a callback_url and callback_secret when creating a task:
The callback_url must be a publicly accessible HTTPS endpoint. The callback_secret is used to sign the webhook payload so you can verify it is authentic.

Webhook payload

When a task status changes, HumCLI sends a POST request to your callback URL:

Headers

Verifying signatures

Always verify the X-Signature header to ensure the webhook is from HumCLI and has not been tampered with.
Always verify signatures in production. Without verification, anyone could send fake webhook events to your endpoint.

Event types

Webhooks fire on every status transition:

Best practices

Return 200 quickly

Your webhook endpoint should return a 200 status code within 5 seconds. Do heavy processing asynchronously:

Handle duplicate events

Network issues can cause the same event to be delivered more than once. Use the task_id + status combination as an idempotency key:

Use HTTPS

Your callback_url must use HTTPS. HTTP endpoints are rejected.

Keep your secret secure

Store the callback_secret in your secrets manager (AWS Secrets Manager, Vault, environment variables). Never hardcode it.

Debugging webhooks

During development, you can use tools like ngrok or smee.io to expose a local endpoint:
Then use the ngrok URL as your callback_url:

Next steps

Sandbox Mode

Test your webhook integration with simulated events.

Error Reference

Handle errors gracefully in your integration.