---
title: "Get a private file's download link"
---

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

# Get a private file's download link

Path: Nicer API › assets

`POST /assets/create-get-url`

URL: `https://api.nicer.travel/assets/create-get-url`

Returns a presigned link, valid for an hour, to download one private file: an itinerary file to a traveler on the trip, its advisor, an admin of its agency or Nicer staff; the caller's own assistant attachment, uploaded ID document or raw avatar; and to Nicer staff any assistant attachment, ID document, avatar, private asset or itinerary import output. Errors: 403 ERROR_UNAUTHORIZED for a file the caller may not download.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Request body

_Required._

- `assetType` (`assets.createGetUrl.assetType`; string, required)
  - one of `"agentAttachment"`, `"tripItineraryAsset"`, `"tripItineraryAttachment"`, `"tripItineraryItineraryDocumentAI"`, `"userDocument"`, `"rawAvatar"`, `"privateAsset"`, `"ai-itinerary-output"`
- `key` (`assets.createGetUrl.key`; string, required)
  - maxLength: `1024` · minLength: `1`

## Example request

```json
{
  "assetType": "agentAttachment",
  "key": "string"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.assets.createGetUrl({
  "assetType": "agentAttachment",
  "key": "string"
});
```

### Nicer CLI

```bash
nicer assets create-get-url --input - <<'JSON'
{
  "assetType": "agentAttachment",
  "key": "string"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/assets/create-get-url \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "assetType": "agentAttachment",
  "key": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/assets/create-get-url';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({assetType: 'agentAttachment', key: 'string'})
};

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

### Python

```python
import requests

url = "https://api.nicer.travel/assets/create-get-url"

payload = {
    "assetType": "agentAttachment",
    "key": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

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

- `url` (`assets.createGetUrl.response.200.url`; string, required) — The presigned link: anyone holding it can download the file until it expires, so open it right away and never store it.

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`assets.createGetUrl.response.400.errorCode`; string, required)
- `errorMessage` (`assets.createGetUrl.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`assets.createGetUrl.response.401.errorCode`; string, required)
- `errorMessage` (`assets.createGetUrl.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`assets.createGetUrl.response.403.errorCode`; string, required)
- `errorMessage` (`assets.createGetUrl.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/assets/assets.createGetUrl/index.md
