---
title: "Create a new task from a failed or expired task"
method: POST
path: "/api/v1/jobs/retry"
tags: ["Tasks"]
---

# Create a new task from a failed or expired task

`POST /api/v1/jobs/retry`

## Request

- Base URL: `https://api.popnow.ai`
- URL: `https://api.popnow.ai/api/v1/jobs/retry`
- Auth: HTTP bearer

The source terminal task is never modified. Current model schema,
pricing, permissions, balance, and availability are evaluated again. An
optional Idempotency-Key is scoped to the source task and retry action.
The source task must have been created by the same API key; unknown,
cross-account, and same-account cross-key task IDs all return 404.

## Headers

- `Idempotency-Key` string

## Request body

- TaskActionRequest
  - `taskId` string, required

## Response `200`

A newly created retry task is returned in `queued` state. An idempotent replay returns that retry task in its current state.

- RetryTaskEnvelope
  - `code` 200, required
  - `msg` 'success', required
  - `request_id` string, required: Correlation identifier. Include it in support requests.
  - `data` RetryTaskResponse, required
    - `taskId` string, required
    - `deadlineAt` string, date-time, required: Server execution deadline fixed at acceptance; not a local wait timeout or result URL expiry. Idempotent replays retain the original deadline.
    - `state` 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'expired', required: `queued` for a new submission; an idempotent replay reports the original task's current state.
    - `estimatedCost` string, required: Decimal USD amount encoded as a string to avoid binary floating-point loss.
    - `estimatedCredits` integer, required: Credits held when the task was accepted (the same amount as `estimatedCost`); the most this task can cost. Unused credits are released when it settles.
    - `sourceTaskId` string, required

## Other responses

- `400`: Invalid JSON, query, callback URL, model input, or media declaration. Invalid callBackUrl values return code 400 and msg "Invalid callback URL" with request_id. Submitted hosts, IP addresses, and DNS diagnostics are not echoed.
- `401`: Missing, malformed, expired, revoked, or otherwise invalid API key.
- `402`: Insufficient balance (`40201`) or a spend cap was reached (`40202`).
- `403`: Account, model, API-key, IP, or region authorization failed.
- `404`: Resource does not exist or is not visible to this account and API key. These cases are intentionally indistinguishable.
- `409`: Idempotency or media-transfer state conflicts with this request.
- `413`: Request body exceeds the server's accepted size limit.
- `429`: Account-level request limit exceeded.
- `500`: Internal failure. Details are not exposed; report `request_id` to support.
- `503`: HTTP 503 carries one of three business codes. `50301`: no usable deployment or effective customer price exists for the selected model. `503`: a dependency is temporarily unavailable; retry after the `Retry-After` header when it is present. `50302`: a synchronous generation failed upstream and the charge was refunded. Nothing was charged, but send the retry with a **new** `Idempotency-Key`: reusing the original one replays the recorded failure instead of generating again.

## Changes

- **2026-10-20** `fede911a6e9b`: 120 warning
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `400`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `401`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `402`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `403`
  - …116 more

[Operation history](https://skmtc.dev/popnow/apis/popnow-api/changes/api/v1/jobs/retry/post.md)

---

[API](https://skmtc.dev/popnow/apis/popnow-api.md) · [All operations](https://skmtc.dev/popnow/apis/popnow-api/llms.txt) · [OpenAPI document](https://skmtc.dev/popnow/apis/popnow-api/revisions/fede911a6e9b?raw)
