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

# Batch

> Build smarter CRM campaigns on Batch with real-time customer data from your Data Warehouse

## Overview

This integration lets you send server-to-server events, attributes, and custom audiences to Batch without writing a custom pipeline.

## Supported syncing

| Type | Description | Supported Sync Modes |
| - | - | - |
| **Attributes** | Sync data from any source to your Batch users | Upsert |
| **Events** | Sync records as events to Batch | Insert |
| **Custom Audience** | Sync users to a custom audience in Batch | Add, Remove |

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Connect to Batch

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination** button. Select **Batch** and click **Continue**. You can then authenticate Hightouch to **Batch**.

To get your API and project keys, navigate to `Settings` and copy your REST API key and Project key into Hightouch.

If you plan on using custom audience syncing, you also need to provide your **SDK Key**. You can find this in your Batch settings page.

## Sync configuration

Once you've set up your **Batch** destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and the Batch destination you want to sync to.

### Events

Any records added to [your source](https://docs.hightouch.com/getting-started/concepts.md) are treated as new events and are sent to Batch when your sync runs.

> [!WARNING]
>
> To ensure syncs send each event, your event model must use a truly unique [primary key](https://docs.hightouch.com/getting-started/concepts.md#unique-primary-key-requirement). See the [events syncs](https://docs.hightouch.com/syncs/types-and-modes.md#event-syncs) documentation for more information.

`Event name` and`Custom ID` fields are the minimum required fields to make the API call to Batch. For richer analytics, we recommend that you provide all relevant fields in your use case.

The `Custom ID` field is used to deduplicate events sent to Batch.

If you don't map the `timestamp` field, it will default to the time Hightouch processes the event.

### Attributes

In this mode each record in [your source](https://docs.hightouch.com/getting-started/concepts.md) is treated as a user and sent to Batch when your sync runs.

#### Record matching

You can match rows from your model to users in Batch on any column in your model and any field in Batch. Ensure the data types of the model column and Batch field you select match.

Refer to the [record matching docs](https://docs.hightouch.com/syncs/record-matching.md) for more information.

#### Field mapping

Hightouch lets you sync user fields via [field mapping](https://docs.hightouch.com/syncs/mapping-data.md).

You can map data from any of your model columns to any user attribute. For a reference of natively supported user fields see [Batch's docs](https://doc.batch.com/api/profile/update/#native-attributes).

If you send data for a custom field, Hightouch adds the field and automatically detects its type.

### Custom Audiences

In this mode, you can add or remove users from a custom audience in Batch.

#### Record matching

You can match rows from your model to users in Batch on any column in your model and any field in Batch. Ensure the data types of the model column and Batch field you select match.

Refer to the [record matching docs](https://docs.hightouch.com/syncs/record-matching.md) for more information.

#### Audience Selection

You must select the custom audience you want to sync users to. You can select an existing audience from the dropdown or create a new one.

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