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

# Use Kling callback URLs

> Configure Kling callback_url in CometAPI to receive async video/image task status updates and results payloads (submitted to succeed/failed).

Use `callback_url` on Kling async tasks when you want push delivery instead of pure polling.

## Where to use it

* Text-to-video and image-to-video tasks
* Avatar and video-effects tasks
* Other Kling async routes that expose an optional `callback_url` field

## Delivery behavior

* Kling posts to your callback endpoint whenever task status changes
* Common statuses are `submitted`, `processing`, `succeed`, and `failed`
* The payload can include `task_result.images` or `task_result.videos` depending on the task type
* Keep manual polling available for reconciliation, retries, or missed webhook handling

## Integration checklist

* Use an HTTPS callback endpoint you control
* Accept repeated status updates for the same task id
* Treat webhook delivery as asynchronous and eventually consistent
* Persist the final asset URLs quickly if your workflow needs durable storage

```jsonc theme={null}
{
  "task_id": "string",
  "task_status": "string",
  "task_status_msg": "string",
  "created_at": 1722769557708,
  "updated_at": 1722769557708,
  "task_result": {
    "images": [
      {
        "index": 0,
        "url": "https://example.com/generated-image.png"
      }
    ],
    "videos": [
      {
        "id": "string",
        "url": "https://example.com/generated-video.mp4",
        "duration": "5"
      }
    ]
  }
}
```
