---
title: "Get a shared itinerary 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 shared itinerary file's download link

Path: Nicer API › assets

`POST /assets/public/create-get-url`

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

Returns a presigned link, valid for five minutes, to download a file attached to an itinerary the caller may see: anyone with the shared itinerary while it is visible, its participants and advisor when it is hidden. The file must be listed on the itinerary; intake files and other keys stay private. Anyone may call it, with or without a token. Errors: 403 ERROR_UNAUTHORIZED for a file the caller may not download.

## Authentication

Requires one of the following:

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

## Request body

_Required._

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

## Example request

```json
{
  "assetType": "agentAttachment",
  "key": "string",
  "tripItineraryId": "string",
  "recaptchaToken": "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.public.createGetUrl({
  "assetType": "agentAttachment",
  "key": "string"
});
```

### Nicer CLI

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

### cURL

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

### TypeScript

```typescript
const url = 'https://api.nicer.travel/assets/public/create-get-url';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    assetType: 'agentAttachment',
    key: 'string',
    tripItineraryId: 'string',
    recaptchaToken: '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/public/create-get-url"

payload = {
    "assetType": "agentAttachment",
    "key": "string",
    "tripItineraryId": "string",
    "recaptchaToken": "string"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

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

- `url` (`assets.public.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.public.createGetUrl.response.400.errorCode`; string, required)
- `errorMessage` (`assets.public.createGetUrl.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

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

### 403

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

#### Example

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

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


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