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

# Retry Task

> Retry a failed HDP task from the beginning or retry only decommitment for TaskDecommitmentFailed tasks

# Retry Task

Retries a failed HDP task. For tasks that failed at decommitment stage (`TaskDecommitmentFailed`), only the decommitment step will be retried. For other failed tasks, the entire workflow will be retried from the beginning. This endpoint requires authentication.

## Endpoint

```
POST /tasks/{task_uuid}/retry
```

## Authentication

This endpoint requires authentication using an API key:

```bash theme={null}
X-API-KEY: your-herodotus-cloud-api-key-here
```

## Path Parameters

| Parameter  | Type   | Description                                       |
| ---------- | ------ | ------------------------------------------------- |
| task\_uuid | string | The unique identifier (UUID) of the task to retry |

## Example Request

```bash theme={null}
curl -X POST https://staging.hdp.api.herodotus.cloud/tasks/01JPJ03YJT1A93D6NF56G4GVEQ/retry \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-herodotus-cloud-api-key-here"
```

## Response

### Success Response (200 OK)

```json theme={null}
{
  "message": "Task has been queued for retry",
  "status": "accepted",
  "uuid": "01JPJ03YJT1A93D6NF56G4GVEQ"
}
```

### Not Found Response (404)

```json theme={null}
{
  "error": "Task not found",
  "uuid": "01JPJ03YJT1A93D6NF56G4GVEQ"
}
```

### Bad Request Response (400)

For decommitment retry without results:

```json theme={null}
{
  "error": "Cannot retry decommitment",
  "details": "Task results are missing. Cannot retry decommitment without results."
}
```

### Unauthorized Response (401)

```json theme={null}
{
  "error": "Missing Herodotus Cloud X-API-KEY header"
}
```

### Response Fields

| Field   | Type   | Description                                     |
| ------- | ------ | ----------------------------------------------- |
| message | string | Success message                                 |
| status  | string | Status of the request (always "accepted")       |
| uuid    | string | The unique identifier of the task               |
| error   | string | Error message (only present in error responses) |

## Retry Behavior

### Full Retry

For tasks that failed at any stage except `TaskDecommitmentFailed`, the entire workflow will be retried:

* Dry run validation
* Chain proofs fetching
* Trace generation
* Atlantic proving
* Task decommitment

### Decommitment-Only Retry

For tasks with status `TaskDecommitmentFailed`, only the decommitment step will be retried:

* The task results must be available
* Trace generation and Atlantic proving steps are skipped
* Only the decommitment workflow is executed

## Notes

* Authentication is required for this endpoint
* The task status will be reset to `Received` before retry
* For decommitment-only retries, the task results must be present
* The retry will create a new task execution in the queue
* Use this endpoint to recover from transient failures
