Skip to main content
Instead of polling for job status, provide a callback_url when starting a generation to receive a webhook notification when the job completes or fails.

Using Webhooks

Include the callback_url parameter in your generation request:
curl -X POST https://api.modal.beeble.ai/v1/switchx/generations \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "generation_type": "video",
    "source_uri": "beeble://uploads/upload_xxx/source.mp4",
    "reference_image_uri": "https://example.com/ref.png",
    "alpha_mode": "auto",
    "callback_url": "https://your-server.com/webhook"
  }'

Webhook Payload

When the job completes or fails, a POST request will be sent to your callback_url. Success:
{
    "id": "swx_abc123",
    "status": "completed",
    "output": {
        "render": "https://cdn.beeble.ai/.../render.mp4",
        "source": "https://cdn.beeble.ai/.../source.mp4",
        "alpha": "https://cdn.beeble.ai/.../alpha.mp4"
    },
    "completed_at": "2026-02-23T10:05:00Z"
}
Failure:
{
    "id": "swx_abc123",
    "status": "failed",
    "completed_at": "2026-02-23T10:05:00Z",
    "error": "Processing failed"
}
Your webhook endpoint should return a 2xx status code to acknowledge receipt.