Skip to main content

What Are Webhooks?

Instead of polling for prediction results, you can provide a webhook_url when creating a prediction. each::labs will POST the result to your URL when the prediction completes.
Currently, webhooks are only supported for Workflows V2. Support for other services is being expanded.

How It Works

1

Provide a webhook URL

Include webhook_url (and optionally webhook_secret) when creating a prediction.
2

Prediction runs

The model processes your input asynchronously.
3

Result delivered

When complete, each::labs POSTs the result to your webhook URL.

Setting Up Webhooks

curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "model": "flux-1-1-pro",
    "version": "1.0.0",
    "input": {"prompt": "A mountain landscape"},
    "webhook_url": "https://your-app.com/webhooks/prediction",
    "webhook_secret": "whsec_your_secret_key"
  }'

Retry Behavior

Failed webhook deliveries are automatically retried with exponential backoff. You can track delivery attempts using the Get Webhook endpoint.

Delivery Attempt Statuses

StatusDescription
PENDINGDelivery is queued
SUCCESSDelivered successfully (2xx response)
FAILEDDelivery failed (timeout, non-2xx, or connection error)

Webhook Endpoints

MethodPathDescription
GET/v1/webhooksList all webhooks
GET/v1/webhooks/{execution_id}Get webhook details with delivery attempts
Last modified on March 3, 2026