---
title: "Read one task file, or its history [read]"
method: GET
path: "/tasks/{id}/files/{path}"
tags: ["tasks"]
---

# Read one task file, or its history \[read\]

`GET /tasks/{id}/files/{path}`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/tasks/{id}/files/{path}`
- Auth: HTTP bearer

Streams the file's bytes with a SHA-256 ETag and Accept-Ranges: bytes. Select an immutable saved version with `version_id`. A single byte Range returns 206; pair it with the saved ETag in If-Range to resume the same bytes. An If-Range mismatch returns the whole selected file, and an invalid or unsatisfiable range returns 416. With `versions=true` returns instead every recorded write of that path, newest first, including writes to a path that has since been deleted; do not combine versions and version_id.

## Path parameters

- `id` string, required
- `path` string, required

## Query parameters

- `versions` 'true'
- `version_id` string

## Headers

- `Range` string
- `If-Range` string

## Response `200`

The bytes, or the version list

- object
  - `versions` TaskFileVersion[], required
    - `id` string, required
    - `sha256` string, required
    - `size_bytes` integer, required
    - `session` string, nullable, required
    - `conflict` boolean, required: The writer had not seen what was current when it wrote
    - `created_at` string, date-time, required

## Other responses

- `206`: The requested byte range
- `416`: Invalid or unsatisfiable byte range
- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-03** `8280a065ef6a`: 5 info
  - added the new optional `header` request parameter `If-Range`
  - added the new optional `header` request parameter `Range`
  - added the new optional `query` request parameter `version_id`
  - added the non-success response with the status `416`
  - …1 more
- **2026-11-02** `e5e8f0229a99`: 1 info
  - added the optional property `error/request_id` to the response with the `default` status

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/tasks/:id/files/:path/get.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
