Skip to main content
Batch Webhooks send one HTTP POST to your root-level webhook_url whenever an accepted batch item reaches a successful or failed terminal state.
Batch Webhooks are separate from the single-task callback_url workflow. They use an account-level signing secret and X-Apixo-Signature verification.

Lifecycle

No separate webhook account is required. The secret belongs to the account that owns the authenticated API key, and API keys under the same account share that account-level signing secret.

Step 1: Get the signing secret

The secret is a shared signing secret:
  • APIXO uses it to calculate an HMAC-SHA256 signature for each webhook request.
  • Your service uses it to verify that the request came from APIXO and that its body was not modified.
  • Do not send the secret back in a batch request or webhook response.
  • The webhook body is not an encrypted payload. HTTPS encrypts the transport; the secret authenticates the sender and protects message integrity.
  • Store the secret only in a server-side KMS, Secret Manager, or protected environment variable. Never expose it in a client application, source repository, or logs.

Step 2: Submit a batch with webhook_url

Set webhook_url at the root of the batch request:
webhook_url must be a publicly reachable HTTPS address. Each batch retains its signing-secret version, so a secret rotation does not break verification for already accepted batches.

Step 3: Receive a webhook

APIXO sends these headers:

Successful task payload

Failed task payload

Webhook payload fields

Step 4: Verify, deduplicate, and respond

The signed bytes are exactly:
Calculate the signature as:
rawRequestBody is the original HTTP body bytes. Do not parse, format, or serialize JSON again before signature verification.

Node.js / Express verification example

Process every event in this order:
  1. Preserve the raw body and read the three X-Apixo-* headers.
  2. Check that the timestamp is within your allowed window; this example uses five minutes.
  3. Calculate the HMAC with the account secret and compare signatures in constant time.
  4. Persist and deduplicate X-Apixo-Event-Id.
  5. Only then parse JSON, update orders, or enqueue downstream work.
  6. Return any HTTP 2xx once the event is safely recorded.
Do not verify a parsed or reserialized JSON body; even a byte-level formatting change invalidates the signature. Deduplicate by X-Apixo-Event-Id, not only by taskId.

Retry and recovery

  • Any HTTP 2xx is a successful delivery.
  • A non-2xx response, network error, or timeout schedules a retry.
  • Retry intervals are 1 minute → 5 minutes → 30 minutes → 2 hours → 6 hours. Including the first delivery, there are at most six attempts.
  • Keep Batch Status and Single Tasks > Status Task as recovery and reconciliation paths.

Rotate or revoke a secret

Rotate

Newly submitted batches use the new secret. Already accepted batches continue using the previous secret during a seven-day grace period, so receivers should support both secrets during that time.

Emergency revoke

Revocation suppresses all outstanding deliveries for the account and revokes existing secrets. To resume batch webhooks, get a new secret and submit new batches with webhook_url.

Production checklist

  • Your endpoint is public HTTPS and returns a 2xx quickly.
  • The signing secret is stored securely and never exposed to client code or logs.
  • The receiver verifies the raw body before parsing JSON.
  • The receiver checks timestamp freshness and persistently deduplicates X-Apixo-Event-Id.
  • Slow work runs in a queue or worker rather than blocking the HTTP response.
  • You have Batch Status or Status Task reconciliation for missed events.