---
title: "Preview a template mapping applied to a target dataset"
method: POST
path: "/dashboards/v3/templates/preview"
tags: ["Dashboard v3"]
---

# Preview a template mapping applied to a target dataset

`POST /dashboards/v3/templates/preview`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/dashboards/v3/templates/preview`
- 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`

The apply modal's live mapping-change preview: build the applied canvas for a target dataset (resolve the mapping when unconfirmed, else use the passed one + overrides), derive its plan/specs through dash-render, and return them in the SAME render-payload shape as /{id}/canvas alongside the target-resolved mapping + fidelity — so one call feeds both the canvas-host preview AND the per-role recipe. NOTHING persists: no dashboard row, no bake, no job — the plan is derived non-persisted (plan_only) and no data is resolved (the preview renders static, figures as skeletons; live data exists only after apply). Accepts the SAME inputs as /v3/templates/apply so the modal's state maps 1:1. Synchronous (called on every override change) — the profile builds + plan round-trip run off the event loop. Auth: read on the source dashboard (curated-template bypass) + the target dataview ACL (mirrors resolve-mapping).

## Request body

- PreviewTemplateSpec: Preview a template mapping applied to a target dataset
  - `params` PreviewTemplateParams, required
    - `source_dashboard_id` integer, required: The v3 dashboard to template from (read access required)
    - `target_dataview_id` integer, required: The dataview to re-bind the roles onto
    - `table_item_id` integer, nullable: Target data item to profile (defaults to the dataview's latest)
    - `mapping` object, nullable: The confirmed mapping (auto-resolved when omitted)
    - `overrides` object: Per-role user overrides: source field → chosen target (or null to drop)

## Response `200`

Rendered preview (canvas/plan/specs) + resolved mapping + fidelity

- PreviewTemplateResponse
  - `canvas` object, required
  - `plan` object, nullable
  - `specs` object
  - `meta` object
  - `mapping` object, required
  - `fidelity` object, required
  - `target_fields` object
  - `results` object
  - `coverage` object

## 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)
