Skip to content

Identify users

post

/users/identify

Use this endpoint to identify an unidentified (alias-only or email-only) user using the provided external ID.

How it works

Calling /users/identify combines a user profile that is identified by an alias (alias-only profile) or email address (email-only profile) with a user profile that has an external_id (identified profile), then removes the alias-only profile.

Identifying a user requires an external_id to be included in the aliases_to_identify or emails_to_identify object. If there isn’t a user with that external_id, the external_id will be added to the aliased user’s record, and the user will be considered identified.

Note the following:

  • When these subsequent associations are made with the merge_behavior field set to none, only the push tokens and message history associated with the user alias are retained; any attributes, events, or purchases will be “orphaned” and not available on the identified user. One workaround is to export the aliased user’s data before identification using the /users/export/ids endpoint, then re-associate the attributes, events, and purchases with the identified user.
  • When associations are made with the merge_behavior field set to merge, this endpoint will merge specific fields found on the anonymous user to the identified user.

Prerequisites

To use this endpoint, you’ll need an API key with the users.identify permission.

Rate limit

For customers who onboarded with Braze on or after September 16, 2021, we apply a shared rate limit of 20,000 requests per minute to this endpoint. This rate limit is shared with the /users/delete, /users/alias/new, /users/merge, and /users/alias/update endpoints, as documented in API rate limits.

Request body

1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
5
{
   "aliases_to_identify" : (required, array of alias to identify objects),
   "email_addresses": (optional, array of string) User emails for the users to identify,
   "merge_behavior": (optional, string) one of 'none' or 'merge' is expected
}

Request parameters

You can add up to 50 user aliases per request. You can associate multiple additional user aliases with a single external_id.

Merge_behavior field

Setting the merge_behavior field to merge sets the endpoint to merge the following list of fields found exclusively on the anonymous user to the identified user. Setting the field to none will not merge any user data to the identified user profile.

List of fields that are merged
  • First name
  • Last name
  • Email
  • Gender
  • Date of birth
  • Phone number
  • Time zone
  • Home city
  • Country
  • Language
  • Session count (the sum of sessions from both profiles)
  • Date of first session (Braze will pick the earlier date of the two dates)
  • Date of last session (Braze will pick the later date of the two dates)
  • Custom attributes
  • Custom event and purchase event data
  • Custom event and purchase event properties for “X times in Y days” segmentation (where X<=50 and Y<=30)
  • Segmentable custom events summary
    • Event count (the sum from both profiles)
    • Event first occurred (Braze will pick the earlier date of the two dates)
    • Event last occurred (Braze will pick the later date of the two dates)
  • In-app purchase total in cents (the sum from both profiles)
  • Total number of purchases (the sum from both profiles)
  • Date of first purchase (Braze will pick the earlier date of the two dates)
  • Date of last purchase (Braze will pick the later date of the two dates)
  • App summaries
  • Last_X_at fields (Braze will update the fields if the orphaned profile fields are more recent)
  • Campaign summaries (Braze will pick the most recent date fields)
  • Workflow summaries (Braze will pick the most recent date fields)
  • Message and message engagement history
  • Custom event and purchase event count and first date and last date timestamps
    • These merged fields will update “for X events in Y days” filters. For purchase events, these filters include “number of purchases in Y days” and “money spent in last Y days”.
  • Session data if the app exists on both user profiles
    • For example, if our target user doesn’t have an app summary for “ABCApp” but our original user does, the target user will have the “ABCApp” app summary on their profile after the merge.

Identifying users by email

If an email is specified as an identifier, an additional prioritization value is required in the identifier. The prioritization should be an array specifying which user to merge if there are multiple users found. prioritization is an ordered array, meaning if more than one user matches from a prioritization, then merging will not occur.

The allowed values for the array are: identified, unidentified, most_recently_updated. most_recently_updated refers to prioritizing the most recently updated user.

Only one of the following options may exist in the prioritization array at a time:

  • identified refers to prioritizing a user with an external_id
  • unidentified refers to prioritizing a user without an external_id

Request example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
curl --location --request POST 'https://rest.iad-01.braze.com/users/identify' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "aliases_to_identify": [
    {
      "external_id": "external_identifier",
      "user_alias": {
          "alias_name": "example_alias",
          "alias_label": "example_label"
      }
    }
  ],
  "emails_to_identify": [
    {
      "external_id": "external_identifier_2",
      "email": "[email protected]",
      "prioritization": ["unidentified", "most_recently_updated"]
    }
  ]
  "merge_behavior": "merge"
}'

Response

1
2
3
4
5
6
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
{
    "aliases_processed": 1,
    "message": "success"
}
HOW HELPFUL WAS THIS PAGE?
New Stuff!