Create, update, or delete a user segment
manage_segmentCreate, update, or delete reusable user segments that targeting rules reference by userSegmentId, with optional ifMatch protection against overwriting concurrent edits.
Instructions
Manage reusable user segments, which targeting rules reference by userSegmentId. action=create needs key + name (+ conditions); action=update needs segment and changes only the fields you pass (conditions replaces the whole list; description: "" clears it); action=delete needs segment. On update, pass ifMatch (the etag from get_segment) so a change someone made since you read it is not overwritten. ifMatch is rejected on create and delete: the API cannot make those conditional.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | New segment key, required for create; immutable afterwards | |
| name | No | Display name; required for create | |
| action | Yes | create needs key + name; update and delete need segment | |
| ifMatch | No | etag from get_segment. The write is refused with 412 if the resource changed since that read; re-read and re-apply. Omit to write unconditionally. | |
| project | Yes | Project key | |
| segment | No | Segment key or id; required for update and delete | |
| conditions | No | Conditions a user must match to be in the segment; on update, replaces the whole list | |
| description | No | What the segment means; "" clears it |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||