# Retry an owned failed request as a new task (/api-reference/data-api/postDataRequestsByIdRetry)

Retries the failed request identified by the path id. Creates a new request ID and preserves the failed source request for audit. Structured extraction requests also create a new recipe run. Website task/tool requests return WEBSITE_TOOL_RETRY_REQUIRES_NEW_REQUEST; submit a new task/tool request with a new idempotency key instead.

## POST /api/v1/data/requests/{id}/retry

Retry an owned failed request as a new task

- Operation ID: `postDataRequestsByIdRetry`

- Tags: `Data API`

Retries the failed request identified by the path id. Creates a new request ID and preserves the failed source request for audit. Structured extraction requests also create a new recipe run. Website task/tool requests return WEBSITE_TOOL_RETRY_REQUIRES_NEW_REQUEST; submit a new task/tool request with a new idempotency key instead.

### Security

- Required scope: `scrape:write`

- `ApiKey` (apiKey, X-API-Key)

- `ApiKeyBearer` (http)

### Parameters

- `id` (path, required) — string (uuid); UUID of the target request or batch, as returned in the id field when it was created or listed.

- `Idempotency-Key` (header) — string; Optional. Generate a unique value before a write and retain it for an exact-body retry; replay is free and a different body returns 409 IDEMPOTENCY_CONFLICT.; example="rh-docs-01J2QG-unique"

### Responses

- **202** — Retry accepted or idempotently replayed Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/RetryJobResponse

  - Example: `{
  "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
  "status": "pending"
}`

  - Examples: `{
  "accepted": {
    "summary": "New asynchronous request",
    "value": {
      "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
      "url": "https://example.com",
      "status": "pending",
      "cached": false,
      "protected": false,
      "pricing_version": 2,
      "route_mode": "http",
      "base_tokens": 1,
      "protected_tokens": 0,
      "captcha_tokens": 0,
      "created_at": "2026-08-22T12:00:00.000Z",
      "charged_tokens": 1,
      "idempotent_replay": false
    }
  },
  "replay": {
    "summary": "Same key and payload replay",
    "value": {
      "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
      "url": "https://example.com",
      "status": "pending",
      "cached": false,
      "protected": false,
      "pricing_version": 2,
      "route_mode": "http",
      "base_tokens": 1,
      "protected_tokens": 0,
      "captcha_tokens": 0,
      "created_at": "2026-08-22T12:00:00.000Z",
      "charged_tokens": 0,
      "idempotent_replay": true
    }
  }
}`

- **400** — Invalid public UUID or idempotency key Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/PublicError

  - Example: `{
  "error": "Request failed",
  "code": "VALIDATION_ERROR",
  "message": "Invalid public UUID or idempotency key Error body uses the documented PublicError DTO.",
  "requestId": "req_01J2QG"
}`

- **404** — Source request not found Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/PublicError

  - Example: `{
  "error": "Request failed",
  "code": "VALIDATION_ERROR",
  "message": "Source request not found Error body uses the documented PublicError DTO.",
  "requestId": "req_01J2QG"
}`

- **409** — Source task is not failed Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/PublicError

  - Example: `{
  "error": "Request failed",
  "code": "RESULT_NOT_READY",
  "message": "Source task is not failed Error body uses the documented PublicError DTO.",
  "requestId": "req_01J2QG"
}`

- **410** — Encrypted source request payload has expired Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/PublicError

  - Example: `{
  "error": "Request failed",
  "code": "RESULT_EXPIRED",
  "message": "Encrypted source request payload has expired Error body uses the documented PublicError DTO.",
  "requestId": "req_01J2QG"
}`

- **503** — The public Data API is disabled Error body uses the documented PublicError DTO.

  - `application/json`: #/components/schemas/PublicError

  - Example: `{
  "error": "Request failed",
  "code": "PRICING_NOT_ACTIVE",
  "message": "The public Data API is disabled Error body uses the documented PublicError DTO.",
  "requestId": "req_01J2QG"
}`

### Referenced OpenAPI components

#### `#/components/parameters/PublicId`

```json

{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "UUID of the target request or batch, as returned in the id field when it was created or listed.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}

```

#### `#/components/parameters/IdempotencyKey`

```json

{
  "name": "Idempotency-Key",
  "in": "header",
  "required": false,
  "description": "Optional. Generate a unique value before a write and retain it for an exact-body retry; replay is free and a different body returns 409 IDEMPOTENCY_CONFLICT.",
  "schema": {
    "type": "string",
    "minLength": 8,
    "maxLength": 200
  },
  "example": "rh-docs-01J2QG-unique"
}

```

#### `#/components/schemas/RetryJobResponse`

```json

{
  "allOf": [
    {
      "$ref": "#/components/schemas/CreateJobResponse"
    },
    {
      "type": "object",
      "required": [
        "retried_from_id"
      ],
      "properties": {
        "retried_from_id": {
          "type": "string",
          "format": "uuid",
          "description": "Failed source request retained for audit."
        },
        "retried_from_run_id": {
          "type": "string",
          "format": "uuid",
          "description": "Present when retrying a structured extraction request."
        }
      }
    }
  ]
}

```

#### `#/components/headers/X-Credits-Charged`

```json

{
  "description": "Credits charged by the current submission operation. Idempotent replays return 0.",
  "schema": {
    "type": "integer",
    "minimum": 0
  }
}

```

#### `#/components/headers/X-Credits-Remaining`

```json

{
  "description": "Current tenant token balance after the operation.",
  "schema": {
    "type": "integer",
    "minimum": 0
  }
}

```

#### `#/components/headers/X-Credit-Pricing-Version`

```json

{
  "description": "Public pricing version used for the operation.",
  "schema": {
    "type": "integer",
    "minimum": 1
  }
}

```

#### `#/components/headers/X-Route-Mode`

```json

{
  "description": "Effective route mode used by the operation; batch responses may be mixed.",
  "schema": {
    "type": "string",
    "enum": [
      "direct",
      "auto",
      "browser",
      "http",
      "residential",
      "residential_browser",
      "mixed"
    ]
  }
}

```

#### `#/components/schemas/PublicError`

```json

{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "error",
    "code",
    "message",
    "requestId"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "description": "Stable public error code. PROXY_QUOTE_EXPIRED means the optional quote_version supplied at admission is no longer current; refresh the pricing view and submit again."
    },
    "message": {
      "type": "string"
    },
    "requestId": {
      "type": "string"
    }
  }
}

```

#### `#/components/schemas/CreateJobResponse`

```json

{
  "allOf": [
    {
      "$ref": "#/components/schemas/PublicJobCreated"
    },
    {
      "type": "object",
      "required": [
        "charged_tokens",
        "pricing_version",
        "route_mode",
        "idempotent_replay"
      ],
      "properties": {
        "charged_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Base credits charged by this submission operation; dynamic protected/CAPTCHA debits occur later. Zero on an idempotent replay."
        },
        "pricing_version": {
          "type": "integer",
          "minimum": 1
        },
        "route_mode": {
          "$ref": "#/components/schemas/DataRouteMode"
        },
        "idempotent_replay": {
          "type": "boolean",
          "example": false,
          "description": "True only when this response replays a previous submission with the same idempotency key and payload."
        },
        "result_kind": {
          "type": "string",
          "enum": [
            "extraction"
          ],
          "description": "Present for structured extraction requests."
        },
        "page_status": {
          "type": "string",
          "description": "Underlying page-fetch status for extraction requests; top-level status tracks extraction readiness."
        }
      }
    }
  ]
}

```

#### `#/components/schemas/PublicJobCreated`

```json

{
  "type": "object",
  "required": [
    "id",
    "status",
    "cached",
    "protected",
    "pricing_version",
    "route_mode",
    "base_tokens",
    "protected_tokens",
    "captcha_tokens",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Target origin only; path and query are stored in the encrypted short-retention payload."
    },
    "status": {
      "$ref": "#/components/schemas/DataJobStatus"
    },
    "cached": {
      "type": "boolean"
    },
    "protected": {
      "type": "boolean",
      "description": "True after server-side anti-bot protection detection."
    },
    "pricing_version": {
      "type": "integer",
      "minimum": 1
    },
    "route_mode": {
      "$ref": "#/components/schemas/DataRouteMode"
    },
    "proxy_type": {
      "$ref": "#/components/schemas/ProxyNetworkType",
      "description": "Requested proxy network class. Present on new submissions; historical idempotent replays may omit this field."
    },
    "base_tokens": {
      "type": "integer",
      "minimum": 0
    },
    "protected_tokens": {
      "type": "integer",
      "minimum": 0,
      "description": "Historical compatibility field; built-in protection is included in the selected pricing-v2 request mode."
    },
    "captcha_tokens": {
      "type": "integer",
      "minimum": 0
    },
    "quote": {
      "$ref": "#/components/schemas/EconomicQuote",
      "description": "Provider-neutral admission quote. Null when the guarded pricing policy is disabled."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

```

#### `#/components/schemas/DataRouteMode`

```json

{
  "type": "string",
  "enum": [
    "direct",
    "auto",
    "browser",
    "http",
    "residential",
    "residential_browser",
    "mixed"
  ]
}

```

#### `#/components/schemas/DataJobStatus`

```json

{
  "type": "string",
  "enum": [
    "pending",
    "running",
    "solving_captcha",
    "completed",
    "failed",
    "cancelled"
  ]
}

```

#### `#/components/schemas/ProxyNetworkType`

```json

{
  "type": "string",
  "enum": [
    "datacenter",
    "residential",
    "premium"
  ]
}

```

#### `#/components/schemas/EconomicQuote`

```json

{
  "type": [
    "object",
    "null"
  ],
  "additionalProperties": false,
  "required": [
    "status",
    "pricing_version",
    "customer_cap_credits",
    "outcomes"
  ],
  "properties": {
    "status": {
      "type": "string",
      "const": "accepted"
    },
    "pricing_version": {
      "type": "integer",
      "minimum": 1
    },
    "customer_cap_credits": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Customer consent limit, not attributed revenue."
    },
    "outcomes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/EconomicQuoteOutcome"
      },
      "description": "Provider-neutral charge outcomes admitted by the economic guard."
    }
  }
}

```

#### `#/components/schemas/EconomicQuoteOutcome`

```json

{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "action",
    "charge_credits"
  ],
  "properties": {
    "action": {
      "type": "string",
      "description": "Opaque action identifier for a quoted outcome. Internal tariff categories are omitted from this reference and should not be used as integration constants."
    },
    "charge_credits": {
      "type": "integer",
      "minimum": 0
    }
  }
}

```

### Complete operation object

```json

{
  "operationId": "postDataRequestsByIdRetry",
  "tags": [
    "Data API"
  ],
  "summary": "Retry an owned failed request as a new task",
  "description": "Retries the failed request identified by the path id. Creates a new request ID and preserves the failed source request for audit. Structured extraction requests also create a new recipe run. Website task/tool requests return WEBSITE_TOOL_RETRY_REQUIRES_NEW_REQUEST; submit a new task/tool request with a new idempotency key instead.",
  "x-required-scope": "scrape:write",
  "x-mcp-name": "data_retry_request",
  "x-mcp-annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": true
  },
  "parameters": [
    {
      "$ref": "#/components/parameters/PublicId"
    },
    {
      "$ref": "#/components/parameters/IdempotencyKey"
    }
  ],
  "responses": {
    "202": {
      "description": "Retry accepted or idempotently replayed Error body uses the documented PublicError DTO.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/RetryJobResponse"
          },
          "example": {
            "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
            "status": "pending"
          },
          "examples": {
            "accepted": {
              "summary": "New asynchronous request",
              "value": {
                "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
                "url": "https://example.com",
                "status": "pending",
                "cached": false,
                "protected": false,
                "pricing_version": 2,
                "route_mode": "http",
                "base_tokens": 1,
                "protected_tokens": 0,
                "captcha_tokens": 0,
                "created_at": "2026-08-22T12:00:00.000Z",
                "charged_tokens": 1,
                "idempotent_replay": false
              }
            },
            "replay": {
              "summary": "Same key and payload replay",
              "value": {
                "id": "9a20bd58-ed33-4a5b-b63f-b52bb1a62248",
                "url": "https://example.com",
                "status": "pending",
                "cached": false,
                "protected": false,
                "pricing_version": 2,
                "route_mode": "http",
                "base_tokens": 1,
                "protected_tokens": 0,
                "captcha_tokens": 0,
                "created_at": "2026-08-22T12:00:00.000Z",
                "charged_tokens": 0,
                "idempotent_replay": true
              }
            }
          }
        }
      },
      "headers": {
        "X-Credits-Charged": {
          "$ref": "#/components/headers/X-Credits-Charged"
        },
        "X-Credits-Remaining": {
          "$ref": "#/components/headers/X-Credits-Remaining"
        },
        "X-Credit-Pricing-Version": {
          "$ref": "#/components/headers/X-Credit-Pricing-Version"
        },
        "X-Route-Mode": {
          "$ref": "#/components/headers/X-Route-Mode"
        }
      }
    },
    "400": {
      "description": "Invalid public UUID or idempotency key Error body uses the documented PublicError DTO.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PublicError"
          },
          "example": {
            "error": "Request failed",
            "code": "VALIDATION_ERROR",
            "message": "Invalid public UUID or idempotency key Error body uses the documented PublicError DTO.",
            "requestId": "req_01J2QG"
          }
        }
      },
      "x-docs-retryable": false
    },
    "404": {
      "description": "Source request not found Error body uses the documented PublicError DTO.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PublicError"
          },
          "example": {
            "error": "Request failed",
            "code": "VALIDATION_ERROR",
            "message": "Source request not found Error body uses the documented PublicError DTO.",
            "requestId": "req_01J2QG"
          }
        }
      },
      "x-docs-retryable": false
    },
    "409": {
      "description": "Source task is not failed Error body uses the documented PublicError DTO.",
      "or submission is in progress": null,
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PublicError"
          },
          "example": {
            "error": "Request failed",
            "code": "RESULT_NOT_READY",
            "message": "Source task is not failed Error body uses the documented PublicError DTO.",
            "requestId": "req_01J2QG"
          }
        }
      },
      "x-docs-retryable": true
    },
    "410": {
      "description": "Encrypted source request payload has expired Error body uses the documented PublicError DTO.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PublicError"
          },
          "example": {
            "error": "Request failed",
            "code": "RESULT_EXPIRED",
            "message": "Encrypted source request payload has expired Error body uses the documented PublicError DTO.",
            "requestId": "req_01J2QG"
          }
        }
      },
      "x-docs-retryable": false
    },
    "503": {
      "description": "The public Data API is disabled Error body uses the documented PublicError DTO.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PublicError"
          },
          "example": {
            "error": "Request failed",
            "code": "PRICING_NOT_ACTIVE",
            "message": "The public Data API is disabled Error body uses the documented PublicError DTO.",
            "requestId": "req_01J2QG"
          }
        }
      },
      "x-docs-retryable": true
    }
  },
  "security": [
    {
      "ApiKey": []
    },
    {
      "ApiKeyBearer": []
    }
  ],
  "servers": [
    {
      "url": "https://api.runharvester.com",
      "description": "RunHarvester public API"
    }
  ]
}

```