callback_url on each task to receive push notifications when the task status changes.
Setting up webhooks
Add acallback_url and callback_secret when creating a task:
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 theX-Signature header to ensure the webhook is from HumCLI and has not been tampered with.
Event types
Webhooks fire on every status transition:Best practices
Return 200 quickly
Your webhook endpoint should return a200 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 thetask_id + status combination as an idempotency key:
Use HTTPS
Yourcallback_url must use HTTPS. HTTP endpoints are rejected.
Keep your secret secure
Store thecallback_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:callback_url:
Next steps
Sandbox Mode
Test your webhook integration with simulated events.
Error Reference
Handle errors gracefully in your integration.