# list_callbacks

> List callback deliveries

`GET /api/v2/callbacks`

Needs the `results:read` scope.

- Auth: API key (Authorization: Bearer)
- Key scope needed: `results:read`
- Raw spec: https://app.diffusr.ai/api/v2/openapi.json

## Query

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | no | Default 20. |
| `cursor` | string | no | The next_cursor of the last page. |

## Example

**cURL**

```bash
curl "https://app.diffusr.ai/api/v2/callbacks?limit=20" \
  -H "Authorization: Bearer $DIFFUSR_KEY"
```

**TypeScript**

```ts
import { Diffusr } from "diffusr";

const d = new Diffusr(); // reads DIFFUSR_KEY
const log = await d.listCallbacks({ limit: 20 });
console.log(log);
```

**Python**

```python
from diffusr import Diffusr

d = Diffusr()  # reads DIFFUSR_KEY
log = d.list_callbacks(limit=20)
print(log)
```

## Response

### 200 ApiCallbackDeliveryList

Your callback delivery log, newest first.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `deliveries` | object[] | yes | Newest first. |
| `deliveries[].event_id` | string | yes |  |
| `deliveries[].type` | "result.finished" | yes |  |
| `deliveries[].result_id` | string | yes | The job this event is about. |
| `deliveries[].url` | string | yes |  |
| `deliveries[].status` | "PENDING" \| "DELIVERED" \| "FAILED" | yes | PENDING = will be tried (again); DELIVERED = your server answered 2xx; FAILED = we gave up. |
| `deliveries[].attempts` | integer | yes |  |
| `deliveries[].last_status_code` | integer | no |  |
| `deliveries[].last_error` | string | no |  |
| `deliveries[].last_attempt_at` | string | no |  |
| `deliveries[].next_attempt_at` | string | no |  |
| `deliveries[].delivered_at` | string | no |  |
| `deliveries[].created_at` | string | yes |  |
| `deliveries[].test` | true | no |  |
| `next_cursor` | string | no | Pass as `cursor` for the next page. Absent on the last page. |

## Errors

Every error body is `{ error, code, request_id, ... }`. See https://diffusr.ai/docs/errors.

- 401: Missing, wrong, revoked or expired API key (code UNAUTHORIZED, KEY_REVOKED, KEY_EXPIRED).
- 403: The key may not do this (SCOPE_DENIED, MODEL_NOT_ALLOWED, TEST_MODE_UNSUPPORTED, ACCOUNT_BLOCKED, allowance_exceeded).
- 422: The request is not valid (VALIDATION_FAILED, INVALID_JSON, PREFLIGHT_FAILED, CALLBACK_URL_INVALID, REFERENCE_*). `issues` lists each problem. Nothing was charged.
- 429: Too many requests or jobs (RATE_LIMITED, CONCURRENCY_LIMIT, UPLOAD_QUOTA, …). Wait Retry-After seconds, then retry.
- 500: Our fault (INTERNAL_ERROR). Quote request_id to support.
- 503: Paused or busy (API_PAUSED, MODEL_PAUSED, PROVIDER_PAUSED, PROVIDER_BUSY, UNAVAILABLE). Wait Retry-After seconds, then retry.

## Charges

Free. No credits are spent.
