# 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](/apis/endpoints/ip-addresses-integrations-result-workers)

## 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**.


![](/assets/catalog-search-result.ad5dfd2a9e8e703d247c12e4cee274d0341b348addb122b10bd2d0fbefca0724.17524419.webp)

The New Authentication dialog opens.

![](/assets/create-auth-dialog.3f8ec4a1e0af124aef44c0a66dd9221445ab1d38a86252df6e792635db739106.17524419.webp)

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_url` | Yes | Full Selligent base URL, for example `https://customer.slgnt.eu` or `https://customer.slgnt.us`. |
| `api_key` | Yes | Selligent API key. |
| `api_secret` | Yes | Selligent 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.


![](/assets/export-configuration-dialog.cc9e081ae00695053f232c30921a2383274c312a0c906fb92d9ac2efc478fe3e.17524419.webp)

### 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 |
|  --- | --- | --- | --- |
| `organization` | Yes | None | Selligent organization identifier used in the API URL path. |
| `list_api_name` | Yes | None | Target Selligent List API name. This is the master contact List that stores records before Segment assignment. |
| `create_list_if_not_exists` | No | `false` | Creates the List and its fields if the List does not exist. |
| `list_data_import_option` | No | `InsertAndUpdate` | List load behavior. Valid values are `InsertAndUpdate`, `OnlyInsert`, and `OnlyUpdate`. |
| `segment_column` | Yes | None | Input 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_exists` | No | `false` | Creates a static Segment if the target Segment does not exist. |
| `segment_data_import_option` | Yes | `append` | Segment load behavior. Use `append` to add members while keeping existing Segment members. Use `replace` to clear the Segment before loading new members. |
| `key_fields` | Yes | None | Comma-separated field names that identify unique records, for example `CUSTOMER_IDENTIFIER` or `CUSTOMER_IDENTIFIER,EMAIL`. |
| `deduplication` | No | `ImportLastMatch` | Deduplication behavior for duplicate keys in a load. Valid values are `ImportLastMatch` and `ImportFirstMatch`. |
| `error_handling` | No | `ContinueOnError` | Error handling behavior for the Selligent load API. Valid values are `ContinueOnError` and `StopOnError`. |
| `mode` | No | `Sync` | Data transfer mode for the Selligent load API. Valid values are `Sync` and `Stream`. |
| `skip_invalid_records` | No | `true` | Skips 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_column` | Segment routing only | Determines the target Segment `api_name` for each row. The integration does not send this column as a field. |
| Any other query result column |  | Sent 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 |
|  --- | --- |
| `string` | `Text` (length 500) |
| `long` | `Long` |
| `double` | `Float` |
| `boolean` | `Boolean` |
| `timestamp` | `DateTime` |


### Import Modes

| Parameter  | Value  | Behavior |
|  --- | --- | --- |
| `list_data_import_option` | `InsertAndUpdate` | Inserts new records into the List and updates existing records with matching key fields. |
| `list_data_import_option` | `OnlyInsert` | Inserts new List records only. |
| `list_data_import_option` | `OnlyUpdate` | Updates existing List records only. |
| `segment_data_import_option` | `append` | Adds records to the target Segment. Existing Segment members remain in the Segment. |
| `segment_data_import_option` | `replace` | Clears 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`.


```sql
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_customers | C001 | alice@example.com | Alice | Kim |
| active_customers | C002 | bob@example.com | Bob | Sato |
| active_customers | C003 | carol@example.com | Carol | Nguyen |


**Required configuration**

| Parameter  | Value |
|  --- | --- |
| `organization` | `my_org` |
| `list_api_name` | `master_contacts` |
| `segment_column` | `selligent_segment` |
| `key_fields` | `CUSTOMER_IDENTIFIER` |
| `segment_data_import_option` | `append` |
| `list_data_import_option` | `InsertAndUpdate` |
| `create_segment_if_not_exists` | `true` |


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`.


```sql
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_customers | C101 | mei@example.com | Mei | 1520.50 | 2026-05-01 10:15:00 |
| re_engagement | C204 | dan@example.com | Dan | 210.00 | 2025-09-20 08:30:00 |
| standard_customers | C319 | lina@example.com | Lina | 480.75 | 2026-04-12 19:45:00 |


**Required configuration**

| Parameter  | Value |
|  --- | --- |
| `organization` | `my_org` |
| `list_api_name` | `master_contacts` |
| `segment_column` | `selligent_segment` |
| `key_fields` | `CUSTOMER_IDENTIFIER` |
| `segment_data_import_option` | `append` |
| `list_data_import_option` | `InsertAndUpdate` |
| `create_segment_if_not_exists` | `true` |
| `deduplication` | `ImportLastMatch` |
| `error_handling` | `ContinueOnError` |


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.
![](/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png)
4. In the drop-down, select one of the following schedule options:
![](/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png)
| Drop-down Value | Description |
|  --- | --- |
| Custom cron... | Review [Custom cron... details](#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. |
| None | No schedule. |


#### Custom cron... Details

![](/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png)

| **Cron Value** | **Description** |
|  --- | --- |
| `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:

div
| 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.


![](/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png)

- 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 Columns**to 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**.


![](/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png)

- 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](/products/customer-data-platform/journey-orchestration/batch/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](/tools/cli-and-sdks/api#workflow-commands).

**Sample Workflow Configuration**


```yaml
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

- [Selligent SMC V1 API documentation](https://developers.meetmarigold.com/engage/api/smc-v1/)