We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/segment/data/update

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

segmentId

String

Yes

Identifier for the external segment to be updated. NB. segmentId must be first field in the JSON object.

ignoreInvalid

Boolean

No

Ignore invalid users without interrupting the request. The default value is false

members

Array of Objects

Yes

Array of member objects which should be imported as members of the external segment. If array is empty then existing members are removed from the segment.

The member object has the the following fields:

Name

Type

Required

Description

type

String

Yes

The type of user identifier. Type can be cx or a customer prefix.

id

String

Yes

Identifier for the member.

Response

The response for a successful query is an empty object: {}

Examples

Bash
$ 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"}]}'

Last updated: