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

# Webhooks

> Get notified when a job reaches a terminal state.

Instead of polling, you can have BananaHub call a URL when a job finishes (`done` or `failed`).

## Two ways to configure

<CardGroup cols={2}>
  <Card title="Per-request" icon="arrow-up-from-bracket">
    Pass `callback_url` in the body of a generation request. Applies to that job only.
  </Card>

  <Card title="Account-wide" icon="gear">
    Register a default webhook in the **web panel**. Called automatically for all jobs.
  </Card>
</CardGroup>

<Info>
  A per-request `callback_url` **takes precedence** over the account webhook for that request.
</Info>

## Per-request example

```jsonc theme={null}
{
  "prompt": "a red panda astronaut floating in a nebula",
  "aspect_ratio": "16:9",
  "resolution": "2K",
  "callback_url": "https://example.com/webhooks/banana"
}
```

The webhook is called once the job reaches a terminal state, carrying the same payload shape as [`GET /jobs/{job_id}`](/api-reference/get-job).
