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

# Userflow

> Sync your freshest data to Userflow to drastically improve your user onboarding

## Setup

Upon selecting Userflow as your destination you will be prompted to
input your Userflow API key.

You can locate this API key within your Userflow account by navigating to *Settings > API*:

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-setup.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=0d1ade5c7f3af24384de17f862b79ac7)

## Syncing

Hightouch supports syncing the following Userflow objects:

* `Users`
* `Groups`

### Sync modes

* **Upsert**: pushes new objects to Userflow *and* updates fields that change in your warehouse.
* **Update**: only updates particular fields on existing objects in Userflow. It does *not* add new objects.

### Record matching

Records can be matched from your source to your Userflow workspace by the **user ID** or **group ID**, depending on the object you are syncing.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-record-matching.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=dda3fceb8694c1b3ddbcd730cf6b832f)

### Field mapping

You may also sync columns from your source to Userflow's object properties. You have the option
of mapping to attributes that already exist on the Userflow object, or to create new attributes for current
and future use.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-field-mapping.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=ced1aa136368d13aa8974589757f6439)

*\*NOTE: Aside from `groups` and `memberships` on `User` objects, all other fields will be associated with the `Group` or `User` object's `attributes` field within Userflow.*

### A note on "groups" and "memberships"

The Userflow API allows you to create/update both groups and memberships through creating/updating
a user by including the appropriate `groups`/`memberships` as fields on the user object in the
request payload.

However, please be aware that their inclusion is not required and at most only one of either `groups`
or `memberships` can be set on a user per request. If your intention is only to sync group information,
it may be best to sync `Group` objects instead.

For more information on `groups` and `memberships`, including how they are properly formatted on a `User` object,
please consult the [Userflow API documentation](https://userflow.com/docs/api#create-or-update-a-user):

* Formatting `groups` for a `User`:

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-create-group-on-user.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=c013967b9e594282cc106898bde39609)

* Formatting `memberships` for a `User`:

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-create-membership-on-user.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=7752c42c6d60d417a9c8d3512069f78b)

### Pruning memberships

Hightouch also supports the ability to prune memberships of a user upon sync through the `prune_memberships`
property in the request payload. As per the Userflow API documentation:

> *"By default, the API will only update the memberships/groups that's included in the request. Existing memberships that aren't included will not be removed, unless you set `prune_memberships` to `true`. Only set `prune_memberships` to `true`, if the groups or memberships list is set and contains *all* the groups the user belongs to. When a membership is deleted, the group itself is left intact."*

When either `groups` or `memberships` are chosen to be synced to the destination, Hightouch will give you
the option to toggle membership pruning on or off.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-userflow-pruning-memberships.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=34b5aecc437c254f12a2eaf735dd76e0)

*\*NOTE: By default, membership pruning is disabled.*

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