Skip to main content
POST
Add customers to a segment

Authorizations

Authorization
string
header
required

API key created in the organization settings.

Headers

Idempotency-Key
string

Unique key for the operation. Repeating the same key with the same body returns the original response instead of running it again.

Path Parameters

segment_id
string
required

Public segment ID.

Pattern: ^seg_[A-Za-z0-9_-]+$

Body

application/json
customer_ids
string[]
required

Customer IDs (cus_...), up to 500 per call.

Required array length: 1 - 500 elements
Pattern: ^cus_[A-Za-z0-9_-]+$
operation_id
string

Optional unique id for this call, such as a UUID. Reuse the same value only to retry the same call: the retry returns the first result instead of creating again. The same value with a different body is rejected with 409.

Required string length: 8 - 128

Response

Segment customers updated.

object
string
required
Allowed value: "segment_membership"
segment
object
required
action
enum<string>
required
Available options:
add,
remove
changed
integer
required

Customers that changed. When adding, customers already in the segment are not counted.

Required range: x >= 0
next_step
string
required