---
title: "Answers the bytes of a private file a capability names, to the bearer that asked for it."
description: "The URL `POST /assets/{asset}/url` answers for a private file, or a download. Fetch it with the same bearer, before it is refreshed."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › file

`GET /v1/stores/{store}/files/{capability}`

The URL `POST /assets/{asset}/url` answers for a private file, or a download. Fetch it with the same bearer, before it is refreshed.

## Authentication

- `bearer`, http, header `Authorization`, scopes: `file:read`

## Path parameters

- `store` (`getFile.path.store`; string, required) — A store the token reaches; the file is served from the store its URL was minted for.
- `capability` (`getFile.path.capability`; string, required) — The capability in the URL `POST /assets/{asset}/url` answered: the path segment after `/files/`. A file name may follow it as another segment, never inside this one.
  - minLength 1

## Header parameters

- `Range` (`getFile.header.Range`; string, optional) — One byte range of a file shown in place, `bytes={first}-{last}`, `bytes={first}-` or `bytes=-{suffix}`; a download is answered whole.
- `If-Range` (`getFile.header.If-Range`; string, optional) — The file's `ETag` from an earlier answer: the range is answered only while the file is unchanged, else the whole file.

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/files/<capability>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/files/<capability>';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/files/<capability>"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The file's bytes, with its type and disposition.

#### Example

```text
string
```

### 206

The range asked for.

#### Example

```text
string
```

### 416

The range lies outside the file, or is other than one bytes range.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`getFile.response.416.type`; string, required)
  - format `uri`
- `title` (`getFile.response.416.title`; string, required)
- `status` (`getFile.response.416.status`; integer, required)
- `detail` (`getFile.response.416.detail`; string, required)
- `code` (`getFile.response.416.code`; string, optional)
- `context` (`getFile.response.416.context`; object, optional)
- `reached_core` (`getFile.response.416.reached_core`; boolean, optional)
- `core_answer` (`getFile.response.416.core_answer`; string, optional)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`getFile.response.default.type`; string, required)
  - format `uri`
- `title` (`getFile.response.default.title`; string, required)
- `status` (`getFile.response.default.status`; integer, required)
- `detail` (`getFile.response.default.detail`; string, required)
- `code` (`getFile.response.default.code`; string, optional)
- `context` (`getFile.response.default.context`; object, optional)
- `reached_core` (`getFile.response.default.reached_core`; boolean, optional)
- `core_answer` (`getFile.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/get-file/index.md
