Overview
This article explains whether it is possible to edit user profile root attributes such as given_name and family_name.
Applies To
- User Profiles
- Root Attributes
Solution
The type of connection the user belongs to will determine whether root attributes can be updated.
Auth0 as the identity provider (IdP)
When Auth0 is the IdP, root user attributes can be updated individually via the Update a user endpoint or via user import with upsert enabled.
Auth0 is considered the IdP for the following connection types:
- Database connections
- Custom database connections with import mode enabled
- Passwordless connections
Third-party IdPs
By default, root attributes of users sourced from third-party IdP’s cannot be edited. This is because the external IdP is considered the source of the truth for user data.
That said, it’s possible to enable editing by turning off the syncing of user profile attributes:
- Navigate to the Auth0 dashboard > Connections > > Provisioning
- Turn off “Sync user profile attributes at each login”
This ensures user attributes are updated from the IdP only on initial user profile creation.
Once this is done, it will then be possible to update root attributes for users with synced attributes via the same means as described in the “Auth0 as the identity provider (IdP)” section.
Please note that this will mean that any changes to the user profile on the IdP side will not be synced on subsequent logins.
Updating examples
Here are example requests for updating root attributes both individually and via bulk import.
Individual updates
Use the Update a user endpoint:
curl -X PATCH --url https://<domain>/api/v2/users/<user id> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access token>' \
-d '{
"name": "New Name",
"nickname": "New Nickname"
}'
Bulk updates
Use the Create import users job endpoint:
curl -X POST --url https://<domain>/api/v2/jobs/users-imports \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access token>' \
-d '{
"users": [
{
"email": "john.doe@example.com",
"name": "John Doe",
"nickname": "Johnny"
},
// More users...
],
"connection_id": "<connection id>",
"upsert": true
}'