# List task versions

> Source: https://docs.clonepartner.com/api-reference/tasks/list-task-versions/

`GET /api/tasks/{id}/versions`

List task versions

**Operation ID:** `listTaskVersions`

## Authentication

### Option 1

- **BearerAuth** (`http bearer`)
  API key token. Create via POST /api/api-keys. Format: `envoy_<hex>`

### Option 2

- **CookieAuth** (`apiKey`)
  Session cookie set after login + TOTP verification

## Path parameters

- `id` — `integer`, `required`
  Resource ID

## Query parameters

- `cursor` — `string`
  Pagination cursor from a previous response
- `limit` — `integer`
  Example: `20`
  - Default: `20`
  - Maximum: 200

## Success responses

### 200

Paginated list of versions

**Content type:** `application/json`

- Type: `PaginatedResult & object`
- All of:
  - Variant 1:
    - Reference: `PaginatedResult`
      - Type: `object`
      - Properties:
        - `result` (`array<unknown>`)
          - Items:
            - Type: `unknown`
        - `nextCursor` (`string | null`)
          - Nullable: yes
        - `prevCursor` (`string | null`)
          - Nullable: yes
        - `total` (`integer`) — Total number of records matching the current filters
  - Variant 2:
    - Type: `object`
    - Properties:
      - `result` (`array<TaskVersion>`)
        - Items:
          - Reference: `TaskVersion`
            - Type: `object`
            - Properties:
              - `id` (`integer`)
              - `task_id` (`integer`)
              - `version` (`integer`)
              - `yaml_content` (`string`)
              - `connector_refs` (`string | null`)
                - Nullable: yes
              - `change_summary` (`string | null`)
                - Nullable: yes
              - `created_at` (`string`)
                - Format: `date-time`

## Examples

### cURL

```bash
curl --request GET \
  --url 'https://your-envoy.example.com/api/tasks/YOUR_ID/versions?cursor=YOUR_CURSOR&limit=20' \
  --header 'Authorization: Bearer $API_KEY'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/tasks/YOUR_ID/versions?cursor=YOUR_CURSOR&limit=20', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);
```
