---
title: "Create or rotate the board's embed key (Basic embeds)"
method: POST
path: "/dashboards/{dashboard_id}/embed/key"
tags: ["Dashboards v3 · embed"]
---

# Create or rotate the board's embed key (Basic embeds)

`POST /dashboards/{dashboard_id}/embed/key`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/dashboards/{dashboard_id}/embed/key`
- 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. The key a page presents to embed a board that has no public link. By default the replaced key keeps working for 24 hours, so a planned rotation does not blank every page at once; send keep_previous false to end it immediately, which is what a leaked key needs. Readable again through the config route — it is meant to live in a page — but this route is excluded from the request log.

## Path parameters

- `dashboard_id` integer, required

## Request body

- EmbedKeySpec: How to treat the key being replaced
  - `params` EmbedKeyParams
    - `keep_previous` boolean

## Response `200`

The board's new embed key (also readable via the config)

- EmbedKeyResponse
  - `key` string, required
  - `rotated_at` string, date-time, nullable

## 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/fe078afe239b?raw)
