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

# Hightouch

> Learn how to sync data from Hightouch

## What is Hightouch?

[Hightouch](https://hightouch.com) is a platform that enables businesses to sync data between different systems, databases, or applications, often associated with data integration and synchronization. It facilitates the movement of data between various sources and destinations, allowing companies to streamline their operations, automate processes, and ensure that different tools or databases remain up-to-date with the most recent information.

All this data can be easily sent to Hyperline to collect your customer's usage and automate usage-based billing and invoicing.

## Send usage from Hightouch to Hyperline

### Configure a data source

The first thing you need to create in Hightouch is a `source`.

<Steps>
  <Step title="Go to the Sources page" />

  <Step title="Click on Add source" />

  <Step title="Select and configure the data source">
    The source can be of any type (spreadsheet, database, warehouse, etc).

    <Frame>
      <img src="https://mintcdn.com/hyperline/Jlf5SXv68qnahU--/images/integrations/hightouch/hightouch1.png?fit=max&auto=format&n=Jlf5SXv68qnahU--&q=85&s=3da0cc747d34af90a23eaeb27cea73c2" width="2976" height="1656" data-path="images/integrations/hightouch/hightouch1.png" />
    </Frame>
  </Step>
</Steps>

### Create a HTTP Request destination

Hyperline uses HTTP requests to ingest usage. Setting up this `destination` in Hightouch takes only a few clicks:

<Steps>
  <Step title="Go to the Destinations page" />

  <Step title="Click on Add destination and select HTTP Request">
    <Frame>
      <img src="https://mintcdn.com/hyperline/Jlf5SXv68qnahU--/images/integrations/hightouch/hightouch2.png?fit=max&auto=format&n=Jlf5SXv68qnahU--&q=85&s=75fe36ecf106a9ee22323303afbe7715" width="2978" height="1654" data-path="images/integrations/hightouch/hightouch2.png" />
    </Frame>
  </Step>

  <Step title="Select and configure the request">
    You need to add two headers:

    * `Authorization` with `Bearer <your API key>` as a **secret** value
    * `Content-Type` with `application/json` as value

    <Frame>
      <img src="https://mintcdn.com/hyperline/Jlf5SXv68qnahU--/images/integrations/hightouch/hightouch3.png?fit=max&auto=format&n=Jlf5SXv68qnahU--&q=85&s=62e47ceb0de8410a3814436ee83b7572" width="2976" height="1656" data-path="images/integrations/hightouch/hightouch3.png" />
    </Frame>
  </Step>
</Steps>

### Create a model

After saving the destination, you need to create a `model` representing the entity you want to sync (represented as `event` in Hyperline).

<Steps>
  <Step title="Go to the Models page" />

  <Step title="Click on Add model" />

  <Step title="Select a source and configure a model">
    Put a name and select a primary key from the source fields.

    <Frame>
      <img src="https://mintcdn.com/hyperline/Jlf5SXv68qnahU--/images/integrations/hightouch/hightouch4.png?fit=max&auto=format&n=Jlf5SXv68qnahU--&q=85&s=ad4a790dd3e48b25ac12c7d6f8cb1af2" width="2974" height="1654" data-path="images/integrations/hightouch/hightouch4.png" />
    </Frame>

    After finishing the model, you can also configure more settings on it like columns types, descriptions, etc.

    <Frame>
      <img src="https://mintcdn.com/hyperline/Jlf5SXv68qnahU--/images/integrations/hightouch/hightouch5.png?fit=max&auto=format&n=Jlf5SXv68qnahU--&q=85&s=0c8f8a00ad3d4c53291329e61d47a6fc" width="2974" height="1652" data-path="images/integrations/hightouch/hightouch5.png" />
    </Frame>
  </Step>
</Steps>

### Create a sync

The last step you need to configure is a `sync`. Syncs declare how you want query results from a model to appear in your destination (Hyperline).

<Steps>
  <Step title="Go to the Syncs page" />

  <Step title="Click on Add sync" />

  <Step title="Select your model and the HTTP Request destination">
    Put a name and select a primary key from the source fields.

    Select **Row added** and **Row updated** triggers, **POST** HTTP request method, don't change the URL, **JSON** as type of payload with **Use JSON editor**.

    Here is an example of JSON payload that can be sent to the Hyperline ingest API.

    ```json theme={null}
    {
      "customer_id": "{{ row.customerId }}",
      "event_type": "{{ row.eventType }}",
      "timestamp": "{{ row.timestamp }}",
      "record": {
        "id": "{{ row.eventId }}",
        "my_property": "{{ row.customProperty }}", // add any custom properties you want to ingest in Hyperline
      },
    }
    ```

    <Note>
      Hightouch supports Liquid template language to insert variables from your source to your JSON payload. These variables are created following this syntax: `{{ row.variable }}`, `variable` being the column name of your source.
    </Note>
  </Step>
</Steps>

Verify your synchronization by using a data sample. A new event should appear on your events [explore](https://app.hyperline.co/app/events/explore) page within Hyperline.

When you're ready, activate this sync and specify a periodic trigger.
