Skip to main content
Webhooks let you build event-driven integrations with Avala. Instead of polling the API for changes, register an HTTPS endpoint and Avala will send an HTTP POST whenever a relevant event occurs.

Quick Setup

The webhook secret is only returned in the creation response. Store it securely — you’ll need it to verify signatures.

Events

Payload Format

Every webhook delivery is a JSON POST with three custom headers: The request body contains the event payload as JSON. The payload structure matches the corresponding API resource.

export.completed / export.failed

dataset.created / dataset.updated

dataset.deleted

task.completed

Verifying Signatures

Every delivery is signed with HMAC-SHA256 using the subscription’s secret. Always verify signatures before processing a webhook to ensure the request came from Avala. The signature is computed over the JSON-serialized payload with deterministic formatting (compact separators, sorted keys):

Python

TypeScript

Always use constant-time comparison (hmac.compare_digest in Python, timingSafeEqual in Node.js) to prevent timing attacks.

Example: Flask Webhook Handler

A complete Flask application that receives and verifies Avala webhooks:

Example: Express Webhook Handler

Retry Policy

If your endpoint doesn’t respond with a 2xx status code, Avala retries with exponential backoff: After 5 failed retries, the delivery is marked as failed. Client errors (4xx) are treated as permanent failures and are not retried.

Delivery Log

Every delivery attempt is recorded. You can inspect delivery history through the API:
Each delivery record includes: Delivered entries are automatically cleaned up after 30 days. Failed entries are retained for 90 days.

Managing Webhooks

API Endpoints

Create a Subscription

A signing secret is auto-generated if you don’t provide one. You can also pass your own:

Test a Webhook

Send a ping event to verify your endpoint is reachable:

Testing During Development

  1. Use a tunnel like ngrok to expose a local server:
    Copy the HTTPS URL and use it as your webhook target_url.
  2. Send a test ping via the API to verify connectivity:
  3. Check the delivery log to inspect payloads, response codes, and timing:

Security

  • HTTPS required — Webhook endpoints must use HTTPS.
  • SSRF protection — Avala blocks delivery to private IPs, loopback addresses, and cloud metadata endpoints.
  • No redirects — Webhook delivery does not follow HTTP redirects.
  • Encrypted secrets — Webhook secrets are encrypted at rest and never exposed after creation.
  • One subscription per URL — Each organization can have at most one subscription per target URL.