Create a segment visible in the Umami UI
umami_create_segmentBuild reusable audience segments from one or more filters on dimensions like device, country, or UTM source to isolate and analyze specific visitor groups in Umami.
Instructions
Create a persisted audience Segment (a saved filter combination) that appears under Audience > Segments in the Umami UI.
Args:
website (string, optional): Website ID, name, or domain.
name (string, required): Display name for the segment.
filters (array, required): 1+ filters, each { dimension, value, is_not? }. Dimension is one of: path, referrer, title, query, browser, os, device, country, region, city, language, hostname, tag, event, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, segment, cohort.
match ('all' | 'any'): Whether every filter must match, or just one (default: 'all').
Returns: { "id": string, "name": string, "type": "segment", "parameters": object }
Examples:
"Mobile visitors" -> filters=[{dimension:'device', value:'mobile'}]
"Paid social, not from the US" -> filters=[{dimension:'utmMedium', value:'paid'}, {dimension:'country', value:'US', is_not:true}], match='all'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name for the segment. | |
| match | No | Whether every filter must match ('all') or just one ('any'). | all |
| filters | Yes | 1 or more filters. | |
| website | No | Website ID (UUID), name, or domain. Optional if UMAMI_DEFAULT_WEBSITE is set. Use umami_list_websites to discover values. |