---
openapi: 3.0.3
info:
  title: Braze REST API – Identify users
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics) with the `users.identify` permission.

    ## Rate limit

    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]({{site.baseurl}}/api/api_limits/).
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
  - BearerAuth: []
paths:
  /users/identify:
    post:
      summary: Identify users
      description: |
        ## Case sensitivity

        The `alias_name` field is case-sensitive. A request that returns a `201` status code only confirms the request syntax was valid—it does not confirm the alias was matched. If the capitalization of `alias_name` in your request doesn't exactly match the alias stored on the user profile, the operation will silently fail and the `external_id` won't be assigned. For example, if the stored alias is `JimJones@example.com`, a request with `jimjones@example.com` will return success but produce no result.

        **Tip:**
        For more information on `alias_name` and `alias_label`, check out our [user aliases]({{site.baseurl}}/user_guide/data/unification/user_data/user_profile_lifecycle) documentation.

        ## Why does my identify request return success but the profile did not merge?

        `201 Created` with `message: success` means Braze accepted the request. It does not guarantee that every alias or email in the payload matched an existing profile—case mismatches on `alias_name`, duplicate profiles, or Braze prioritization rules can result in no visible merge even though the call succeeded. Verify that `alias_name` casing exactly matches stored values, check for duplicate profiles with [`/users/merge`]({{site.baseurl}}/api/endpoints/user_data/post_users_merge/), and review [`prioritization`](#identifying-users-by-email-addresses-and-phone-numbers) when using `emails_to_identify`.

        ## How it works

        Calling `/users/identify` combines a user profile that is identified by an alias (alias-only profile), email address (email-only profile), or phone number (phone number-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 following objects:

        - `aliases_to_identify`
        - `emails_to_identify`
        - `phone_numbers_to_identify`

        If there isn't a user with that `external_id`, the `external_id` is added to the aliased user's record, and the user is considered identified. Users can have only one alias for a specific label. If a user already exists with the `external_id` and has an existing alias with the same label as the alias-only profile, then the user profiles are not combined.

        **Tip:**
        To prevent unexpected loss of data when identifying users, we highly recommend that you first refer to [data collection best practices]({{site.baseurl}}/collection_best_practices) to learn about capturing user data when alias-only user information is already present.

        ### Merging behavior

        By default, this endpoint merges the following list of fields found **exclusively** on the anonymous user to the identified user.

        - 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 picks the earlier date of the two dates)
        - Date of last session (Braze picks 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 picks the earlier date of the two dates)
          - Event last occurred (Braze picks 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 picks the earlier date of the two dates)
        - Date of last purchase (Braze picks the later date of the two dates)
        - App summaries
        - Last_X_at fields (Braze updates the fields if the orphaned profile fields are more recent)
        - Campaign summaries (Braze picks the most recent date fields)
        - Workflow summaries (Braze picks 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 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 has the "ABCApp" app summary on their profile after the merge.
      operationId: identifyUsers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentifyUsersRequest'
            examples:
              aliases_and_emails:
                summary: Identify by alias and by email in one request
                value:
                  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: john.smith@example.com
                      prioritization:
                        - unidentified
                        - most_recently_updated
              aliases:
                summary: Identify by alias
                value:
                  aliases_to_identify:
                    - external_id: user_123
                      user_alias:
                        alias_name: anonymous_abc
                        alias_label: temporary_id
              emails:
                summary: Identify by email
                value:
                  emails_to_identify:
                    - external_id: user_456
                      email: jane.doe@example.com
                      prioritization:
                        - unidentified
                        - most_recently_updated
              phone_numbers:
                summary: Identify by phone number
                value:
                  phone_numbers_to_identify:
                    - external_id: user_789
                      phone: "+15555550100"
                      prioritization:
                        - unidentified
                        - most_recently_updated
      responses:
        "201":
          description: The request succeeded and the users were identified. No action needed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentifyUsersResponse'
              examples:
                success:
                  summary: Users identified
                  value:
                    aliases_processed: 1
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **No identify input was provided:** Include at least one of `aliases_to_identify`, `emails_to_identify`, or `phone_numbers_to_identify`.
            - **An identify input isn't an array:** Pass each identify input as an array.
            - **More than 50 users were provided:** Identify 50 or fewer users per request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                no_input:
                  summary: No identify input
                  value:
                    message: No data received for 'aliases_to_identify', 'emails_to_identify', or 'phone_numbers_to_identify' (at least one required)
                input_not_array:
                  summary: An identify input isn't an array
                  value:
                    message: If using 'aliases_to_identify', 'emails_to_identify', or 'phone_numbers_to_identify', they must be arrays
                too_many_users:
                  summary: More than 50 users
                  value:
                    message: At most 50 total users can be identified at once
        "401":
          description: |
            Unauthorized. The REST API key is missing, malformed, or sent to the wrong REST endpoint. Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    message: 'Invalid API key: YOUR_REST_API_KEY'
        "403":
          description: Access denied. The REST API key doesn't have the required permission. Use a REST API key that has the `users.identify` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Missing permission
                  value:
                    message: Access Denied
        "429":
          description: |
            Rate limited. You exceeded the rate limit for this endpoint. Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    message: You have exceeded your limit of 20000 requests per minute. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
      description: |
        REST API keys are created in the Braze dashboard at **Settings → APIs and
        Identifiers → API Keys**. The key must include the `users.identify` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    UserAlias:
      title: User alias
      type: object
      required: [alias_name, alias_label]
      properties:
        alias_name:
          type: string
          example: example_alias
        alias_label:
          type: string
          example: example_label
    Prioritization:
      title: Prioritization
      type: array
      minItems: 1
      items:
        type: string
        enum: [identified, unidentified, most_recently_updated, least_recently_updated]
      description: |
        If an email address or phone number is specified as an identifier, you must also include `prioritization` in the identifier.

        The `prioritization` must 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 does not occur.

        The allowed values for the array are:

        - `identified`
        - `unidentified`
        - `most_recently_updated` (refers to prioritizing the most recently updated user)
        - `least_recently_updated` (refers to prioritizing the least 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`

        **Note:**
        A merge does not occur if the email address or phone number matches multiple users. This includes cases where one of those users has the same `external_id` as the one specified in the request. In these cases, the endpoint returns `"message": "success"`, but the user profiles are not combined. To avoid this, verify that the email address or phone number is associated only with unidentified users before calling this endpoint.
      example:
        - unidentified
        - most_recently_updated
    IdentifyAlias:
      title: Alias to identify
      type: object
      required: [external_id, user_alias]
      properties:
        external_id:
          type: string
          example: external_identifier
        user_alias:
          $ref: '#/components/schemas/UserAlias'
    IdentifyEmail:
      title: Email to identify
      type: object
      required: [external_id, email, prioritization]
      properties:
        external_id:
          type: string
          example: external_identifier_2
        email:
          type: string
          format: email
          example: john.smith@example.com
        prioritization:
          $ref: '#/components/schemas/Prioritization'
    IdentifyPhone:
      title: Phone number to identify
      type: object
      required: [external_id, phone, prioritization]
      properties:
        external_id:
          type: string
          example: user_789
        phone:
          type: string
          example: "+15555550100"
        prioritization:
          $ref: '#/components/schemas/Prioritization'
    IdentifyUsersRequest:
      title: Identify users request
      type: object
      description: |
        You can add up to 50 user aliases per request. You can associate multiple additional user aliases with a single `external_id`.

        **Important:**
        One of the following is required: `aliases_to_identify`, `emails_to_identify`, or `phone_numbers_to_identify` per request. For example, you can use this endpoint to identify users by email by using `emails_to_identify` in your request.
      properties:
        aliases_to_identify:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/IdentifyAlias'
          description: See [alias to identify object]({{site.baseurl}}/api/objects_filters/aliases_to_identify) and [user alias object]({{site.baseurl}}/api/objects_filters/user_alias_object).
        emails_to_identify:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/IdentifyEmail'
          description: Required if `email` is specified as the identifier. Email addresses to identify users. See [Identifying users by email](#identifying-users-by-email-addresses-and-phone-numbers).
        phone_numbers_to_identify:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/IdentifyPhone'
          description: Phone numbers to identify users.
    IdentifyUsersResponse:
      title: Identify users response
      type: object
      properties:
        aliases_processed:
          type: integer
          description: Number of valid `aliases_to_identify` entries accepted for processing.
          example: 1
        emails_processed:
          type: integer
          description: Number of valid `emails_to_identify` entries accepted for processing.
          example: 1
        phone_numbers_processed:
          type: integer
          description: Number of valid `phone_numbers_to_identify` entries accepted for processing.
          example: 0
        message:
          type: string
          example: success
    ErrorResponse:
      title: Error
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Optional list of detailed validation errors.
          items:
            type: string
