> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Manage a Mammoth live link over the API

> Read and change a Mammoth Live Link over the API: its settings, full key, rotation and fetch history, with the routes, fields and an example curl call.
>
> Applies to: Team and Pro. Roles: Reading needs access to the View; changing settings, reading the key or rotating needs permission to set up the View's exports

Everything in a Live Link's settings is also an API route. Reading the settings and the fetch history needs access to the View. Changing the settings, reading the full key or rotating it needs permission to set up the View's exports. Each route takes an API token as `Authorization: Bearer mm_...`.

## Live link API routes

The routes hang off the Live link task's export:

```
/api/v2/workspaces/<workspace_id>/projects/<project_id>/datasets/<dataset_id>/dataviews/<dataview_id>/pipeline/exports/<export_id>/live-link
```

| Route | What it does |
| --- | --- |
| `GET .../live-link` | The settings: `url`, `access` (`open` or `key`), `key_hint`, `expires_at`, `ended`, `enabled`, the address before the last rotate and when it stops, the last fetch, and `fetches_7d` / `refused_7d` |
| `PATCH .../live-link` | Change `access`, `expires_at` (UTC) or `clear_expiry`, `enabled`, or `new_key: true` (the old key stops at once) |
| `GET .../live-link/key` | The full key and `url_with_key`. Not found for a link without a key |
| `POST .../live-link/rotate` | A new address (and a new key for a key link). `keep_old_for` is `none` (the default), `day` or `week` |
| `GET .../live-link/fetches` | Up to the 200 most recent fetches in the last 30 days, newest first: `fetched_at`, `tool`, `country` (when known), `result` (`sent`, `wrong_key`, `ended`, `off` or `not_ready`) and `via_previous` (fetched through the address before a rotate) |

## Turn a live link off with the API

```bash
curl -X PATCH -H "Authorization: Bearer $MAMMOTH_API_TOKEN" -H "Content-Type: application/json" \
  -d '{"enabled": false}' \
  "https://app.mammoth.io/api/v2/workspaces/<workspace_id>/projects/<project_id>/datasets/<dataset_id>/dataviews/<dataview_id>/pipeline/exports/<export_id>/live-link"
```

On an old public-file link, a `PATCH` or a rotate first gives it a Mammoth address. Its public file keeps working for `keep_old_for`.

## Related

- [Protect and manage a live link](https://mammoth.io/docs/learn/share-and-export/secure-a-live-link/): the same settings in the app.
- [Live links](https://mammoth.io/docs/learn/share-and-export/live-links/): create a link and connect BI tools.
- [Fix a refused live link fetch](https://mammoth.io/docs/learn/share-and-export/secure-a-live-link/#fix-a-refused-live-link-fetch): what each `result` means for the caller.

---
Source: https://mammoth.io/docs/learn/share-and-export/live-link-api.md · Updated: 2026-11-08
