# Jobs

> Create, inspect, pause, complete, cancel, and retry labelling jobs.

All endpoints below are prefixed with `https://api.trydatapoint.com/data-labelling/v1` and require an `X-API-Key` header.

## Create a job

<EndpointHeader method="POST" path="/jobs" />

Creates a labelling job. Reserves credit from your account up front; the job runs asynchronously.

### Request body

<ParamTable
  params={[
    { name: "name", type: "string", required: true, description: "Unique per account. Re-using an existing name returns the original job (idempotent). A name held by one of your [streams](/docs/api/streams) is a `409 name_conflict`." },
    { name: "task_type", type: '"comparison" | "i2v_comparison" | "rating" | "ranking" | "pairwise_ranking" | "multiple_choice" | "text_answer"', description: "Defaults to `comparison`. See [task types](/docs/task-types)." },
    { name: "instruction", type: "string", description: "Question shown to annotators. Mutually exclusive with `dimensions`." },
    { name: "dimensions", type: "{ [id: string]: string }", description: "Multiple questions against the same datapoints. Mutually exclusive with `instruction`." },
    { name: "dimension_weights", type: "{ [id: string]: number }", description: "Optional when `dimensions` is set — omitting it weights every dimension equally. When supplied, keys must match `dimensions` and values must sum to 1.0 (within 0.01)." },
    { name: "response_options", type: "object", description: "Task-type-specific config. Required for rating (`scale`) and multiple_choice (`mode`). See the task-type pages." },
    { name: "max_responses_per_datapoint", type: "integer (1–10000)", description: "Response count per datapoint per dimension. Defaults to 10." },
    { name: "serving_environment", type: '"all" | "sandbox" | "prod"', description: "Which environments serve this job's tasks. `sandbox` is a free test pool (no credits charged); `prod` is the live annotator pool; `all` serves both. Defaults to the environment the request is made against." },
    { name: "skill_requirements", type: "array (1–10 items)", description: "Skills an annotator must pass before their responses count, on standalone or chain jobs. Each item is `{ \"skill\": <identifier from GET /skills>, \"reject_at_or_below\": <0 up to but not including 1> }`; a response counts only when the annotator's score on every listed skill is strictly above its threshold. Each skill may appear once. See [Skills and qualification](/docs/skills)." },
    { name: "skill_gate_mode", type: '"adaptive" | "enforced"', description: "Defaults to `adaptive` when `skill_requirements` is set; requires `skill_requirements`. `adaptive` reuses an annotator's existing score and re-checks it from time to time; `enforced` assesses every annotator on each required skill for this job." },
    { name: "skill_budget_credits", type: "integer ≥ 0", description: "The most this job may spend on assessments of skills you created, reserved on top of the responses. Required when the job requires one of your skills and is charged, and must cover at least one assessment per such skill. Omit it, or send `0`, for shared skills and sandbox jobs. See [Billing](/docs/billing#set-a-budget)." },
    { name: "datapoints", type: "array", required: true, description: "Minimum 1. Each item has `media` (task-type-specific) and optional `context`." },
    { name: "steps", type: "array of step objects (1–5)", description: "Setting `steps` switches the job into a [chain](/docs/chains): each annotator answers the steps in order, with optional `skip_if` rules to end the walk early. When `steps` is set, the standalone fields `instruction`, `task_type`, `dimensions`, `dimension_weights`, and `response_options` must be omitted." }
  ]}
/>

Skills must be active, available to your account, and have assessments for the job's `serving_environment`. Skill settings are fixed at creation: re-using the job's `name` returns the original job without applying new ones.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "status": "processing",
  "total_datapoints": 50,
  "estimated_cost_credits": 2500,
  "credits_per_response": 5,
  "credits_per_skill_assessment": 0,
  "skill_budget_credits": 0,
  "pricing": {
    "base_credits_per_response": 5,
    "demographic_surcharge_credits": 0,
    "geo_surcharge_credits": 0,
    "priority": "basic",
    "credits_per_skill_assessment": 0,
    "skill_budget_credits": 0,
    "priority_surcharge_credits": 0,
    "credits_per_response": 5
  },
  "skill_gate_mode": null,
  "skill_requirements": null,
  "created_at": "None"
}
```

`credits_per_response` is the effective per-response rate this job was priced at — your account rate plus any [audience-targeting surcharge](/docs/billing#targeting-surcharges) — fixed at creation for the life of the job. `pricing` breaks that rate down; it is returned on fresh creations only (idempotent replays return the stored rate without the breakdown).

`credits_per_skill_assessment` and `skill_budget_credits` are the job's assessment rate and budget, both `0` unless it requires skills you created; `estimated_cost_credits` includes the budget. `skill_gate_mode` and `skill_requirements` echo the job's [skill settings](/docs/skills), or `null` without them. See [assessment pricing](/docs/billing#skill-assessment-pricing).

<DocCallout type="note" title="created_at is a placeholder on a fresh create">
On the initial creation response, `created_at` is the literal string `"None"` — the row's timestamp isn't read back on the create path. An **idempotent replay** (re-POSTing an existing `name`) returns the stored timestamp, and `GET /jobs/{job_id}` always returns the real value. Don't try to parse `created_at` from a first-time create response.
</DocCallout>

### Error cases

| Status | Cause |
|---|---|
| `400` | Unknown `task_type`; `instruction` and `dimensions` both set; malformed `dimension_weights`; handler-level datapoint rejection (e.g. wrong candidate count); a skill in `skill_requirements` that is unknown, not active, or has no assessments for the job's `serving_environment` (the `detail` names it); a skill listed twice; `skill_gate_mode` or `skill_budget_credits` without `skill_requirements`; a non-zero `skill_budget_credits` on a job with no paid assessments, such as shared skills only or sandbox; or a `skill_budget_credits` below one assessment per skill you created. |
| `402` | Insufficient credit. `detail` is an object with `needed_credits` and `available_credits`; `needed_credits` includes `skill_budget_credits`. |
| `422` | Field-level request validation failed (`detail` is an array of per-field errors), or request text that did not pass content review (`detail.code` is `content_blocked`). |
| `503` | Task dispatch failed (reservation is released automatically — safe to retry with a new `name`), or content review is temporarily unavailable (a `Retry-After` header tells you when to retry), or skill checks are temporarily unavailable for a job with `skill_requirements` (nothing was stored; retry later). |

Media that couldn't be reviewed because it was unreadable doesn't fail this call: it surfaces asynchronously as blocked datapoints in `errors[]` on `GET /jobs/{job_id}`. The create-time `invalid_media` error belongs to [`POST /media`](/docs/api/media).

See [Errors](/docs/errors) for the full envelope format and the content-review outcomes.

---

## List jobs

<EndpointHeader method="GET" path="/jobs" />

Returns every job for the authenticated client, most recent first.

### Response (`200 OK`)

```json
{
  "jobs": [
    {
      "job_id": "job_abc123def456",
      "name": "hello-datapoint",
      "task_type": "comparison",
      "status": "completed",
      "priority": "basic",
      "serving_environment": "prod",
      "max_responses_per_datapoint": 10,
      "api_key_label": "production-server",
      "created_at": "2026-04-21T12:34:56.123456+00:00",
      "is_paused": false
    }
  ],
  "total": 1
}
```

`priority` is assigned by Datapoint and is not settable on job creation; it defaults to `"basic"`.

Each listed job also includes `skill_gate_mode` and `skill_requirements`, `null` on jobs without [skill requirements](/docs/skills).

---

## Get job status

<EndpointHeader method="GET" path="/jobs/{job_id}" />

Live counters on a single job: how many datapoints are in flight, completed, or failed.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "name": "hello-datapoint",
  "status": "active",
  "task_type": "comparison",
  "serving_environment": "prod",
  "total_datapoints": 50,
  "processing_datapoints": 12,
  "ready_datapoints": 38,
  "completed_datapoints": 30,
  "failed_datapoints": 0,
  "blocked_datapoints": 0,
  "total_responses": 412,
  "max_responses_per_datapoint": 10,
  "cost_credits": 2060,
  "credits_per_response": 5,
  "refundable_credits": 440,
  "created_at": "2026-04-21 12:34:56.123456+00:00",
  "errors": [],
  "response_options": null,
  "annotator_filter": null,
  "is_paused": false
}
```

<ParamTable
  title="Key fields"
  params={[
    { name: "status", type: "string", description: "One of processing, active, completed, failed, blocked, cancelled. Starts as 'processing' on creation; transitions to 'active' once tasks are dispatched. completed / failed / blocked / cancelled are terminal — poll until the status is terminal to know the job is done. Pause/resume does not change `status` — see `is_paused`." },
    { name: "is_paused", type: "boolean", description: "Whether task serving is currently paused. Toggled by `POST /jobs/{id}/pause` and `POST /jobs/{id}/resume`. Independent of `status`: a job can be paused while in any non-terminal lifecycle state (cancel and complete also set it true)." },
    { name: "processing_datapoints", type: "int", description: "Datapoints not yet dispatched to annotators. Computed as total_datapoints minus every datapoint that already has a status." },
    { name: "ready_datapoints", type: "int", description: "active + completed. Datapoints that have been dispatched. Partial results are fetchable for every ready datapoint." },
    { name: "completed_datapoints", type: "int", description: "Hit `max_responses_per_datapoint`." },
    { name: "failed_datapoints", type: "int", description: "Permanently failed. Details in `errors[]`." },
    { name: "blocked_datapoints", type: "int", description: "Datapoints whose media did not pass content review. Terminal, like failed; excluded from `/results`." },
    { name: "total_responses", type: "int", description: "Count of completed, billable responses on this job. For chain jobs, only walks that complete every step are counted; walks ended early by a step's `skip_if` rule are free and are not counted here. Skill assessment answers and responses that didn't meet the job's skill requirements aren't counted either." },
    { name: "cost_credits", type: "int", description: "Actual cost in credits accrued from total_responses at the job's per-response rate, plus answered assessments of skills you created (`response_cost_credits` + `skill_cost_credits`). Grows as responses arrive; not the full reservation." },
    { name: "credits_per_response", type: "int | null", description: "The per-response rate this job was priced at (account rate plus any audience-targeting surcharge), fixed at creation. Null on jobs created before per-job rates." },
    { name: "refundable_credits", type: "int", description: "Live preview of what you'd get back if you cancelled or completed the job right now: the reserved estimate minus what the work collected so far would settle at. 0 once the job is settled (terminal), and always 0 for billing-exempt accounts." },
    { name: "response_options", type: "object | null", description: "The job's task-type options (e.g. a rating scale or the multiple-choice mode). Null for task types that don't use them. Always present in the response." },
    { name: "annotator_filter", type: "object | null", description: "Audience gate set at creation, or null. Always present in the response." },
    { name: "chain_progress", type: "object | null", description: "Chain jobs only. `{ target_responses, completed_responses, screened_out_responses }`: `target_responses` is `max_responses_per_datapoint × chain instances`; `completed_responses` counts walks that finished every step (the only walks that bill); `screened_out_responses` counts walks ended early by a `skip_if` rule (free — never billed and never counted toward the target). Omitted entirely for standalone jobs." },
    { name: "created_at", type: "string", description: "Python-str datetime: 'YYYY-MM-DD HH:MM:SS.ffffff+00:00' (space separator, not ISO 'T')." },
    { name: "errors", type: "array of { datapoint_index, error }", description: "Per-datapoint failure reasons for failed and blocked datapoints." }
  ]}
/>

`response_options` and `annotator_filter` are **always present**, returned as `null` when unset rather than omitted. `chain_progress` is the only field that is dropped entirely — it appears only on chain jobs.

### Skill settings and assessment spend

The status response also carries these fields:

| Field | Meaning |
|---|---|
| `skill_gate_mode`, `skill_requirements` | The job's [skill settings](/docs/skills), fixed at creation; `null` without them. |
| `response_cost_credits` | The part of `cost_credits` from responses. |
| `skill_cost_credits` | The part of `cost_credits` from answered assessments of skills you created. |
| `credits_per_skill_assessment` | The job's assessment rate, fixed at creation; `0` without paid assessments. |
| `skill_budget_credits` | The job's total assessment budget. |
| `skill_in_flight_credits` | Budget held for assessments that were served and not yet answered or expired. |
| `skill_budget_available_credits` | Budget left for further assessments: `skill_budget_credits` minus spent and in-flight. After the job settles, the unused part has already been returned to your balance. |

`GET /jobs/{job_id}/skill-quality` reports [assessment counts per requirement](/docs/api/skills#require-a-skill-on-a-job), and [`POST /jobs/{job_id}/skill-budget`](/docs/billing#increase-a-jobs-skill-budget) raises the budget.

### Error cases

| Status | Cause |
|---|---|
| `404` | Job doesn't exist or belongs to another client. |

---

## Preview a job as an annotator

<EndpointHeader method="GET" path="/jobs/{job_id}/preview" />

Returns a read-only sample in the same task-bundle contract used by the
annotator application. The **Preview** tab on a job in the client dashboard
uses this endpoint and the live annotator renderer, so you can refine
instructions, labels, media layout, rating scales, and reference media before
evaluating the collected results.

The sample contains up to 10 resolved standalone tasks, or the first resolved
instance of a chain. Both active and completed datapoints are eligible, so the
preview remains available after a job finishes. Calling it does not assign
work, create a session or response, consume credits, or depend on the job's
`serving_environment`.

### Response (`200 OK`)

```json
{
  "data": {
    "bundle_size": 1,
    "reward": { "reward_type": "coin", "reward_amount": 1 },
    "tasks": [
      {
        "task_id": "11111111-1111-4111-8111-111111111111",
        "task_type": "rating",
        "reward": { "reward_type": "coin", "reward_amount": 0 },
        "payload": {
          "prompt": "How accurately does this description match the reference image? A red shoe with white laces.",
          "scale": [1, 2, 3, 4, 5],
          "labels": { "1": "Not at all", "5": "Completely" },
          "references": [
            {
              "id": "image_1",
              "image_url": "https://api.trydatapoint.com/data-labelling/v1/media/11111111-1111-4111-8111-111111111111"
            }
          ]
        },
        "chain_step": null,
        "custom_ui_html_url": null
      }
    ],
    "is_chain": null,
    "chain_length": null
  }
}
```

The response is marked `Cache-Control: private, no-store`. Treat generated
`task_id` values as preview-only; they cannot be submitted as assignments.

### Error cases

| Status | Cause |
|---|---|
| `404` | Job doesn't exist or belongs to another client. |
| `409` | The job exists, but no datapoint has finished preparation yet. Retry after the job becomes active. |

---

## Get job results

<EndpointHeader method="GET" path="/jobs/{job_id}/results" />

Aggregated per-datapoint results. Safe to call while a job is still running. Returns one row per dispatched datapoint that has not failed or been blocked. Datapoints with no responses yet come back with `total_responses: 0` and null consensus fields.

On a job with [skill requirements](/docs/skills), assessment answers never appear here or in raw responses, and neither do responses that didn't meet the requirements.

### Query parameters

<ParamTable
  params={[
    { name: "page", type: "integer", default: "1", description: "1-indexed page number." },
    { name: "per_page", type: "integer", default: "100", description: "Results per page. No upper bound (unlike `/responses`, which caps `per_page` at 1000)." },
    { name: "labels", type: "boolean", default: "false", description: "When `true`, translates aggregation keys and `consensus` from option/candidate ids into their display text, and echoes the job's `response_options` on each row. Default `false` keeps stable ids." }
  ]}
/>

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "status": "active",
  "task_type": "comparison",
  "page": 1,
  "per_page": 100,
  "total_results": 50,
  "results": [
    {
      "datapoint_index": 0,
      "context": null,
      "media": [
        {
          "media_id": "b1e2c3d4-5678-90ab-cdef-1234567890ab",
          "type": "image",
          "role": "candidates",
          "url": "/media/v2/b1e2c3d4-5678-90ab-cdef-1234567890ab?sig=...",
          "thumbnail_url": "/media/v2/b1e2c3d4-5678-90ab-cdef-1234567890ab?preview=1&sig=..."
        }
      ],
      "votes": { "A": 7, "B": 3 },
      "total_responses": 10,
      "consensus": "A",
      "confidence": 0.7,
      "agreement_rate": 0.7,
      "weighted_votes": { "A": 6.1, "B": 2.4 },
      "weighted_consensus": "A",
      "weighted_confidence": 0.718
    }
  ]
}
```

Result shape varies by `task_type`. The response declares the fields for every task type; the ones that don't apply to this job come back `null`, and task-type-specific keys are passed through as-is. See the [task types](/docs/task-types) for the exact fields per type. Chain jobs return one entry per datapoint with a per-step `steps` array (and `media: null`); see the [chain result shape](/docs/chains#result-shape).

#### `media[]`

Each standalone result carries a `media` array describing the assets that were labelled:

<ParamTable
  params={[
    { name: "media_id", type: "string", description: "Stable identifier of the media item." },
    { name: "type", type: "string | null", description: "Media type — `image`, `video`, or `audio`." },
    { name: "role", type: "string | null", description: "The item's role in the task: `candidates`, `reference`, or `subject`. Null for pure-context media." },
    { name: "url", type: "string", description: "Signed proxy path for the full asset, scoped to your account and valid for roughly one hour. It's a relative path — prepend the API base URL to fetch it." },
    { name: "thumbnail_url", type: "string", description: "Signed proxy path for a smaller preview of the same asset, same scope and lifetime as `url`." }
  ]}
/>

Chain results carry `media: null`.

The `weighted_*` fields carry a second verdict computed alongside the equal-vote fields (`weighted_votes` / `weighted_consensus` / `weighted_confidence`, and their per-task-type analogues): the same tally, weighted by a platform-computed reliability score for each response. On a job with `skill_requirements`, each response's weight is its annotator's lowest score across the job's required skills. For multi-dimension jobs there is also a composite (`weighted_score` / `overall_consensus`) that combines the per-dimension results by the `dimension_weights` you set at creation.

---

## Get raw responses

<EndpointHeader method="GET" path="/jobs/{job_id}/responses" />

Per-annotator responses, one row per submission. Use this for audits, custom aggregation, or reconstructing which submitted asset was labelled A vs B.

### Query parameters

Same `page` / `per_page` as `/results`, except `per_page` is capped at 1000.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "task_type": "comparison",
  "page": 1,
  "per_page": 100,
  "total_responses": 412,
  "total_pages": 5,
  "total_annotators": 96,
  "responses": [
    {
      "datapoint_index": 0,
      "response": "A",
      "response_label": "A",
      "response_time_ms": 4832,
      "annotator_id": "anon_8f2cd1a3e9",
      "annotator_country": "US",
      "annotator_country_name": "United States",
      "trust": { "estimate": 0.818, "lower_bound": 0.27 },
      "timestamp": "2026-04-21 12:37:18.452731+00:00"
    }
  ]
}
```

Pagination is grouped by annotator: each page holds whole annotator response sets, so a page can contain more than `per_page` rows. Iterate using `total_pages` rather than computing the page count from `total_responses / per_page`.

<ParamTable
  params={[
    { name: "datapoint_index", type: "int", description: "Zero-indexed position in the original `datapoints[]` array." },
    { name: "response", type: "string | null", description: "Raw submission. Task-type-specific: `\"A\"` or `\"B\"` (comparison), the rating value as a string (rating), comma-separated item ids like `\"video_2,video_1,video_3\"` (ranking), option id or comma-separated ids (multiple choice)." },
    { name: "response_label", type: "string | null", description: "Human-readable form of `response` (e.g. an option's display text instead of its id)." },
    { name: "response_labels", type: "array of string | null", description: "Structured multi-value form, one entry per selection. Prefer this over splitting `response` on commas, since label text can itself contain a comma." },
    { name: "response_time_ms", type: "int | null", description: "How long the annotator spent on the task." },
    { name: "annotator_id", type: "string", description: "Format `anon_` + 10 lowercase hex chars. A stable, anonymized identifier — the same annotator keeps the same id across all your jobs, without revealing their real identity." },
    { name: "annotator_country", type: "string | null", description: "ISO country code of the annotator, when available." },
    { name: "annotator_country_name", type: "string | null", description: "Human-readable country name, when available." },
    { name: "annotator_region", type: "string | null", description: "Sub-national region, when available." },
    { name: "annotator_city", type: "string | null", description: "City, when available." },
    { name: "trust", type: "object | null", description: "The annotator's reliability for this task type at the time of the response. `estimate` is the estimated probability (0–1) that they answer a quality-check item correctly, and `lower_bound` is a one-sided 95% lower confidence bound on it. Both are null until the annotator has been measured, and for some responses recorded before 2026-08-19. Standalone jobs only: `trust` is null on chain-job rows and for a response recorded without a reading. On a job with `skill_requirements`, `estimate` is instead the annotator's lowest score across the job's required skills when the response was submitted, and `lower_bound` is null." },
    { name: "timestamp", type: "string | null", description: "Python-str datetime of when the response completed (falls back to created_at if not yet completed): `'YYYY-MM-DD HH:MM:SS.ffffff+00:00'`." },
    { name: "step_index", type: "int | null", description: "Chain jobs only. Zero-based step position within the chain. Null for standalone jobs." },
    { name: "task_type", type: "string | null", description: "Chain jobs only. The step's task type (e.g. `\"multiple_choice\"`, `\"rating\"`). Null for standalone jobs; use the top-level `task_type` instead." }
  ]}
/>

---

## Pause a job

<EndpointHeader method="POST" path="/jobs/{job_id}/pause" />

Stops serving any new tasks for the job. In-flight responses continue to come in. Returns `400` if the job is already terminal (`completed`, `failed`, `blocked`, or `cancelled`) or already paused.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "is_paused": true,
  "status": "active"
}
```

`is_paused` is a separate flag from `status`. The job's lifecycle status stays the same across pause/resume; only `is_paused` toggles.

---

## Resume a job

<EndpointHeader method="POST" path="/jobs/{job_id}/resume" />

Re-activates a paused job. Task serving resumes immediately. Returns `400` if the job is already terminal (`completed`, `failed`, `blocked`, or `cancelled`) or is not paused.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "is_paused": false,
  "status": "active"
}
```

---

## Complete a job early

<EndpointHeader method="POST" path="/jobs/{job_id}/complete" />

Ends a running job early. The job flips to terminal `completed` with whatever responses it has collected so far: you're charged for those, the unused reserve is released back to your balance, and, if any responses were collected, its report is generated from the partial data. Unlike cancel, completing dispatches report generation. (A cancelled job stays visible in `GET /jobs` and the dashboard either way; it just never gets a report.)

Returns `400` if the job is already terminal, or if it's still `processing` (no datapoints have been dispatched yet). `404` if the job doesn't exist or belongs to another client.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "status": "completed",
  "is_paused": true,
  "cost_credits": 2060,
  "released_credits": 440
}
```

<DocCallout type="note" title="cost_credits is a floor">
A response that was in flight at the moment you completed the job may land just after settlement. It is still stored and reflected in the report, but it is never billed — so the final `cost_credits` can end up a little below what you might expect from the response count. This is the same window that natural completion has.
</DocCallout>

---

## Cancel a job

<EndpointHeader method="POST" path="/jobs/{job_id}/cancel" />

Permanently cancels a job and settles its reserved credits. Serving stops immediately, you're charged only for the responses already collected, and the unused reserve is released back to your balance. Cancellation is **irreversible**, and unlike complete it does **not** generate a report.

Returns `400` if the job is already terminal (`completed`, `failed`, `blocked`, or `cancelled`). `404` if the job doesn't exist or belongs to another client.

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "status": "cancelled",
  "is_paused": true,
  "cost_credits": 640,
  "released_credits": 1860
}
```

---

## Retry failed datapoints

<EndpointHeader method="POST" path="/jobs/{job_id}/retry" />

Re-queues failed datapoints. Pass `datapoint_indices` to target specific failures; omit the body to retry all. If the job itself had flipped to `failed`, retrying flips it back to `active` and reserves its estimated cost again, so your available balance must cover it; responses collected on the retried datapoints are billed when the job completes, like any other job.

<DocCallout type="warning" title="Retry discards existing data for the retried datapoints">
Retry **deletes the tasks and every collected response** for the datapoints it re-queues, then resets them to `processing` and dispatches fresh work. For [chain](/docs/chains) jobs the retry set expands to **every sibling step of the affected chain instance**, so any responses already collected on the instance's other steps are discarded too. Only retry when you're prepared to lose the partial data on those datapoints.
</DocCallout>

### Request body

```json
{
  "datapoint_indices": [3, 7, 12]
}
```

<ParamTable
  params={[
    { name: "datapoint_indices", type: "array of int", description: "Optional. Zero-indexed positions in the original `datapoints[]` array to retry. Omit to retry all failed." }
  ]}
/>

### Response (`200 OK`)

```json
{
  "job_id": "job_abc123def456",
  "retried": 3,
  "datapoint_indices": [3, 7, 12]
}
```

If no datapoints are failed (or none match the requested indices), the endpoint returns `200` with `retried: 0` and `datapoint_indices: []`. That's not an error.

### Error cases

| Status | Cause |
|---|---|
| `400` | Job was created before retry support was added (no stored request payload). |
| `400` | Job is `cancelled`, or a [chain](/docs/chains) instance can't be retried because a sibling step was blocked during content review. |
| `400` | Job is `completed` or `blocked` and has failed datapoints to retry. |
| `400` | Job is `failed`, reserved credits when it was created, and is more than 7 days old. Create it again with a new `name`. |
| `400` | Job is `failed` because some of its datapoints were never queued when it was created. Create it again with a new `name`. |
| `402` | Job is `failed` and your available balance can't cover reserving its estimated cost again. `detail` is an object with `needed_credits` and `available_credits`. |
| `404` | Job not found. |
| `503` | Some datapoints couldn't be queued. They're marked `failed` again, so you can retry them. |

## Next

- [Skills](/docs/api/skills): require raters to pass a skill, or create your own from labelled examples
- [Media](/docs/api/media): upload reference
- [Billing](/docs/billing): balance, checkout, and history
- [Survey Planner](/docs/api/survey-planner): natural-language job generation
