---
title: "Enable sharing for a saved report and return a login-gated share link"
description: "Generates (or returns the existing) share token. The link is viewable only by signed-in members of the report's workspace."
---

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

Path: Channel Automation API › Analytics

`POST /api/analytics/saved-queries/{id}/share`

Generates (or returns the existing) share token. The link is viewable only by signed-in members of the report's workspace.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `id` (`post/api/analytics/saved-queries/id/share.path.id`; string, required)

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/analytics/saved-queries/<id>/share' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/analytics/saved-queries/<id>/share';
const options = {method: 'POST', 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.channelautomation.com/api/analytics/saved-queries/<id>/share"

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

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

print(response.text)
```

## Responses

### 200

Share token + relative path

### 403

Not a member of the report's workspace

### 404

Report not found


Source: https://developer.channelautomations.com/api/post-api-analytics-saved-queries-id-share/index.md
