Skip to main content
Webhooks let you receive results from async Universal AI jobs via HTTP callbacks instead of polling. When a job completes, Eden AI sends a signed POST request to the URL you provided.

How It Works

  1. Submit an async request with a webhook_receiver in the payload.
  2. Eden AI processes the job in the background.
  3. On completion, Eden AI sends a signed POST request to your webhook_receiver with the result.

Request Parameters

Webhook Headers

Every webhook request Eden AI sends includes these headers:

Webhook Payload

Signature Verification

Every webhook is signed with Eden AI’s RSA private key so you can verify it was not forged or tampered with in transit. Verify each request against Eden AI’s public key below. Save it as edenai_webhook_rsa.pub.pem next to your handler — this is the file the examples load.
edenai_webhook_rsa.pub.pem
The signature is built as follows:
  1. The payload is serialized to canonical JSON: keys sorted alphabetically, 2-space indent, UTF-8 with non-ASCII characters left as-is (not \u-escaped). This is exactly orjson.dumps(payload, option=OPT_INDENT_2 | OPT_SORT_KEYS).
  2. sha256(canonical_json_bytes) is computed and its hex digest (a 64-character string) is taken.
  3. That hex digest string is signed with RSA PKCS1 v1.5 over SHA-256.
  4. The signature is hex-encoded and sent in the X-Edenai-Signature header.
The delivered request body is compact JSON, so you must re-serialize it into the canonical form above before hashing — do not hash the raw body, and do not re-serialize with default formatting.

Example

Dependencies: pip install requests flask pycryptodome orjsonSending the request:
Receiving and verifying the webhook (Flask):
Do not re-serialize the parsed JSON with defaults (e.g. JSON.stringify(obj) or json.dumps(obj) without sort_keys=True, indent=2) — any difference in spacing, key ordering, or unicode escaping will make the signature fail to verify.Number formatting differs across languages too: a whole-number float in the payload (for example a 1.0 confidence score) serializes as 1.0 on the Eden AI side but as 1 with JavaScript’s JSON.stringify, which breaks verification. If your payloads can contain such values, verify from a Python service or normalize the numbers before hashing.

Retry Behavior

Eden AI retries webhook delivery up to 3 times with exponential backoff between attempts (max delay 30 s) when the receiver returns a transient failure. Each attempt has a per-request timeout of 30 s.
Keep your webhook handler idempotent — Eden AI may deliver the same job_id more than once if a retry races with a slow response from your server.

Webhook vs Polling

Next Steps

Monitoring

Track async job results and API usage in the dashboard