# Talon.One (Actions) Destination

## Destination Info

* Accepts [Page](/docs/segment/connections/spec/page), [Alias](/docs/segment/connections/spec/alias), [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **Talon.One (Actions)** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)
* This integration is **partner owned.** Please reach out to the partner's support for any issues.

Create flexible and targeted promotional and loyalty campaigns with [Talon.One](https://www.talon.one/).
Campaigns can be created and managed by non-technical users like marketers. There is no need to
get your development team involved. Features include coupons, discounts, loyalty
programs, referral tracking, geofencing, and bundling.

This destination is maintained by Talon.One. For any issues with the destination, [contact the Talon.One Support team](mailto:support@talon.one) or refer to [Talon.One's documentation](https://docs.talon.one/docs/dev/technology-partners/segment).

> \[!TIP]
>
> **Good to know**: This page is about the [Actions-framework](/docs/segment/connections/destinations/actions/) Talon.One Segment destination. There's also a page about the [non-Actions Talon.One destination](/docs/segment/connections/destinations/catalog/talonone/). Both of these destinations receive data from Segment.

## Benefits of Talon.One (Actions) vs Talon.One Classic

Talon.One (Actions) allows you to share more data than the classic destination.
The classic version only shares customer profile data. The Action version supports sharing the following data:

* Customer profile data
* Audience data
* Tracking events

## Getting started

### Creating an API key in Talon.One

Segment needs a Talon.One-generated API key to be able to send data to your Talon.One Application. To generate an API key specific to Segment:

1. Open your Talon.One Application in the Campaign Manager and click **Settings > Developer settings**.
2. Click **Create API Key**.
3. For **Do you want to use this API Key with a 3rd party service**, select **Yes**.
4. Select **Segment** from the dropdown.
5. Select an expiry date and click **Create API Key**.
6. Copy it for later use.

> \[!NOTE]
>
> Talon.One limits integrations with Segment to 60 requests per second for any given client, regardless of the endpoint. To increase this limit, contact Talon.One.

### Adding a Talon.One destination

To start sending data to Talon.One from Segment, create a Talon.One
[destination](/docs/segment/connections/destinations/) in Segment.

1. In Segment, click **Destinations** > **Add Destination**. The **Destination catalog** opens.
2. Search for **Talon.one** and configure the destination.
3. Enter the details:
   * In **Name**, type a name, for example `Talon.One destination`.
   * In **API key**, paste the API key generated in the previous section.
   * In **Deployment**, type the URI of your Talon.One deployment, for example
     `https://mycompany.europe-west1.talon.one/`.
4. (Optional) Set up your filters.
5. Configure the mapping:
   1. Click **New Mapping** and select the type of action to perform in Talon.One.
      For example *When a new audience is created in Segment, also create it in Talon.One.*
   2. Configure the trigger and action fields.
6. Click **Event Tester** and test if you received the data in Talon.One.

Once you receive data, you can start creating rules that rely on that data.

> \[!WARNING]
>
> **Important**: You might need to create custom attributes in Talon.One to be able to map the data from Segment in Talon.One. See the [Talon.One docs](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-custom-attributes).

### Testing the integration

You can use the following payloads to test and fine-tune your requests.

```json
{
  "messageId": "segment-test-message-t1kx8e",
  "timestamp": "2022-03-22T12:41:20.918Z",
  "type": "track", // or any other type in Segment
  "userId": "test-user-z65zqk",
  "event": "track-event", // or any other event in Segment
  "email": "test@example.org",
  "projectId": "qR6APLKpCBB3ue8pHkBLpo",
  "properties": {
    "eventType": "mySegmentEvent",
    "type": "boolean",
    "customerProfileId": "a_customer_id",
    "attributes": {
      "language": "English" // depends your custom attributes in Talon.One
    }
  }
}
```

### Next steps

Once you receive data from Segment inside Talon.One, start creating your rules in the Campaign Manager. See the [Talon.One documentation](https://docs.talon.one/docs/product/rules/overview).

## Destination Settings

| Field      | Description                                                         | Required | Type     |
| ---------- | ------------------------------------------------------------------- | -------- | -------- |
| API Key    | Created under Developer Settings in the Talon.One Campaign Manager. | Yes      | password |
| Deployment | The base URL of your Talon.One deployment.                          | Yes      | string   |

## Available Actions

Build your own Mappings. Combine supported [triggers](/docs/segment/connections/destinations/actions/#components-of-a-destination-action) with the following Talon.One-supported actions:

> \[!NOTE]
>
> Individual destination instances have support a maximum of 50 mappings.

* [Create Audience](#create-audience)
* [\[Deprecated\] Track event](#deprecated-track-event)
* [\[Deprecated\] Upsert customer profile](#deprecated-upsert-customer-profile)
* [Delete Audience](#delete-audience)
* [Update Multiple Customer Profiles’ Attributes](#update-multiple-customer-profiles-attributes)
* [Update Audience Name](#update-audience-name)
* [Update Multiple Customer Profiles’ Audiences](#update-multiple-customer-profiles-audiences)
* [\[Deprecated\] Update customer session](#deprecated-update-customer-session)
* [\[Deprecated\] Upsert customer profile V2](#deprecated-upsert-customer-profile-v2)
* [Track event](#track-event-9)
* [Update customer profile](#update-customer-profile)
* [Update customer session](#update-customer-session)

### Create Audience

This creates a new audience entity in Talon.One.

Create Audience is a **Cloud** action.

| Field               | Description                                     | Required | Type   |
| ------------------- | ----------------------------------------------- | -------- | ------ |
| Segment Audience ID | You should get this audience ID from Segment.   | Yes      | STRING |
| Audience Name       | You should get this audience name from Segment. | Yes      | STRING |

### \[Deprecated] Track event

This records a custom event in Talon.One. **Important:** This Action is deprecated. Use the **Track event** Action instead.

\[Deprecated] Track event is a **Cloud** action.

| Field                 | Description                                                                                                                               | Required | Type   |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Customer Profile ID   | The customer profile integration ID to use in Talon.One. It is the identifier of the customer profile associated to the event.            | Yes      | STRING |
| Event Type            | The name of the event sent to Talon.One.                                                                                                  | Yes      | STRING |
| Type                  | Type of event. Can be only \`string\`, \`time\`, \`number\`, \`boolean\`, \`location\`                                                    | Yes      | STRING |
| Attribute-Value pairs | Extra attributes associated with the event. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes). | No       | OBJECT |
| Attributes info       | Use this field if you want to identify an attribute with a specific type                                                                  | No       | OBJECT |

### \[Deprecated] Upsert customer profile

This updates attributes and audiences for a single customer profile. **Important:** This Action is deprecated. Use the **Update customer profile** Action instead.

\[Deprecated] Upsert customer profile is a **Cloud** action.

| Field                                                        | Description                                                                                                                                                                                                                              | Required | Type    |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Attribute-Value pairs                                        | Extra attributes associated with the customer profile. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes).                                                                                     | No       | OBJECT  |
| Customer Profile ID                                          | The customer profile integration identifier to use in Talon.One.                                                                                                                                                                         | Yes      | STRING  |
| List of audience ID to dissociate with the customer profile. | You should get these audience IDs from Talon.One.                                                                                                                                                                                        | No       | INTEGER |
| List of audience ID to associate with the customer profile.  | You should get these audience IDs from Talon.One.                                                                                                                                                                                        | No       | INTEGER |
| Run rule engine                                              | This runs rule engine in Talon.One upon updating customer profile. Set to true to trigger rules. Setting this property to false improves response times. For audiences changes the runRuleEngine should be true. Default value is false. | No       | BOOLEAN |
| Attributes with types                                        | Use this field if you want to identify an attribute with a specific type                                                                                                                                                                 | No       | OBJECT  |

### Delete Audience

This deletes the audience entity in Talon.One.

Delete Audience is a **Cloud** action.

| Field               | Description                                   | Required | Type   |
| ------------------- | --------------------------------------------- | -------- | ------ |
| Segment Audience ID | You should get this audience ID from Segment. | Yes      | STRING |

### Update Multiple Customer Profiles’ Attributes

This updates attributes for multiple customer profiles.

Update Multiple Customer Profiles’ Attributes is a **Cloud** action.

| Field                                           | Description                                                                                                                                  | Required | Type   |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Data item to change customer profile attributes | An array of JSON objects that contains customer profile identifier and list of attributes and their values. Customer profile ID is required. | Yes      | OBJECT |
| Mutual Attribute-Value pairs                    | This may contain mutual list of attributes and their values for every customer profile in the "data" array.                                  | No       | OBJECT |
| Attributes with types                           | Use this field if you want to identify an attribute with a specific type                                                                     | No       | OBJECT |

### Update Audience Name

This updates the audience name if there is an existing audience entity.

Update Audience Name is a **Cloud** action.

| Field               | Description                                     | Required | Type   |
| ------------------- | ----------------------------------------------- | -------- | ------ |
| Segment Audience ID | You should get this audience ID from Segment.   | Yes      | STRING |
| Audience Name       | You should get this audience name from Segment. | Yes      | STRING |

### Update Multiple Customer Profiles’ Audiences

This updates audiences for multiple customer profiles.

Update Multiple Customer Profiles’ Audiences is a **Cloud** action.

| Field                                          | Description                                                                                                                                                                                                              | Required | Type   |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------ |
| Data item to change customer profile audiences | An array of JSON objects that contains customer profile identifier and list of audiences to associate and dissociate with the indicated customer profile. Customer profile ID and at least one audience ID are required. | Yes      | OBJECT |

### \[Deprecated] Update customer session

This updates a customer session. **Important:** This Action is deprecated. Use the **Update customer session** Action instead.

\[Deprecated] Update customer session is a **Cloud** action.

| Field                      | Description                                                                                                                                                                                               | Required | Type   |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Customer Session ID        | The customer session integration identifier to use in Talon.One.                                                                                                                                          | Yes      | STRING |
| Callback Destination URI   | This specifies the address of the service and its endpoint to do callback request.                                                                                                                        | No       | STRING |
| Callback API Key           | This specifies API key and relative header. The header is specified optionally                                                                                                                            | No       | STRING |
| Content Fields             | This specifies a list of the fields from the response you need to receive. Comma character is separator. If omitted, all the fields will be forwarded from the response to the callback destination.      | No       | STRING |
| Correlation ID             | This specifies ID of the request that will be forwarded to the destination URI with the callback request with the same header name. If omitted, the X-Correlation-ID will not be in the callback request. | No       | STRING |
| Customer Session Data      | This contains all the data related to customer session.                                                                                                                                                   | Yes      | OBJECT |
| Session Attributes info    | Use this field if you want to identify a session attribute with a specific type                                                                                                                           | No       | OBJECT |
| Cart Items Attributes info | Use this field if you want to identify a cart item attribute with a specific type                                                                                                                         | No       | OBJECT |

### \[Deprecated] Upsert customer profile V2

You do not have to create attributes or audiences before using this Action. **Important:** This Action is deprecated. Use the **Update customer profile** Action instead.

\[Deprecated] Upsert customer profile V2 is a **Cloud** action.

| Field                                    | Description                                                                                                                                          | Required | Type    |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Customer Profile ID                      | The customer profile integration identifier to use in Talon.One.                                                                                     | Yes      | STRING  |
| The audiences for the customer to join.  | Audience name and integration ID                                                                                                                     | No       | OBJECT  |
| The audiences for the customer to leave. | Audience name and integration ID                                                                                                                     | No       | OBJECT  |
| Run rule engine                          | This runs rule engine in Talon.One upon updating customer profile. Set to true to trigger rules.                                                     | No       | BOOLEAN |
| Attribute-Value pairs                    | Extra attributes associated with the customer profile. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes). | No       | OBJECT  |
| Attributes info                          | Use this field if you want to identify an attribute with a specific type                                                                             | No       | OBJECT  |

### Track event

This records a custom event in Talon.One. Create the event and all the required attributes before using this Action.

Track event is a **Cloud** action.

| Field                             | Description                                                                                                                                                                                                    | Required | Type    |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Skip Non-existing Attributes Flag | Indicates whether to skip non-existing attributes. If \`Yes\`, the non-existing attributes are skipped and a 400 error is not returned. If \`No\`, a 400 error is returned in case of non-existing attributes. | No       | BOOLEAN |
| Customer Profile ID               | The customer profile integration ID to use in Talon.One. It is the identifier of the customer profile associated to the event.                                                                                 | Yes      | STRING  |
| Event Type                        | The name of the event sent to Talon.One.                                                                                                                                                                       | Yes      | STRING  |
| Attribute-Value pairs             | Extra attributes associated with the event. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes).                                                                      | No       | OBJECT  |

### Update customer profile

This updates attributes and audiences for a single customer profile. Create all the required attributes and audiences before using this Action.

Update customer profile is a **Cloud** action.

| Field                                                        | Description                                                                                                                                                                                                    | Required | Type    |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Customer Profile ID                                          | The customer profile integration identifier to use in Talon.One.                                                                                                                                               | Yes      | STRING  |
| Skip Non-existing Attributes Flag                            | Indicates whether to skip non-existing attributes. If \`Yes\`, the non-existing attributes are skipped and a 400 error is not returned. If \`No\`, a 400 error is returned in case of non-existing attributes. | No       | BOOLEAN |
| List of audience ID to dissociate with the customer profile. | You should get these audience IDs from Talon.One.                                                                                                                                                              | No       | INTEGER |
| List of audience ID to associate with the customer profile.  | You should get these audience IDs from Talon.One.                                                                                                                                                              | No       | INTEGER |
| Run rule engine                                              | This runs rule engine in Talon.One upon updating customer profile. Set to true to trigger rules.                                                                                                               | No       | BOOLEAN |
| Attribute-Value pairs                                        | Extra attributes associated with the customer profile. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes).                                                           | No       | OBJECT  |

### Update customer session

This updates a customer session. Create all the required attributes before using this Action.

Update customer session is a **Cloud** action.

| Field                             | Description                                                                                                                                                                                                                                                                                                 | Required | Type    |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Customer Session ID               | The customer session integration identifier to use in Talon.One.                                                                                                                                                                                                                                            | Yes      | STRING  |
| Callback Destination URI          | This specifies the address of the service and its endpoint to do callback request.                                                                                                                                                                                                                          | No       | STRING  |
| Callback API Key                  | This specifies API key and relative header. The header is specified optionally                                                                                                                                                                                                                              | No       | STRING  |
| Content Fields                    | This specifies a list of the fields from the response you need to receive. Comma character is separator. If omitted, all the fields will be forwarded from the response to the callback destination.                                                                                                        | No       | STRING  |
| Correlation ID                    | This specifies ID of the request that will be forwarded to the destination URI with the callback request with the same header name. If omitted, the X-Correlation-ID will not be in the callback request.                                                                                                   | No       | STRING  |
| Skip Non-existing Attributes Flag | Indicates whether to skip non-existing attributes. If \`Yes\`, the non-existing attributes are skipped and a 400 error is not returned. If \`No\`, a 400 error is returned in case of non-existing attributes.                                                                                              | No       | BOOLEAN |
| Customer Profile ID               | The customer profile integration identifier to use in Talon.One.                                                                                                                                                                                                                                            | No       | STRING  |
| Coupon Codes                      | Any coupon codes entered. Up to 100 coupons.\`                                                                                                                                                                                                                                                              | No       | STRING  |
| Referral Codes                    | Any referral code entered.\`                                                                                                                                                                                                                                                                                | No       | STRING  |
| Loyalty Cards                     | Any loyalty cards used. Up to 1 loyalty cards.\`                                                                                                                                                                                                                                                            | No       | STRING  |
| State                             | Indicates the current state of the session. \`                                                                                                                                                                                                                                                              | No       | STRING  |
| Card Items                        | The items to add to this sessions.&#xA;&#xA;If cart item flattening is disabled: Do not exceed 1000 items (regardless of their quantity) per request.&#xA;If cart item flattening is enabled: Do not exceed 1000 items and ensure the sum of all cart item's quantity does not exceed 10.000 per request.\` | No       | OBJECT  |
| Additional Costs                  | Use this property to set a value for the additional costs of this session, such as a shipping cost.\`                                                                                                                                                                                                       | No       | OBJECT  |
| Identifiers                       | Session custom identifier that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts.                                                              | No       | STRING  |
| Attribute-Value pairs             | Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. \[See more info]\(https://docs.talon.one/docs/product/account/dev-tools/managing-attributes).                                                   | No       | OBJECT  |

## Migration from the classic Talon.One destination

To prevent duplicate events being created in Talon.One, ensure that for each Segment source, this destination and the classic Talon.One destination are not both enabled at the same time.
