mixpanel_dashboard (Resource)¶
Manages a Mixpanel board (mixpanel_dashboard) — the container that arranges saved reports (bookmarks) into a shareable dashboard view. Mixpanel uses "board" and "dashboard" interchangeably; the resource type is mixpanel_dashboard. See mixpanel_bookmark for the saved reports that populate a board.
Example Usage¶
resource "mixpanel_dashboard" "board" {
title = "Product KPIs"
description = "Managed by Terraform"
}
Board layout¶
The synthetic layout attribute manages the board's row/cell layout in the
dashboards PATCH write format (the only layout shape the API persists —
live-verified):
resource "mixpanel_dashboard" "board" {
title = "KPIs"
layout = jsonencode({
rows = [{
id = "CVs5n7mF" # real row id, or temp_id = "..." for a new row
height = 300
cells = [{ id = "RNTLz4Z4", width = 6 }]
}]
rows_order = ["CVs5n7mF"]
})
}
- On create, the layout is applied with a follow-up
PATCHafter thePOST. - On read, the API's GET shape (
rowsas a dict keyed by row id,order,version, cells enriched withcontent_id/content_type) is transformed back into the write format, so refresh and drift detection work; if the GET ever returns an unexpected shape, the prior state is kept forlayoutinstead of failing the refresh. - Use the real row/cell ids (from a prior refresh of this attribute, or a
mixpanel_dashboarddata source) when adjusting an existing layout, and always includeheight/width: rows created withtemp_idare rewritten to server-assigned ids and omitted fields are filled server-side, both of which surface as drift on the next refresh. - Report cells are created automatically when a
mixpanel_bookmarkboard report is attached to the board (see the bookmark resource docs);layoutis for arranging/resizing them. Cells cannot reference content that does not exist on the board. - Transient HTTP 409 conflicts on the dashboards PATCH are retried (3 attempts with backoff).
The generated cards, rows, and card_order attributes predate layout
and are create-time-only / deprecated for layout management: cards is
rejected by the PATCH endpoint with 400, and rows has an empty nested
schema (this block's shape is free-form; manage it via the layout
attribute). They are kept in the schema for state compatibility; use layout
(and mixpanel_bookmark with dashboard_id) instead.
Update Semantics¶
Dashboard updates are partial (PATCH): the API accepts only the writable
fields title, description, filters, is_private, is_restricted,
card_order, time_filter, global_access_type, and layout (the
synthetic layout attribute, see above), and no field is required on update
(live-verified: a PATCH carrying only description succeeds). The provider
filters the update body to exactly this allowlist — create-only fields
(cards, rows, duplicate, generation_type, is_draft,
target_parent_dashboard_id, target_project_id) and server-populated
read-only fields (id, created, creator, ...) are never sent on update;
the API rejects them with 400 extra keys not allowed.
Import¶
Dashboards can be imported using the composite PROJECT_ID:ID format:
Schema¶
Optional¶
card_order(List of String)cards(Attributes List) (see below for nested schema)dashboard_id(Number)description(String)duplicate(Number)filters(Attributes List) (see below for nested schema)generation_type(String)global_access_type(String)is_draft(Boolean)is_private(Boolean)is_restricted(Boolean)layout(String) Board layout in the dashboards PATCH write format:jsonencode({rows = [{id|temp_id, height, cells = [{id|temp_id, width}]}], rows_order = [...]}). See Board layout.project_id(Number)rows(Attributes List) (see below for nested schema)share_with_project(Boolean) Whether to share this entity with the whole project after creation. Entities created by a service account are otherwise visible only to that service account. Defaults totrue. See the Entity sharing guide.target_parent_dashboard_id(Number)target_project_id(Number)time_filter(Attributes) A Mixpanel time-filter object (JSON). (see below for nested schema)title(String)
Read-Only¶
created(String)creator(String)creator_email(String)creator_id(Number)creator_name(String)id(Number) The ID of this resource.is_favorited(Boolean)layout_version(Number) Note: the live API returns this as a semver string (e.g."2.0.0"), which cannot be stored in this numeric attribute; it is left null in that case.modified(String)pinned_date(String)template_type(String)total_view_count(Number)unique_view_count(Number)
Nested Schema for cards¶
Optional:
action(String)chart_options(Attributes) (see below for nested schema)id(String)source_bookmark_id(Number)title(String)type(String)width(Number)
Nested Schema for cards.chart_options¶
Optional:
type(String)
Nested Schema for filters¶
Optional:
custom_property(String)custom_property_id(String)data_group_id(String)filter_operator(String)filter_value(String)join_property_type(String)list_inclusion(String)list_quantifier(String)property_default_type(String)property_object_key(String)property_type(String)resource_type(String)
Nested Schema for rows¶
Nested Schema for time_filter¶
Optional:
date_range(String)display_text(String)