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 byuser_idonly.
Then follow these steps:
- Note the user's old email address.
- Send an identify call with the user's unchanged
user_idand the new email intraits.email. - Wait at least 5 minutes. Deleting an identifier sooner can let Engage or Journeys add it back.
- Encode your access token for Basic authentication, with a colon at the end:
echo -n 'your_token:' | base64 - Send the delete request, one identifier per request. Use
profiles.segment.comfor North America workspaces orprofiles.euw1.segment.comfor 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" }
]
}'- Check the response.
200 successmeans the old email was removed.404 eid_not_foundmeans it was not on the profile. - 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.