Save a segment
POST/ v1/ projects/ {project}/ segments
A shared segment needs analytics.manage.
Path parameters
project
The project's id (
prj_…).Body
name
visibility
Personal (only its owner sees it) or shared with the team.
personalsharedmatch
allanyfilters
One filter of a segment.
Show 3 fieldsHide fields
dimension
operator
isis_notcontainsstarts_withregexvalues
Responses
The Segment.
id
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).project_id
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).owner_id
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).visibility
Personal (only its owner sees it) or shared with the team.
personalsharedname
match
allanyfilters
One filter of a segment.
Show 3 fieldsHide fields
dimension
operator
isis_notcontainsstarts_withregexvalues
created_at
A time in UTC, ISO 8601.
updated_at
A time in UTC, ISO 8601.
Example response
1{2"id": "seg_01JD8Q2M4W9XK3T7B5",3"project_id": "prj_01JD8Q2M4W9XK3T7B5",4"owner_id": "id_01JD8Q2M4W9XK3T7B5",5"visibility": "personal",6"name": "Production",7"match": "all",8"filters": [9{10"dimension": "country",11"operator": "is",12"values": [13"string"14]15}16],17"created_at": "2026-11-21T09:30:00Z",18"updated_at": "2026-11-21T09:30:00Z"19}
Errors
Every error has the same shape: error.code, a message for people and details.
| Status | Code |
|---|---|
validation_error | |
forbidden |