---
title: "Mints a short-lived URL to a file's bytes."
---

> 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

`POST /v1/stores/{store}/assets/{asset}/url`

## Authentication

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

## Path parameters

- `store` (`getAssetUrl.path.store`; string, required) — The store's id.
- `asset` (`getAssetUrl.path.asset`; string, required)
  - minLength 1

## Request body

_Optional._

- `disposition` (`getAssetUrl.disposition`; string, optional)
  - one of `"inline"`, `"attachment"`
- `expires_in` (`getAssetUrl.expires_in`; integer, optional)
  - min 1; max 604800

## Example request

```json
{
  "disposition": "inline",
  "expires_in": 1
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/assets/<asset>/url' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "disposition": "inline",
  "expires_in": 1
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/assets/<asset>/url';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({disposition: 'inline', expires_in: 1})
};

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>/assets/<asset>/url"

payload = {
    "disposition": "inline",
    "expires_in": 1
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Mints a short-lived URL to a file's bytes.

#### Example

```json
{
  "url": "string",
  "expires_at": "string"
}
```

- `url` (`getAssetUrl.response.200.url`; string, required)
- `expires_at` (`getAssetUrl.response.200.expires_at`; any of, required)
  - any of: `string`, `null`

### 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` (`getAssetUrl.response.default.type`; string, required)
  - format `uri`
- `title` (`getAssetUrl.response.default.title`; string, required)
- `status` (`getAssetUrl.response.default.status`; integer, required)
- `detail` (`getAssetUrl.response.default.detail`; string, required)
- `code` (`getAssetUrl.response.default.code`; string, optional)
- `context` (`getAssetUrl.response.default.context`; object, optional)
- `reached_core` (`getAssetUrl.response.default.reached_core`; boolean, optional)
- `core_answer` (`getAssetUrl.response.default.core_answer`; string, optional)


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