---
title: "Get file content"
method: GET
path: "/v2/storage/branch/{branchId}/files/{fileId}/content"
tags: ["Files"]
---

# Get file content

`GET /v2/storage/branch/{branchId}/files/{fileId}/content`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/branch/{branchId}/files/{fileId}/content`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/branch/:branchId/files/:fileId/content/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the raw content of a file for inline preview. Only non-sliced files up to 10 MB are supported. Both encrypted and unencrypted files are supported. Files exceeding the size limit are rejected with 400.

## Path parameters

- `fileId` integer, required
- `branchId` string, required

## Response `200`

Raw file content. The `Content-Type` is guessed from the file extension by FileContentService; an unrecognized extension falls back to `application/octet-stream`. The response is always served with `X-Content-Type-Options: nosniff`.

- string

## Other responses

- `400`: Returned when the file is sliced (`storage.files.contentNotAvailable`) or exceeds the 10 MB size limit (`storage.files.contentTooLarge`).
- `404`: Returned when the file does not exist (`storage.files.notFound`).
- `502`: Returned when the storage backend is unreachable or returned an error (`storage.files.contentStorageUnavailable`).

---

[API](https://skmtc.dev/keboola/apis/keboola-storage-api.md) - [All operations](https://skmtc.dev/keboola/apis/keboola-storage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keboola/apis/keboola-storage-api/revisions/34b5ceac0317?raw)
