---
title: "Mint a preview token for the embed simulator"
method: POST
path: "/dashboards/{dashboard_id}/embed/preview-token"
tags: ["Dashboards v3 · embed"]
---

# Mint a preview token for the embed simulator

`POST /dashboards/{dashboard_id}/embed/preview-token`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/dashboards/{dashboard_id}/embed/preview-token`
- 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`

Editor-only. Signs a token with the workspace secret server-side, so the author can see the board under a given scope without ever seeing the secret. `claims` is keyed by the board's row-level-security column, exactly as a host's token is; same lifetime rules.

## Path parameters

- `dashboard_id` integer, required

## Request body

- EmbedPreviewTokenSpec: Mint a preview token for the embed simulator
  - `params` EmbedPreviewTokenParams, required
    - `claims` object

## Response `200`

A short-lived token the simulator hands to the embed frame

- EmbedPreviewTokenResponse
  - `token` string, required
  - `expires_at` integer, required
  - `embed_url` string, required

## Other responses

- `201`: Document created, URL follows
- `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/5dfd1c296ded?raw)
