> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aigenstudio.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive signed image job events from AI Gen Studio.

Add `webhook_url` to a create request when you want AI Gen Studio to notify your backend about job progress.

```json theme={"theme":{"light":"github-light","dark":"github-light"}}
{
  "input": [
    {
      "image_url": "https://client.example/images/sku-001.jpg",
      "external_id": "sku-001"
    }
  ],
  "creative": {
    "platform": "Instagram",
    "goal": "product launch",
    "style": "premium campaign"
  },
  "webhook_url": "https://client.example/webhooks/aigenstudio"
}
```

Webhook URLs must use HTTPS.

## Headers

Webhook deliveries include:

```txt theme={"theme":{"light":"github-light","dark":"github-light"}}
X-Aigen-Signature
X-Aigen-Timestamp
X-Aigen-Event-Id
```

Verify the signature before trusting the payload.

## Event types

```txt theme={"theme":{"light":"github-light","dark":"github-light"}}
image_api.result.completed
image_api.result.failed
image_api.job.completed
image_api.job.failed
image_api.job.partially_completed
```

## Example payload

```json theme={"theme":{"light":"github-light","dark":"github-light"}}
{
  "id": "evt_01jz...",
  "type": "image_api.result.completed",
  "created_at": "2026-06-28T10:30:00.000Z",
  "job": {
    "id": "f693e677-51e0-4ebe-80a0-ad06acbc4443",
    "api": "ad_creative",
    "status": "processing",
    "sandbox": false
  },
  "result": {
    "id": "0df8a...",
    "external_id": "sku-001",
    "status": "completed",
    "result_url": "https://cdn.aigenstudio.app/outputs/sku-001.png",
    "thumbnail_url": "https://cdn.aigenstudio.app/outputs/sku-001-thumb.png"
  }
}
```

## Retries

AI Gen Studio retries failed webhook deliveries with bounded retry attempts. Return any `2xx` response after your backend stores the event successfully.

Use `GET /jobs/{jobId}` as the final source of truth if webhook delivery is delayed.
