# Get a specific task version

> Source: https://docs.clonepartner.com/api-reference/tasks/get-task-version/

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

Get a specific task version

**Operation ID:** `getTaskVersion`

## 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
- `vid` — `integer`, `required`
  Version number

## Success responses

### 200

Task version

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

- 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`

## Error responses

### 404

Resource not found

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

- Reference: `Error`
  - Type: `object`
  - Properties:
    - `error` (`string`)
      - Example: `NOT_FOUND`
    - `message` (`string`)
      - Example: `Resource not found`

Example:

```json
{
  "error": "NOT_FOUND",
  "message": "Resource not found"
}
```

## Examples

### cURL

```bash
curl --request GET \
  --url 'https://your-envoy.example.com/api/tasks/YOUR_ID/versions/YOUR_VID' \
  --header 'Authorization: Bearer $API_KEY'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/tasks/YOUR_ID/versions/YOUR_VID', {
  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);
```
