Skip to content
Last updated

Selligent Export Integration

This integration enables uploading data from Treasure AI directly to Selligent static segments. Selligent, is an omnichannel marketing automation platform for audience segmentation and campaign activation.

The Selligent export integration loads records into a Selligent master List and then assigns those records to one or more static Segments. The target Segment is determined for each row by the selligent_segment column, or by another column that you configure.

Prerequisites

  • Basic knowledge of Treasure AI.
  • Basic knowledge of Selligent Lists, static Segments, and API names.
  • A Selligent API key and API secret.
  • Your Selligent base URL, for example https://customer.slgnt.eu for the EU region or https://customer.slgnt.us for the US region.
  • Your Selligent organization identifier.
  • A target List API name. If you want Treasure AI to create the List, enable create_list_if_not_exists.
  • A key field, such as CUSTOMER_IDENTIFIER or EMAIL, that uniquely identifies records for deduplication.

Static IP Address of Treasure Data Integration

If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.

Please find the complete list of static IP addresses, organized by region, at the following document

Limitations

  • This integration supports Selligent static Segments only.
  • The integration always loads records into the master List first, then loads records into the target Segment.
  • One export run can write to multiple Segments when the query result contains multiple values in the configured Segment routing column.
  • The Segment routing column is not sent as a Selligent field.
  • When you export to an existing List, all input fields must already exist in that List. If a field is missing, the export fails with a configuration error.
  • The integration does not delete records from the master List. In replace mode, it clears Segment membership before loading the new Segment data.
  • Selligent rate limit responses and server errors are retried. Other 4xx responses fail fast because they usually indicate an authentication or configuration issue.

Create a New Authentication

In Treasure AI, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access Selligent.

  1. Open TD Console.
  2. Navigate to Integrations Hub > Catalog.
  3. Click the search icon on the far right of the Catalog screen and enter Selligent.
  4. Hover over the Selligent connector and select Create Authentication.

The New Authentication dialog opens.

  1. Enter the Selligent Base URL.
  • EU region: https://customer.slgnt.eu
  • US region: https://customer.slgnt.us
  1. Enter your Selligent API Key.
  2. Enter your Selligent API Secret.
  3. Enter a name for your connection.
  4. Select Continue.
Parameter Required Description
base_urlYesFull Selligent base URL, for example https://customer.slgnt.eu or https://customer.slgnt.us.
api_keyYesSelligent API key.
api_secretYesSelligent API secret.

Configure Export Results

To configure the integration:

  1. Open TD Console.
  2. Navigate to Data Workbench > Queries.
  3. Click New Query to create a query, or open a saved query that you want to export.
  4. At the top of the query editor, select Export Results.
  5. Select the Selligent authentication that you created.
  6. Configure the export parameters.

How the Export Works

The integration uses a two-step load process:

  1. List load: The integration upserts all valid records in the batch into the Selligent List by using key_fields for deduplication.
  2. Segment load: The integration groups records by the configured Segment routing column, then loads each group into the matching static Segment.

The Segment routing column is required. Each value in that column must match the target Segment api_name. Rows with a null or blank Segment value are skipped when skip_invalid_records is true.

Export Parameters

Parameter Required Default Description
organizationYesNoneSelligent organization identifier used in the API URL path.
list_api_nameYesNoneTarget Selligent List API name. This is the master contact List that stores records before Segment assignment.
create_list_if_not_existsNofalseCreates the List and its fields if the List does not exist.
list_data_import_optionNoInsertAndUpdateList load behavior. Valid values are InsertAndUpdate, OnlyInsert, and OnlyUpdate.
segment_columnYesNoneInput column that contains the target Segment api_name for each row. This column is used for routing and is not sent as a Selligent field.
create_segment_if_not_existsNofalseCreates a static Segment if the target Segment does not exist.
segment_data_import_optionYesappendSegment load behavior. Use append to add members while keeping existing Segment members. Use replace to clear the Segment before loading new members.
key_fieldsYesNoneComma-separated field names that identify unique records, for example CUSTOMER_IDENTIFIER or CUSTOMER_IDENTIFIER,EMAIL.
deduplicationNoImportLastMatchDeduplication behavior for duplicate keys in a load. Valid values are ImportLastMatch and ImportFirstMatch.
error_handlingNoContinueOnErrorError handling behavior for the Selligent load API. Valid values are ContinueOnError and StopOnError.
modeNoSyncData transfer mode for the Selligent load API. Valid values are Sync and Stream.
skip_invalid_recordsNotrueSkips records that fail validation, such as records with a null or blank Segment routing value. When set to false, invalid records cause the export to fail.

Data Mapping

Treasure AI query result Selligent destination Description
The column configured in segment_columnSegment routing onlyDetermines the target Segment api_name for each row. The integration does not send this column as a field.
Any other query result columnSent to Selligent as List and Segment data.

When create_list_if_not_exists is true, the integration creates Selligent fields from the Treasure AI query result schema, excluding the Segment routing column.

Treasure AI type Selligent data type
stringText (length 500)
longLong
doubleFloat
booleanBoolean
timestampDateTime

Import Modes

Parameter Value Behavior
list_data_import_optionInsertAndUpdateInserts new records into the List and updates existing records with matching key fields.
list_data_import_optionOnlyInsertInserts new List records only.
list_data_import_optionOnlyUpdateUpdates existing List records only.
segment_data_import_optionappendAdds records to the target Segment. Existing Segment members remain in the Segment.
segment_data_import_optionreplaceClears the target Segment, then loads records from the query result into the Segment.

Sample Queries

Basic Segment Export

This example exports active customers to a single Selligent Segment named active_customers.

SELECT
  'active_customers' AS selligent_segment,
  customer_id AS customer_identifier,
  email AS email,
  first_name AS first_name,
  last_name AS last_name
FROM customers
WHERE status = 'active'
  AND email IS NOT NULL

Sample query result

selligent_segment customer_identifier email first_name last_name
active_customersC001alice@example.comAliceKim
active_customersC002bob@example.comBobSato
active_customersC003carol@example.comCarolNguyen

Required configuration

Parameter Value
organizationmy_org
list_api_namemaster_contacts
segment_columnselligent_segment
key_fieldsCUSTOMER_IDENTIFIER
segment_data_import_optionappend
list_data_import_optionInsertAndUpdate
create_segment_if_not_existstrue

In Selligent, the integration sends the fields as CUSTOMER_IDENTIFIER, EMAIL, FIRST_NAME, and LAST_NAME.

Multi-Segment Export

This example routes customers to different Selligent Segments based on business logic. VIP customers are sent to vip_customers, dormant customers are sent to re_engagement, and other customers are sent to standard_customers.

SELECT
  CASE
    WHEN lifetime_value >= 1000 THEN 'vip_customers'
    WHEN last_purchase_at < CURRENT_TIMESTAMP - INTERVAL '180' DAY THEN 're_engagement'
    ELSE 'standard_customers'
  END AS selligent_segment,
  customer_id AS customer_identifier,
  email AS email,
  first_name AS first_name,
  lifetime_value AS lifetime_value,
  last_purchase_at AS last_purchase_at
FROM customer_profile
WHERE email IS NOT NULL
  AND opt_in_email = true

Sample query result

selligent_segment customer_identifier email first_name lifetime_value last_purchase_at
vip_customersC101mei@example.comMei1520.502026-05-01 10:15:00
re_engagementC204dan@example.comDan210.002025-09-20 08:30:00
standard_customersC319lina@example.comLina480.752026-04-12 19:45:00

Required configuration

Parameter Value
organizationmy_org
list_api_namemaster_contacts
segment_columnselligent_segment
key_fieldsCUSTOMER_IDENTIFIER
segment_data_import_optionappend
list_data_import_optionInsertAndUpdate
create_segment_if_not_existstrue
deduplicationImportLastMatch
error_handlingContinueOnError

The integration loads all valid rows into master_contacts first. It then performs one Segment load for each unique Segment value in the batch: vip_customers, re_engagement, and standard_customers.

Schedule the Query Export Jobs (Optional)

You can use Scheduled Jobs with Result Export to periodically write the output result to Selligent.

Treasure AI's scheduler feature supports periodic query execution to achieve high availability.

(Optional) Schedule Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Treasure Data's scheduler feature supports periodic query execution to achieve high availability.

When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.

For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.

Scheduling your Job Using Treasure Console

  1. Navigate to Data Workbench > Queries

  2. Create a new query or select an existing query.

  3. Next to Schedule, select None.

  4. In the drop-down, select one of the following schedule options:

    Drop-down ValueDescription
    Custom cron...Review Custom cron... details.
    @daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
    @hourly (:00)Run every hour at 00 minutes.
    NoneNo schedule.

Custom cron... Details

Cron ValueDescription
0 * * * *Run once an hour.
0 0 * * *Run once a day at midnight.
0 0 1 * *Run once a month at midnight on the morning of the first day of the month.
""Create a job that has no scheduled run time.
 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat.
  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.

A single space is required between each field. The values for each field can be composed of:

Field Value Example Example Description
A single value, within the limits displayed above for each field.
A wildcard '*' to indicate no restriction based on the field.'0 0 1 * *'Configures the schedule to run at midnight (00:00) on the first day of each month.
A range '2-5', indicating the range of accepted values for the field.'0 0 1-10 * *'Configures the schedule to run at midnight (00:00) on the first 10 days of each month.
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field.'0 0 1,11,21 * *'Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run.'30 */2 1 * *'Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'.'0 0 5,*/10,25 * *'Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
  1. (Optional) You can delay the start time of a query by enabling the Delay execution.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.

Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.

(Optional) You can delay the start time of a query by enabling the Delay execution.

Activate a Segment in Audience Studio

You can also send segment data to the target platform by creating an activation in the Audience Studio.

  1. Navigate to Audience Studio.
  2. Select a parent segment.
  3. Open the target segment, right-mouse click, and then select Create Activation.
  4. In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
  5. Customize the activation output in the Output Mapping panel.

  • Attribute Columns
    • Select Export All Columns to export all columns without making any changes.
    • Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
  • String Builder
    • + Add string to create strings for export. Select from the following values:
      • String: Choose any value; use text to create a custom value.
      • Timestamp: The date and time of the export.
      • Segment Id: The segment ID number.
      • Segment Name: The segment name.
      • Audience Id: The parent segment number.
  1. Set a Schedule.

  • Select the values to define your schedule and optionally include email notifications.
  1. Select Create.

If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.

Configure Export Results in Workflow (Optional)

Within Treasure Workflow, you can specify the use of a data connector to export data.

Learn more at Using Workflows to Export Data with the TD Toolbelt.

Sample Workflow Configuration

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-selligent:
  td>: queries/selligent_export.sql
  result_connection: selligent
  result_settings:
    organization: my_org
    list_api_name: master_contacts
    create_list_if_not_exists: false
    list_data_import_option: InsertAndUpdate
    segment_column: selligent_segment
    create_segment_if_not_exists: true
    segment_data_import_option: append
    key_fields: CUSTOMER_IDENTIFIER
    deduplication: ImportLastMatch
    error_handling: ContinueOnError
    mode: Sync
    skip_invalid_records: true

Troubleshooting

Error or symptom Cause Solution
Authentication fails with 401 or 403.The api_key or api_secret is incorrect, or the credentials do not have access to the organization.Verify the API key, API secret, Base URL, and Selligent organization identifier.
The export fails because the List is not found.The list_api_name does not exist and create_list_if_not_exists is false.Verify the List API name or set create_list_if_not_exists to true.
The export fails because a Segment is not found.The Segment value from segment_column does not exist and create_segment_if_not_exists is false.Verify the Segment api_name values in the query result or set create_segment_if_not_exists to true.
Rows are skipped.The Segment routing column is null or blank and skip_invalid_records is true.Update the query so every row has a valid Segment api_name, or set skip_invalid_records to false to fail the export instead of skipping rows.
The export fails because an input field is not found in the List.The target List exists, but one or more query result columns do not exist as List fields.Add the missing fields to the Selligent List or adjust the query output columns.
Duplicate records produce unexpected values.Multiple rows share the same key_fields value.Review the query result and the deduplication setting. Use ImportLastMatch when the last matching row should win, or ImportFirstMatch when the first matching row should win.
Selligent returns partial success.Selligent accepted some records and rejected others.Review the invalid record details in the job logs and correct the source data or List field definitions.

See Also