Create a cohort visible in the Umami UI
umami_create_cohortCreate a saved audience cohort in Umami to group visitors who performed a specific action within a date range, with optional filters. Use it to build reusable segments for Audience analysis.
Instructions
Create a persisted audience Cohort (visitors who performed an action within a date range, optionally filtered further) that appears under Audience > Cohorts in the Umami UI.
Args:
website (string, optional): Website ID, name, or domain.
name (string, required): Display name for the cohort.
action_type ('path' | 'event', required): Whether the qualifying action is a page view or a custom event.
action_value (string, required): The page path (e.g. '/audit') or event name (e.g. 'signup').
date_range ('7day'|'30day'|'90day'|'6month'|'12month'): Window the action must fall in, default '30day'.
filters (array, optional): Additional filters, each { dimension, value, is_not? }.
match ('all' | 'any'): Whether every filter must match, or just one (default: 'all').
Returns: { "id": string, "name": string, "type": "cohort", "parameters": object }
Examples:
"Visitors who viewed /audit in the last 30 days" -> action_type='path', action_value='/audit'
"Mobile visitors who fired 'signup' in the last 90 days" -> action_type='event', action_value='signup', date_range='90day', filters=[{dimension:'device', value:'mobile'}]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name for the cohort. | |
| match | No | Whether every filter must match ('all') or just one ('any'). | all |
| filters | No | Additional filters, if any. | |
| website | No | Website ID (UUID), name, or domain. Optional if UMAMI_DEFAULT_WEBSITE is set. Use umami_list_websites to discover values. | |
| date_range | No | Window in which the action must have occurred. | 30day |
| action_type | Yes | Whether the action is a page view or a custom event. | |
| action_value | Yes | Page path (e.g. '/audit') or event name (e.g. 'signup'). |