List segment rules
Returns the organization's customer segmentation rules, newest first, keyset-paginated. Each rule applies its tag to every customer whose metric satisfies the comparison, and removes it from every customer whose metric no longer does; evaluation runs once a day on a platform-wide job.
query Parameters
limitPage size. Values above the server-side cap are clamped (standard default 50, cap 200; a few document-heavy lists use larger windows). Invalid values fall back to the default.
cursorOpaque continuation token from the previous response's pagination.cursor. Omit for the first page. Cursors are stateless and do not expire, but are only valid for the list and filters that produced them.
Headers
X-Workspace-IdSelects the workspace this request operates in, by workspace UUID or slug (e.g. a sandbox workspace for test integrations). Omitted: the organization's default live workspace. Unknown workspace: 404; workspace outside your organization: 403. Discover workspaces via GET /workspaces.
Workspace UUID or slug.
List segment rules › Responses
OK
Create a segment rule
Creates a segmentation rule that tags every customer whose metric satisfies the comparison. Only one active rule may claim a given tag, so a rule change is delete-then-create; creating a second rule for a tag that already has one returns 409. There is no update operation.
Headers
Idempotency-KeyUnique key that makes this POST safe to retry: repeats with the same key replay the first response instead of re-executing. Replays are scoped to the retrying principal (same API key / user) and kept for 24 hours. Required on every POST.
Client-generated idempotency key (e.g. a UUID).
X-Workspace-IdSelects the workspace this request operates in, by workspace UUID or slug (e.g. a sandbox workspace for test integrations). Omitted: the organization's default live workspace. Unknown workspace: 404; workspace outside your organization: 403. Discover workspaces via GET /workspaces.
Workspace UUID or slug.
Create a segment rule › Request Body
applied_tag_idThe tag this rule applies to (and removes from) customers. Must not already be claimed by another active rule.
metricWhich computed fact the rule tests.
operatorHow the metric is compared to value.
value^-?\d+(\.\d+)?$ · requiredThe threshold the metric is compared against.
Create a segment rule › Responses
Created
Get a segment rule
Returns a single segment rule by UUID.
path Parameters
idSegment rule ID
Headers
X-Workspace-IdSelects the workspace this request operates in, by workspace UUID or slug (e.g. a sandbox workspace for test integrations). Omitted: the organization's default live workspace. Unknown workspace: 404; workspace outside your organization: 403. Discover workspaces via GET /workspaces.
Workspace UUID or slug.
Get a segment rule › Responses
OK
Delete a segment rule
Soft-deletes the rule and frees its tag for a replacement. Tags the rule already applied to customers are left in place — they are ordinary tags once written, and other rules or audiences may reference the same tag; the next evaluation simply stops maintaining them.
path Parameters
idSegment rule ID
Headers
X-Workspace-IdSelects the workspace this request operates in, by workspace UUID or slug (e.g. a sandbox workspace for test integrations). Omitted: the organization's default live workspace. Unknown workspace: 404; workspace outside your organization: 403. Discover workspaces via GET /workspaces.
Workspace UUID or slug.
Delete a segment rule › Responses
No Content