Salesforce Audience Studio API for Platform Segments


Audience Studio is technology agnostic and continues to support customers who use different forms of analysis, both offline and online.

The following guide is for users that perform their own offline analysis and wish to create new segments via the API. These platform segments can be comprised of a) Krux User IDs (KUIDs), b) mobile IDs c) first party ID, that has been matched with KUIDs.


Client to provide Audience Studio to provide
Name & Location of user-data file transfer Client’s account API key, S3 credentials and location
When transfer will take place (and frequency)
 daily hour in UTC time to process
Naming Convention
Please suffix file name with date
   File format: ^ or <tab> delimited

First, platform segments are created via the API as described below.

Next, the user-data file must be uploaded so Audience Studio can process and associate the users with the appropriate platform segments.

After the first user-segment file upload, please allow two weeks for Audience Studio to automate the file processing and make the information available in the UI.

Create Platform Segments in the UI

Users can create platform segments directly in the UI. Click on "+ New Segment" and select "Platform" (screenshot below) as an option and go through the usual workflow of naming and creating a segment. Because platform segments are essentially "shell" segments, you will not define any rules or use attributes in creating them. 

If you do not see an option for "Platform" type segments please contact your Salesforce Audience Studio representative to get this provisioned. 

Create Platform Segments via API

Platform segments are not rule-based and therefore no rules will be shown in the UI. Users for these platform segments can either by loaded from external systems or determined via external means.

A platform segment can be created by sending the following parameters as part of the API call. Use the same username/password as for Konsole.

  1. "name" : Name of platform segment – this must be unique and is mandatory.
  2. "type", "category", "sub_category", "description" : Optional organisational descriptions.

Example API

curl --user <username>:<passwd> --dump-header - -H "Content-Type: application/json" --data '{"name": "segment_a"}'<API_KEY>

HTTP/1.1 200 OK
{"message": "Segment has been created", "segment": {"category": "", "description": "", "id": 16681, "name": "segment_a", "segment_uuid": "I1p1W5QN", "segment_uuid_long": "n21l7tjtr", "sub_category": "" , "type": "" }}

An alternative free API tool is Postman ( Create your platform segments with a POST request with the same JSON payload in above and user authentication as your console account.

Create Segments Using Other Segments

A new segment can be created using existing segments. To create a segment, a POST request needs to be sent. In the request, the following is required:

  1. "name" : Specifies the segment name
  2. "operator" : OR|AND. Specifies the operator that connects the segments.
  3. "rules" : Specifies the rules.
  4. "segments" : List of segment IDs that must be combined to create a new segment.

Example API for creating a new segment based on segments 234 and 235 which must already exist:

curl --user <username>:<passwd> --dump-header - -H "Content-Type: application/json" --data '{"name": "segment_b", "operator": "OR", "rules" : {"segment" : [234, 235]} }' <API_KEY>

HTTP/1.1 200 OK
{"message": "Segment has been created" "segment": {"category": "", "description": "", "id": 16681, "name": "segment_b", "segment_uuid": "I1p1W5QN", "segment_uuid_long": "n21l7tjtr", "sub_category": "" , "type": "" }}

Remove Platform Segments

Platform segments can be removed using APIs as well. A platform segment can be deleted by sending a DELETE request with the following parameter as part of the API call:

  1. "segment_uuid" : UUID of the segment that needs to be removed. This is mandatory and is the same as the "segment_uuid" parameter which is returned when a platform segment is created.

Example API

curl --user <username>:<passwd> -H "Content-Type: application/json" -X DELETE '<API_KEY>&segment_uuid=JUd4YrAR'

HTTP/1.1 200 OK
{"message": "Segment JUd4YrAR has been deleted"}

Upload User-data File for Platform Segments

A Krux Amazon S3 bucket can be supplied to upload files daily.  For example  s3://krux-partners/client-NAME/uploads/platform_seg/YYYY-MM-DD/

The user data file can be gzipped or uncompressed if the size is manageable. Files equal to or greater than 1GB should be compressed with gzip.

Please notify Audience Studio on the location, names, and format of the user data file.  

The standard file format is:


Note: ID is either: Audience Studio browser ID, mobile IDFA, or your first party ID. The segment_uuid_long field is the ID returned in the API call used to create the segment shell.

Each row should contain only ID to 1 segment ID.

If the user membership per segment does NOT change from day to day, do not upload the segment again.  The segment's population will not change.  

If the user membership per segment DOES change, upload the segment again with ALL users.  For example

  • Day 1 - segment A size = 100 - upload 100 ids to segment A
  • Day 2 - segment A size = 100 - do not upload any users for segment A
  • Day 3 - segment A size = 200 - upload all 200 ids to segment A

Expiry policy

Users do not expire out of the Audience Studio platform segments.  For example, if you upload a segment with 1MM users, no users will drop out, unless a new upload removes the users.



Important:  If you wish to pass through a corresponding file for consent to provide consent signals for the devices included in your first party import file, you must drop the consent file one day prior to dropping the first party import file on S3.  This way we can guarantee that the consent for the devices will be ingested prior to ingesting records from the import file, and that we can correctly gate data collection and other data activities accordingly.  


Need Help?

If you need help with Audience Studio API Platform Segments, don't hesitate to contact the Salesforce Audience Studio Solutions team at

Have more questions? Submit a request


Article is closed for comments.