> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delighted

> Create or update your customers' information while sending surveys with rich segmentation data directly from your warehouse.

## Overview

The Delighted integration allows you to sync customer data and send surveys from your warehouse based on models that you define.

### Why sending surveys should be based on the warehouse

* You can do more complex segmentation by leveraging all the data in your warehouse, including event data and third-party data. Your warehouse is the only place where all of this data coexists.
* You can keep your Delighted segments in sync with the rest of your business tools. For example, you might want to send a survey to users who've been invited to a beta program. You also might want to sync these attributes to a CRM like Salesforce or HubSpot. Hightouch integrates with 250+ SaaS tools used for email marketing, customer support, sales, and more. Define your audience once and activate your data everywhere.
* Segments can be defined using the tools that your teams are most comfortable with. You can filter and transform data from your warehouse using SQL or our [visual query builder](https://docs.hightouch.com/customer-studio/usage.md)—whichever you prefer. (You can even sync customers to or send surveys through Delighted segments based on work you've already done in dbt or Looker!)

## Connect to Delighted

**Retrieve your API Token from Delighted.**

1. Log in to Delighted.
2. Visit [Delighted's API Introduction Page](https://app.delighted.com/docs/api).
3. Copy your **API key**.

![The API key on the Delighted dashboard](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-delighted-api-key.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=27572f0da871a70c2677d25e8f4e2285)

#### Add Delighted as a destination in Hightouch

1. Log in to Hightouch or create a free Hightouch account
2. Click on **Destinations** in the left sidebar
3. Click on **Add destination** in the top right corner
4. Select **Delighted** in the destination catalog and click **Continue** to proceed
5. Paste your **API key** into the **API key** field and click **Continue** to proceed
6. Give your destination a name and unique slug (for example, Delighted Production” and `Delighted-production`)
7. Click **Finish** to create your Delighted destination

### Connect to your data source

Hightouch sits on top of your data warehouse and can read from Snowflake, Redshift, BigQuery, Databricks, Postgres, MySQL, and many other data sources. You can even fetch data from Google Sheets and Airtable. Hightouch can help activate your data wherever it resides.

We've written dedicated guides for each supported data source. Take your pick:

* Connect to [Airtable](https://docs.hightouch.com/sources/airtable)
* Connect to [Amazon Athena](https://docs.hightouch.com/sources/amazon-athena.md)
* Connect to [Amazon Redshift](https://docs.hightouch.com/sources/amazon-redshift.md)
* Connect to [ClickHouse](https://docs.hightouch.com/sources/clickhouse.md)
* Connect to [Databricks](https://docs.hightouch.com/sources/databricks.md)
* Connect to [Elasticsearch](https://docs.hightouch.com/sources/elasticsearch)
* Connect to [Firebolt](https://docs.hightouch.com/sources/firebolt)
* Connect to [Google BigQuery](https://docs.hightouch.com/sources/google-bigquery.md)
* Connect to [Google Sheets](https://docs.hightouch.com/sources/google-sheets.md)
* Connect to [Looker](https://docs.hightouch.com/sources/looker)
* Connect to [Metabase](https://docs.hightouch.com/sources/metabase)
* Connect to [MySQL](https://docs.hightouch.com/sources/mysql.md)
* Connect to [PostgreSQL](https://docs.hightouch.com/sources/postgresql.md)
* Connect to [Rockset](https://docs.hightouch.com/sources/rockset)
* Connect to [SFTP](https://docs.hightouch.com/sources/sftp.md)
* Connect to [Snowflake](https://docs.hightouch.com/sources/snowflake.md)
* Connect to [SQL Server](https://docs.hightouch.com/sources/sqlserver.md)
* Connect to [Trino](https://docs.hightouch.com/sources/trino.md)

> [!NOTE]
>
> If you're missing the credentials necessary to connect to your data source,
> try inviting your teammates to Hightouch. You can have unlimited collaborators
> in your workspace.

#### Connect to a sample database instead

Waiting for credentials to your data warehouse? No problem. You can connect to one of our [sample datasets](https://docs.hightouch.com/sources/sample-data.md) to get started right away. For the rest of this tutorial, we'll use the **B2B SaaS** sample source, which contains a `users` table with names, emails, locations, and other user attributes. This sample source is available when you log in for the first time—no setup required.

Next, we'll write a SQL query to define which users should be synced to our Delighted customers resource. You can follow the same pattern to sync to other support Delighted resources,

### Create a model

In Hightouch, a model represents a query that filters or transforms the records in your data source. Models are used to determine exactly which records to sync between sources and destinations.

When you connect to a data warehouse, your models will probably be written in SQL. You can also import models from tools like dbt and Looker.

In this example, we'll keep it simple. Suppose you want to sync all your customers to Delighted. To accomplish this, you'll want to create a model that looks like this:

```sql theme={null}
SELECT * FROM users;
```

1. Click on **Models** in the left sidebar.
2. Click on **Add model** in the top right corner.
3. Select **Demo Database** as your source and click **Continue** to proceed.
4. Select **SQL Editor** as your modeling method.
5. Paste the SQL query from above into the editor on the left side of the page.
6. Click **Preview** to execute the query.
7. Click **Continue** to proceed.
8. Give your model a name and unique slug (for example, "All Users" and `all-users`).
9. Select **ID** as the primary key for your model.
10. Click **Finish** to create your model.

We just created a model using a SQL query that retrieves all our current users. Next, we'll configure our sync to add these users to Delighted.

### Create a sync

1. Click on **Syncs** in the left sidebar.
2. Click on **Add sync** in the top right corner.
3. Select **All Users** as your model and click **Continue** to proceed.
4. Select **Delighted** as your destination and click **Continue** to proceed.
5. Give your destination a name and unique slug (for example, "Delighted All Customers Sync" and `Delighted-all-customers-sync`) and click **Finish** to proceed.
6. Select **People** from the object dropdown.
7. Select **Upsert** from the mode radio options.
8. Select `email` and we will map it to `Email` from the external ID mapping field.
9. Select `first_name` and we will map it to `Name` in the fields that we'd like to sync to Delighted.
10. Select **Yes** in the Sending Survey section.
11. Select **Do Nothing** in the Delete section.
12. Click **Continue** to proceed to the last step.
13. Select **Interval** to tell your sync to run on a set interval.
14. Configure your sync schedule to run every **5 minutes**.
15. Click **Finish** to create your sync.

And We're done. Your Delighted sync configuration is complete.

## Sync configuration

### Object selection

Hightouch supports syncing to the following Delighted resources:

* **People**

### Sync modes

This integration supports **Upsert**.

In **Upsert** mode, records that aren't found in Delighted given the provided identifier will be inserted. And existing records will be updated.

### Record matching

Records can be matched from your source to your Delighted workspace by `Email`.

### Field mapping

Hightouch allows you to sync columns from your source to the supported Delighted resources:

| Mapping | Type | Description |
| :- | :-: | -: |
| `Phone Number` | String | Phone number of customer. Format must be E.164 (for example, +17132746524). |
| `Survey Channel` | String | Defaults to `email`. Specify `sms` and provide a `Phone Number` to have the survey request sent via SMS. |
| `Name` | String | Name of person. |
| `Delay To Send Email` | Number | Delay in `seconds` before sending the survey. |
| `Update Email To` | String | Field to update the person's email. |
| `Update Phone Number To` | String | Field to update the person's phone number. |

### Custom field mapping

Hightouch allows you to set custom attributes. Any mappings from this section will be synced to the custom properties of each associated survey sent. You can add as many properties as you need.

Properties are a powerful way to analyze survey results on Delighted. To learn more about it, visit [Properties Overview](https://help.delighted.com/article/575-properties-overview).

### Sending surveys

When configuring your Delighted sync form, there are a couple of choices provided to you when it comes to sending surveys. You can either:

* **Not** send surveys to all synced records.
* **Send surveys** to all synced records. Records that are created will be sent a survey. Records that are updated and are out of Delighted's survey throttling interval will be sent a survey.
* **Send surveys** based on each record **dynamically** by providing a `Boolean` column. To use this feature, toggle **Use Column**, and select that respective column from the dropdown.

### Delete records

When the Hightouch sync engine recognizes that a record has been removed from your source, you can either:

* Do Nothing.
* Delete the record from Delighted.

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).
