CopyHero

Retry Batch Jobs

POST
/api/v1/tasks/batch/{batch_id}/retry

Retry all failed jobs in a batch.

This endpoint resets all jobs with state='error' back to state='pending', clears their output data, increments their retry count, and re-dispatches the first pending job of each affected task to the SQS queue.

Failed jobs whose input payload the retention sweep already cleared are skipped and counted in jobs_skipped_expired — retrying them would re-dispatch an empty payload. Retention is irreversible, so those jobs stay in error.

No quota is consumed for retries - the retry_count field distinguishes retry attempts from new job executions.

Args: batch_id: The batch ID of the batch to retry

Returns: Response with retry statistics including jobs reset and tasks affected

Raises: 404: If batch not found 403: If user lacks permissions to retry this batch

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

batch_id*Batch Id

Response Body

Successful Response

application/json
  1. response

Response for retrying failed jobs in a batch.

message*Message
batch_id*Batch Id
jobs_reset*Jobs Reset
jobs_skipped_expired?Jobs Skipped Expired
Default0
tasks_affected*Tasks Affected
Example Request
curl -X POST 'https://app.copyhero.app/api/v1/tasks/batch/0/retry'
Example Response
{  "message": "string",  "batch_id": 0,  "jobs_reset": 0,  "jobs_skipped_expired": 0,  "tasks_affected": 0}