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

# Create Disposition Backfill

> Run a published disposition on an agent's past calls.

### Overview

> [!NOTE]
>
> Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`.

Runs one published version of a disposition on calls the agent has already taken. Poll [Get Disposition Backfill](https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-backfills-job-id.md) for progress, then read results with [List Call Disposition Runs](https://docs.bland.ai/api-v2/get/agents-id-dispositions-call-runs.md), where they replace each call's earlier result. Calls this version already completed are skipped, and no webhooks are sent.

Backfills bill like production runs. Price one first with [Estimate Disposition Cost](https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-estimates.md).

Requires an admin, owner, operator, or prompter role.

### Headers

**authorization** `string` *required*

Your API key for authentication. Use a full-access key.

### Path Parameters

**agent\_id** `string` *required*

The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization.

**disposition\_id** `string` *required*

The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent.

### Body Parameters

Send `window` or `callIds`, not both. Mixing them, or adding unknown fields, returns `400 BAD_REQUEST` with the message `Invalid request body`.

**versionId** `string`

The version to run. Defaults to the published version, and returns `409 CONFLICT` if the disposition has never been published. Older published versions work; a draft returns `400`. Returns `404 Disposition version not found` if it does not belong to this disposition.

**window** `object`

The date range to cover, as `{ "start", "end" }`. Both are ISO 8601 timestamps with a time zone, such as `2026-08-01T00:00:00Z`. `start` is included and `end` is not. The range can span at most 92 days and start at most 400 days ago.

Completed calls of this agent with a non-zero duration are eligible. Simulations are not. Returns `400` if no calls are eligible, or if more than 500,000 are.

**sampling** `number` (default: 1)

Fraction of the eligible calls in `window` to run, from `0.0001` to `1`, with at most five decimals. The same calls are picked each time.

**callIds** `array`

1 to 500 unique call UUIDs. Every call must belong to this agent and be a completed production call with non-zero duration, otherwise `400` with the message `One or more selected calls are not eligible completed production calls for this agent`. Calls excluded for compliance reasons return `400` listing the offending IDs. The `window` date limits apply here too.

### Response

Returns `201` on success with the backfill in `queued` status. Returns `409 CONFLICT` if this version already has a `queued` or `running` backfill. Returns `403 FORBIDDEN` if backfills are off for your organization. Returns `402 PAYMENT_REQUIRED` if your organization pays from a credit balance and the estimated cost is more than the balance left after your other running backfills. Returns `503 SERVICE_UNAVAILABLE` if the backfill could not be started; the request can be retried. An organization can make 10 requests per hour, counting backfill estimates.

**data** `object`

The new backfill.

**backfill object**

**id** `string`

Unique identifier for the backfill. Pass it as `{job_id}` to the other backfill endpoints.

**dispositionId** `string`

The disposition being backfilled.

**versionId** `string`

The version that runs on the calls.

**status** `string`

`queued`, `running`, `complete`, `partial`, `failed`, or `cancelled`. `complete` means no call failed. `partial` means some calls failed, or the backfill reached its 24 hour deadline. `failed` means every call failed, or the backfill could not run.

**window** `object`

`{ "start", "end" }` as ISO 8601 timestamps. For a `callIds` backfill, the range that covers the selected calls.

**sampling** `number`

Fraction of eligible calls selected. Always `1` for a `callIds` backfill.

**requestedSize** `number`

Eligible calls counted when the backfill was created.

**resolvedSize** `number`

Calls the backfill selected, before exclusions. `0` until it finishes.

**completedSize** `number`

Calls that completed. Counted live while the backfill is `queued` or `running`.

**failedSize** `number`

Calls that failed or were cancelled. Counted live while the backfill is `queued` or `running`.

**excluded** `object`

Selected calls that were skipped, counted by reason. Empty until the backfill starts.

* `already_scored`: this version already has a completed run on the call.
* `in_flight`: this version is already running on the call.
* `sensitive`: the call is excluded for compliance reasons.
* `fenced`: the call's data is past its retention limit.
* `malformed`: the call's ID is not a UUID.

**progress** `object`

Progress counters. The shape can change.

**estimatedCostUsd** `string | null`

Expected cost in USD when the backfill was created, as a decimal string.

**actualCostUsd** `string | null`

What the backfill cost in USD, as a decimal string. `null` until it finishes.

**deadlineAt** `string | null`

ISO 8601 time the backfill stops, 24 hours after it starts. `null` until it starts.

**errorCode** `string | null`

Why the backfill stopped early, for example `backfill_cancelled`, `backfill_deadline`, `backfill_execution_failed`, `billing_not_allowed`, or `credit_limit_reached`. `null` otherwise.

**errorMessage** `string | null`

Human-readable version of `errorCode`.

**createdAt** `string`

ISO 8601 timestamp of creation.

**startedAt** `string | null`

ISO 8601 timestamp of when it started running.

**completedAt** `string | null`

ISO 8601 timestamp of when it finished.

**cohortId** `string`

Identifier for the selected calls.

**rollupDays** `object | null`

Status of the analytics update for the covered days. The shape can change.

**errors** `null | array`

`null` on success, or a list of error objects if the request failed.

```bash Date range theme={null}
curl -X POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/backfills \
  -H "authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "window": {
      "start": "2026-08-01T00:00:00Z",
      "end": "2026-09-01T00:00:00Z"
    },
    "sampling": 0.25
  }'
```

```bash Specific calls theme={null}
curl -X POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/backfills \
  -H "authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "callIds": [
      "5eb69986-532c-40d5-90e0-74ab82f8accf",
      "27260466-a59d-4191-b8cb-8418333a6540"
    ]
  }'
```

```json Response theme={null}
{
  "data": {
    "id": "15e88951-409c-4150-ba37-89306889d9e6",
    "dispositionId": "eea01870-c34d-4d6b-a647-c8f5cfd9d8b6",
    "versionId": "1827ae35-b0c0-4dad-8628-e3e564fd14cf",
    "cohortId": "78200246-0002-4b57-ba00-58e0d4d4623f",
    "status": "queued",
    "window": {
      "start": "2026-08-01T00:00:00.000Z",
      "end": "2026-09-01T00:00:00.000Z"
    },
    "sampling": 0.25,
    "requestedSize": 1840,
    "resolvedSize": 0,
    "completedSize": 0,
    "failedSize": 0,
    "excluded": {},
    "progress": {},
    "estimatedCostUsd": "42.136",
    "actualCostUsd": null,
    "rollupDays": null,
    "deadlineAt": null,
    "errorCode": null,
    "errorMessage": null,
    "createdAt": "2026-09-10T18:40:03.512Z",
    "startedAt": null,
    "completedAt": null
  },
  "errors": null
}
```

```json Already Running theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "CONFLICT",
      "message": "A backfill of this version is already queued or running — cancel it or wait for it to finish"
    }
  ]
}
```

```json Never Published theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "CONFLICT",
      "message": "This disposition has never been published — publish a version before backfilling"
    }
  ]
}
```

```json No Eligible Calls theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "BAD_REQUEST",
      "message": "No completed calls of this agent fall in the window"
    }
  ]
}
```

```json Not Enough Credits theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "PAYMENT_REQUIRED",
      "message": "This backfill is estimated at $42.1360, which exceeds the organization's available balance: $30.0000 balance − $0.0000 committed to other running backfills = $30.0000 available. Add credits, wait for a running backfill to finish, or try again."
    }
  ]
}
```

```json Not Enabled theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "FORBIDDEN",
      "message": "Backfills are not enabled for this organization"
    }
  ]
}
```

```json Rate Limited theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "TOO_MANY_REQUESTS",
      "message": "Too many disposition backfills started for this organization — please wait before starting another."
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.