---
title: "Share the caller's saved list"
---

> 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.

# Share the caller's saved list

Path: Nicer API › favorites

`PUT /favorites/share`

URL: `https://api.nicer.travel/favorites/share`

Shares the caller's saved list through a link and returns its id. One link per person: sharing again returns the same link, with the greeting name and photo refreshed. Anyone with the link can read the list.

## Authentication

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

## Request body

_Required._

- `avatarUrl` (`favorites.share.update.avatarUrl`; any of, optional)
  - any of the following: `string`, `null`

## Example request

```json
{
  "avatarUrl": "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.favorites.share.update({});
```

### Nicer CLI

```bash
nicer favorites share update --input - <<'JSON'
{}
JSON
```

### cURL

```bash
curl --request PUT \
  --url https://api.nicer.travel/favorites/share \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "avatarUrl": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/favorites/share';
const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({avatarUrl: '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/favorites/share"

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "shareId": "string"
}
```

- `shareId` (`favorites.share.update.response.200.shareId`; string, required)
  - pattern: `^[A-Za-z0-9_-]{22}$`

### 400

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

#### Example

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

- `errorCode` (`favorites.share.update.response.400.errorCode`; string, required)
- `errorMessage` (`favorites.share.update.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`favorites.share.update.response.401.errorCode`; string, required)
- `errorMessage` (`favorites.share.update.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`favorites.share.update.response.403.errorCode`; string, required)
- `errorMessage` (`favorites.share.update.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/favorites/favorites.share.update/index.md
