Import segments
Add users to a segment, or remove them, from a file of identifiers.
Your goal
Place a list of users into one or more segments - an email list, a cookie list, a list of account IDs - or take them out again.
Expected outcome
The users in your file appear in the target segments, with the expiration behaviour you specified.
Run a segment import
The segment command
operation
Enum, mandatory
UPDATE or DELETE.
expiration_duration
Integer, mandatory
The number of minutes before the user is removed from the segment. 0 means the user never leaves it.
compartment_id
String, optional
The compartment ID, as an identifier together with the account ID.
user_account_id
String, optional
The account ID, as an identifier together with the compartment ID.
email_hash
String, optional
The email hash, as an identifier.
user_agent_id
String, optional
The user agent ID, as an identifier.
segment_id
String, optional
The ID of the segment the user is inserted into or deleted from.
segment_ids
List of strings, optional
Several segment IDs, for example ["segment_id_1","segment_id_2"].
segment_technical_name
String, optional
The technical name of the segment.
segment_technical_names
List of strings, optional
Several technical names, for example ["technical_name_1","technical_name_2"].
expiration_ts
Number, optional
The timestamp at which the user expires from the segment. 0 means the user never leaves it.
data_bag
Escaped JSON string, optional
The data bag associated with the user–segment relationship.
Choosing between duration and timestamp
expiration_duration is relative to the import, expiration_ts is absolute. Pick according to what your list means:
Membership for a fixed window after the import, such as a 30-day retargeting list
expiration_duration
Membership until a specific date, such as the end of a campaign
expiration_ts
Permanent membership until you remove it
either, set to 0
Verify
The execution reports the success count you expected.
The segment's user count moves by roughly the number of lines imported - allowing for users already in it.
A user from the file appears in the segment, and leaves it when the expiration is reached.
Related pages
Last updated
Was this helpful?