> ## 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.

# List Tasks

> Retrieve a paginated list of HDP tasks with optional search and filtering

# List Tasks

Retrieves a paginated list of all HDP tasks with optional search functionality. This endpoint does not require authentication.

## Endpoint

```
GET /tasks
```

## Query Parameters

| Parameter             | Type    | Required | Description                                                                           |
| --------------------- | ------- | -------- | ------------------------------------------------------------------------------------- |
| hdp\_tasks\_page      | integer | No       | Page number (default: 1, minimum: 1)                                                  |
| hdp\_tasks\_per\_page | integer | No       | Number of tasks per page (default: 10, minimum: 1, maximum: 100)                      |
| hdp\_tasks\_search    | string  | No       | Search term to filter tasks by UUID, program hash, or program name (case-insensitive) |

## Example Request

```bash theme={null}
curl -X GET "https://staging.hdp.api.herodotus.cloud/tasks?hdp_tasks_page=1&hdp_tasks_per_page=10&hdp_tasks_search=01JPJ" \
  -H "Content-Type: application/json"
```

## Response

### Success Response (200 OK)

```json theme={null}
{
  "tasks": [
    {
      "uuid": "01JPJ03YJT1A93D6NF56G4GVEQ",
      "status": "TaskDecommitmentCompleted",
      "destinationChainId": "11155111",
      "contractClassHash": "0x1234...",
      "scheduleMode": "onchain",
      "scheduleTxHash": "0xabcd...",
      "dataSourceChains": ["0xaa36a7", "0xaa37dc"],
      "dataDestinationChain": "0xaa36a7",
      "hdpCoreProgramHash": "0x5678...",
      "taskHash": "0x9abc...",
      "programHash": "0xdef0...",
      "programName": "my_module",
      "outputTreeRoot": "0x1234...",
      "createdAt": "2024-03-17T10:24:00Z",
      "updatedAt": "2024-03-17T10:25:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 10,
    "total": 42,
    "totalPages": 5
  }
}
```

### Response Fields

| Field      | Type   | Description           |
| ---------- | ------ | --------------------- |
| tasks      | array  | Array of task objects |
| pagination | object | Pagination metadata   |

### Task Object Fields

| Field                | Type           | Description                            |
| -------------------- | -------------- | -------------------------------------- |
| uuid                 | string         | The unique identifier of the task      |
| status               | string         | Current status of the task             |
| destinationChainId   | string         | Chain ID where the task will be proven |
| contractClassHash    | string         | Hash of the contract class             |
| scheduleMode         | string \| null | Schedule mode: "onchain" or "offchain" |
| scheduleTxHash       | string \| null | Transaction hash if scheduled onchain  |
| dataSourceChains     | array \| null  | Array of source chain IDs              |
| dataDestinationChain | string \| null | Destination chain ID                   |
| hdpCoreProgramHash   | string \| null | HDP core program hash                  |
| taskHash             | string \| null | Task hash                              |
| programHash          | string \| null | Program hash                           |
| programName          | string \| null | Program name                           |
| outputTreeRoot       | string \| null | Output tree root                       |
| createdAt            | string         | ISO 8601 timestamp of task creation    |
| updatedAt            | string         | ISO 8601 timestamp of last update      |

### Pagination Object Fields

| Field      | Type    | Description              |
| ---------- | ------- | ------------------------ |
| page       | integer | Current page number      |
| perPage    | integer | Number of items per page |
| total      | integer | Total number of tasks    |
| totalPages | integer | Total number of pages    |

## Notes

* No authentication is required for this endpoint
* Tasks are ordered by creation date (newest first)
* Search is case-insensitive and matches UUID, program hash, or program name
* Maximum 100 tasks per page to prevent excessive response sizes
* Empty search string is treated as no search filter
