# Sync from your warehouse

> How Hightouch, Census or your own job sends warehouse data to Herald through the server API, what the SDK adds from the device, and how to avoid collecting the same data twice.

Herald has no direct warehouse integration. A warehouse tool such as Hightouch or Census, or a job you write, calls the server API: [`POST /api/v1/users`](/docs/reference/server-api#post-api-v1-users) for users and attributes, and [`POST /api/v1/events`](/docs/reference/server-api#post-api-v1-events) for events. Both use the connection's ingest token. To bring results back, the same job reads [`GET /api/v1/decisions`](/docs/reference/server-api#get-api-v1-decisions) and [`GET /api/v1/holdout`](/docs/reference/server-api#get-api-v1-holdout). The SDK adds what only the device knows and handles delivery to the app. This page sets out which source owns which data, so your teams do not collect anything twice.

## Who owns what

| Data | Owner | Notes |
|---|---|---|
| User records and profile attributes from your systems | Warehouse, through `/api/v1/users` | Plan, lifecycle stage, account data and anything else your warehouse holds |
| Conversion events that agent goals measure | Either: warehouse through `/api/v1/events`, or SDK `track` and `trackPurchase` | Pick one source per event name |
| Segments | Built in the console | From user attributes and from events, such as "did this event in the last 30 days". They are not synced from the warehouse. |
| User time zone | Warehouse, when it has one | The SDK fills it from the device only when the profile has none |
| Device data (app version, OS, model, locale, network, push permission) | SDK | Sent with every batch |
| Push tokens and push subscription | SDK | Registered on launch and after sign-in |
| Sessions | SDK | |
| In-app events that trigger messages | SDK `track` | Evaluated on the device, so they must come from the app |
| Message interactions (impressions, clicks, dismissals, push opens) | SDK | Credited to the decision that sent the message |
| Email and phone contacts | Either: `/api/v1/users` (email) or the contacts API from your backend, or `setEmail` and `setPhone` in the app | Pick one per field |

The server API does not take push tokens, device records or message interactions. Those come from the SDK.

## What changes from the Braze setup

With Braze, Hightouch synced users, attributes, events and subscription states to Braze, and the Braze SDK handled the device. With Herald:

- **User syncs** call `/api/v1/users` instead of Braze. Each user becomes a member of the app that owns the ingest token, so that app's agents can reach them.
- **Event syncs** call `/api/v1/events` and feed agent goals. Keep sending the conversions you measure from the warehouse, or move a conversion to the SDK if the app is where it happens.
- **Segment syncs** are no longer needed. Build segments in the console from attributes and events.
- **Subscription status syncs** have no Herald destination. See [Importing push tokens and users](/docs/migration/importing-tokens-and-users#4-carry-over-opt-outs).
- **Campaign and Canvas trigger syncs** have no equivalent: agents choose users from their segments. See [Braze concept map](/docs/migration/braze-concept-map).

## Do not collect twice

**Attributes.** Server calls and SDK attribute calls write into the same profile. For each key, the most recent write wins. If both sources send the same key, the profile flips between their values. Give each key one owner: warehouse facts from the server API, in-app preferences from the SDK. If an attribute exists in the warehouse, do not also set it from the app.

**Events.** Agent goals count conversions from both server events and SDK `track` and `trackPurchase` calls. If both send the same conversion, it can be counted twice, against two different messages. Give each goal event one source: warehouse outcomes from the server API, in-app actions from the SDK. Server events are idempotent by `id`, so a replayed batch never counts twice. See [Events and agent goals](/docs/concepts/events-and-attributes#events-and-agent-goals).

**External IDs.** Use one ID in both places: the `userId` in your server calls and the `userId` in `identify`. A mismatch creates two users who never meet.

**Time zone.** If your warehouse has a reliable time zone, send it as an attribute. The device's time zone fills the gap only for users without one.

## Example

For Lumen, the workout app:

| Fact | Source |
|---|---|
| `plan` (free, plus), signup date, lifetime workouts | Warehouse, through `/api/v1/users` |
| `favorite_workout`, chosen in the app's settings | SDK `setAttribute` |
| `plan_started` conversion for an upgrade agent | Warehouse, through `/api/v1/events` |
| `workout_completed`, which triggers a congratulation modal | SDK `track` |
| Push token, notification permission, app version | SDK |

## Next

- [Server API](/docs/reference/server-api)
- [Importing push tokens and users](/docs/migration/importing-tokens-and-users)
- [Events and attributes](/docs/concepts/events-and-attributes)
