Skip to main content
PATCH
Update a segment

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

The ID of the saved segment

Example:

"0198a123-4567-7890-abcd-ef0123456789"

Body

application/json
expected_revision
integer
required

The revision you last read. If the segment changed since, the update gives 409.

Required range: x >= 1
Example:

1

name
string
required

New name, up to 150 characters

Required string length: 1 - 150
Pattern: .*\S.*
Example:

"Active trial users"

description
string | null

New description, up to 500 characters. Null clears it.

Required string length: 1 - 500
Pattern: .*\S.*
Example:

"Signed up recently"

definition
object

Rules that select contacts. A contact matches when it matches every clause of at least one group. A definition that compiles to more than 4 KB gives 400; keep long value lists short.

Response

The updated segment

A saved set of rules that selects contacts. Membership is worked out each time the segment is used. Optional fields with no value are left out of responses. Lists page with cursor: pass the previous page's next_cursor until there is none.

id
string
required
read-only

Unique identifier for the segment

Example:

"0198a123-4567-7890-abcd-ef0123456789"

workspace_id
string
required
read-only

Workspace that owns the segment

Example:

"0198a123-4567-7890-abcd-ef0123456788"

name
string
required

Name of the segment, up to 150 characters

Required string length: 1 - 150
Example:

"Active trial users"

description
null | string
required

Description, up to 500 characters, or null when unset

Required string length: 1 - 500
Example:

"Signed up in the last 30 days"

definition
object
required

Rules that select contacts. A contact matches when it matches every clause of at least one group. A definition that compiles to more than 4 KB gives 400; keep long value lists short.

segment_type
enum<string>
required
read-only

Always dynamic: membership is worked out when the segment is used

Available options:
dynamic
Example:

"dynamic"

schema_version
enum<integer>
required
read-only

Version of the definition format

Available options:
1
Example:

1

revision
integer
required
read-only

Current revision; send it as expected_revision when updating

Required range: x >= 1
Example:

1

timestamp_created
string<date-time>
required
read-only

Timestamp when the segment was created

Example:

"2026-11-24T11:57:07.732Z"

timestamp_updated
string<date-time>
required
read-only

Timestamp when the segment was last updated

Example:

"2026-11-24T11:57:07.732Z"

created_by
string
required
read-only

ID of the user who created the segment, or api_key

Example:

"0198a123-4567-7890-abcd-ef0123456787"

updated_by
string
required
read-only

ID of the user who last updated the segment, or api_key

Example:

"0198a123-4567-7890-abcd-ef0123456787"