Update the Identifier of a Secondary Account in an Auth0 Linked Account
Last Updated:
Overview
The Auth0 Management API supports updating the identifier of a secondary account within a linked account. Use the Update a User endpoint to modify identifiers, such as a phone number, for a secondary account.
Applies To
- Auth0
- Management API
- Linked accounts
- User identifiers
Solution
How is the identifier of a secondary account updated?
Update the identifier of a secondary account by sending a PATCH request to the Update a User endpoint in the Management API.
Review the following JSON example of a linked profile containing a secondary account.
{
"user_id": "google-oauth2|...",
"email": "...",
"...": "...",
"identities": [
{
"provider": "google-oauth2",
"...": "...",
"user_id": "...",
"connection": "google-oauth2",
"isSocial": true
},
{
"profileData": {
"phone_number": "...",
"...": "..."
},
"connection": "Username-Password-Authentication",
"provider": "auth0",
"user_id": "...",
"isSocial": false
}
],
"...": "..."
}
Execute the following curl command to update the phone number identifier for the secondary account using the Update a User endpoint.
curl --request PATCH \
--url https://<tenant>/api/v2/users/<id> \
--header 'Authorization: Bearer ey...' \
--header 'Content-Type: application/json' \
--data '{ "phone_number":"<PHONE_NUMBER>", "connection": "<CONNECTION_NAME>" }'