Description
Update an existing external segment with new members. Partial updates are not supported. Old members are replaced by new members.
In case update fails or is aborted, old members stay in the segment. If there is no mapping for member being imported, then this particular member is skipped.
The maximum number of members in the segment is 2 000 000.
-
The user must be authenticated and have write permissions to the segment's siteGroup.
-
This API is not compatible with execution as a persisted request, as it is designed to support uploading relatively large numbers of segment members in server-to-server integration scenarios, while persisted requests are designed to support integrations with unauthenticated clients, primarily browsers.
Request
The request object has the following fields.
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
Identifier for the external segment to be updated. NB. |
|
|
Boolean |
No |
Ignore invalid users without interrupting the request. The default value is |
|
|
Array of Objects |
Yes |
Array of |
The member object has the the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
The type of user identifier. Type can be cx or a customer prefix. |
|
|
String |
Yes |
Identifier for the member. |
Response
The response for a successful query is an empty object: {}
Examples
$ python cx.py /segment/data/update '{"segmentId":"8nop087ng0iq", "members":[{"type":"exp", "id":"user2"}, {"type":"exp", "id":"user4"}]}'
{}
$ python cx.py /segment/data/update '{"segmentId":"8nop087ng0iq", "members":[]}'
{}
# Update only the 'user1'
$ python cx.py /segment/data/update '{"segmentId":"8nop087ng0iq", "ignoreInvalid":"true", "members":[{"type":"exp", "id":"user1"}, {"type":"wrongPrefix", "id":"user2"}]}'
{}
# Error: ignoreInvalid is not defined but there is an invalid user
$ python cx.py /segment/data/update '{"segmentId":"8nop087ng0iq" "members":[{"type":"exp", "id":"user1"}, {"type":"wrongPrefix", "id":"user2"}]}'