> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.labric.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.labric.co/_mcp/server.

# Get a file's content

GET https://platform.labric.co/api/v1/files/{file_id}/content

Fetch a source file's content for inspecting raw instrument output.

Returns a presigned download URL plus a best-effort UTF-8 text preview of
the start of the file. Large files return a URL only (no inline preview);
fetch the full bytes via the URL when needed.

Requires an API key with the `read` scope.

Reference: https://docs.labric.co/api-reference/labric-api/files/get-content

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `file_id` (string, required)

## Response

### 200

OK

- `file_id` (string, required)
- `file_name` (string, required, nullable)
- `size_kilobytes` (integer, required, nullable)
- `download_url` (string, required) — Presigned URL to fetch the full file (e.g. via the SDK).
- `text_preview` (string, required, nullable) — Best-effort UTF-8 decode of the start of the file, or null if skipped.
- `preview_truncated` (boolean, required) — True if the file is longer than the inlined preview.
- `preview_skipped_reason` (string, required, nullable) — Why an inline preview was not returned (e.g. file too large).

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, required)

### 401 Unauthorized Error

Unauthorized

- `detail` (string, required)

### 403 Forbidden Error

Forbidden

- `detail` (string, required)

### 404 Not Found Error

Not Found

- `detail` (string, required)

### 422 Unprocessable Entity Error

Unprocessable Content

- `detail` (list of map from string to any, required)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required)

## Examples

**Response**

```json
{
  "file_id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
  "file_name": "experiment_2024-06-15_output.csv",
  "size_kilobytes": 512,
  "download_url": "https://platform.labric.co/downloads/a1b2c3d4-e5f6-7890-ab12-cd34ef567890?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
  "text_preview": "Time,Temperature,Pressure\n0,22.5,101.3\n1,22.7,101.2\n2,22.6,101.3\n3,22.8,101.4\n4,22.9,101.3\n",
  "preview_truncated": true,
  "preview_skipped_reason": null
}
```

**SDK Code**

```python
from labric import Labric

client = Labric(
    api_key="YOUR_TOKEN_HERE",
)

client.files.get_content(
    file_id="a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
)

```