---
title: "Set how long an embed viewer session lives"
method: PUT
path: "/workspaces/{workspace_id}/embed/lifetime"
tags: ["Dashboards v3 · embed"]
---

# Set how long an embed viewer session lives

`PUT /workspaces/{workspace_id}/embed/lifetime`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/embed/lifetime`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Workspace owners and admins only. 60 to 3600 seconds; applies to sessions minted from a board's embed key and from signed tokens (a signed token may not outlive it either).

## Path parameters

- `workspace_id` integer, required

## Request body

- EmbedLifetimeSpec: Session lifetime for this workspace's embeds
  - `params` EmbedLifetimeParams, required
    - `token_ttl` integer, required: Seconds a viewer session lives before the page renews it.

## Response `200`

The saved session lifetime

- EmbedLifetimeResponse
  - `token_ttl` integer, required

## Other responses

- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
