mixpanel_lexicon_tag (Resource)¶
Manages a Mixpanel Lexicon tag — a label for categorizing events and properties (e.g., "KPIs", "acquisition", "revenue"). Tags help organize your data taxonomy and surface related objects in the Mixpanel UI.
Note
Data source note. The mixpanel_lexicon_tag resource and the
mixpanel_tag data source refer to the same Mixpanel
object — a tag is called "tag" in the data-source naming and "lexicon_tag" in
the resource naming for namespace clarity.
Warning
Workspace routing. When the project has workspaces, the provider issues
Lexicon tag requests through the workspace-scoped mount
(/api/app/workspaces/{workspace_id}/data-definitions/tags) — the same route
the Mixpanel web UI uses — targeting the project's canonical workspace (the
global "All Project Data" workspace, else the default, else the first). Both
the workspace and project mounts address the same project-keyed tags, so no
data divergence occurs either way; if the credential is not a member of the
canonical workspace (the workspace mount rejects non-members with a 404 before
any change is made), the provider transparently falls back to the
project-scoped mount (/api/app/projects/{project_id}/data-definitions/tags).
Projects without workspaces always use the project mount.
Example Usage¶
resource "mixpanel_lexicon_tag" "kpi" {
project_id = 1234567
name = "KPIs"
description = "Events that feed company KPI dashboards"
color = "#4CAF50"
}
Related Resources¶
- mixpanel_tag data source — fetches a tag by ID (same object, data-source name).
- mixpanel_event_definition — event Lexicon entries that can be tagged.
- mixpanel_property_definition — property Lexicon entries that can be tagged.
Schema¶
Required¶
name(String) The tag name (shown in the Mixpanel UI and used for categorization).project_id(Number) The project ID (defaults to the provider project). Changing it forces a new resource.
Optional¶
color(String) Hex color code for the tag (e.g.,#4CAF50).description(String) Description of the tag's purpose.
Read-Only¶
id(Number) The unique tag identifier.tag_id(Number) The tag ID (path parameter, same asid).
Import¶
Format: PROJECT_ID:TAG_ID.