SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Removing Legacy Email Identifiers From Segment Unify Profiles

Issue

A customer wants to update a user's email address in Segment Unify, for example when an end user changes their email in a "change my email" feature. They see that sending an identify call with the new email updates the email trait, but the old email address stays on the profile as an identifier. They want to know how to remove the old email identifier without deleting the whole profile.

 

Product

Segment

 

Environment

Segment Console

 

Cause

When an identify call carries a new email, Segment updates the profile's email trait to the new value. Separately, Unify keeps a list of identifiers it uses to recognise the person. It adds email addresses to that list but does not remove them on its own, so the old address stays until it is deleted.

Old addresses count toward the profile's email identifier limit. They can also cause the profile to merge with another profile that later uses that address. Alias calls cannot change this, and the Profile API is read-only.

 

Resolution

Use the Delete Profile Identifier API to remove the old email from the profile. The profile keeps its traits, events and merge history.

Before you start, make sure that:

  • You have the Workspace Owner, Identity Admin, or Unify and Engage Admin role.
  • You have an access token and the space ID from Unify > Unify settings > API access.
  • The profile has a user_id. The API finds profiles by user_id only.

Then follow these steps:

  1. Note the user's old email address.
  2. Send an identify call with the user's unchanged user_id and the new email in traits.email.
  3. Wait at least 5 minutes. Deleting an identifier sooner can let Engage or Journeys add it back.
  4. Encode your access token for Basic authentication, with a colon at the end: echo -n 'your_token:' | base64
  5. Send the delete request, one identifier per request. Use profiles.segment.com for North America workspaces or profiles.euw1.segment.com for EU workspaces.
curl --location --request POST 'https://{HOST_NAME}/v1/spaces/{SPACE_ID}/collections/users/profiles/user_id:{USER_ID}/external_ids/delete' \
--header 'Authorization: Basic <base64_token_colon>' \
--header 'Content-Type: application/json' \
--data '{
  "delete_external_ids": [
    { "id": "old@example.com", "type": "email" }
  ]
}'
  1. Check the response. 200 success means the old email was removed. 404 eid_not_found means it was not on the profile.
  2. Open the profile in the Profile explorer and confirm that only the new email remains. This can take up to 5 minutes.

If the profile has already reached its email identifier limit, delete the old email (step 5) before sending the identify call (step 2). Otherwise the new email will not be added as an identifier.

To clean up many profiles, send one request per identifier and stay under 100 requests per second per space.

 

Additional Information 

Have more questions? Submit a request
Powered by Zendesk