A token can update an identity, except a change of the address password reset links of a user go to: that needs a fresh second factor and security:manage. A token cannot give a second factor, so such a change gets 403 auth.api_token_not_allowed. Make it in the console.
Update an existing identity's mutable profile properties. Ownership is derived. Deprecated managed and sources fields may be omitted or echo the current values, but cannot change them. Setting metadata.email to a new address, where the forgot-password form sends reset links, requires an administrator with an enrolled second factor to have confirmed it within the re-authentication window (POST /auth/mfa/reauth). Other changes do not. Each profile field (username, display name, email, avatar) shows the value of one writer by priority: connectors in the order they first linked the identity, then a value set in Principal, then the value kept from before sources were recorded, then the first sign-in email. An edit records the Principal value. A field a connector owns cannot be changed here (409). An API token sets a new metadata.email only when it was issued with allow_security_changes.
Connector-owned fields cannot be edited here (409). Change them at the source.
Parameters
Identity ID (UUID)
Request body application/json · UpdateIdentityRequest
Identity update request
Replaces the stored description. Omit or send an empty string to clear it.
New display name. Omit or send an empty string to keep the stored name.
Deprecated compatibility field. Ownership is derived. Omit this field or echo the identity's current managed value. Changes are rejected.
Replaces the custom attributes. Omit to keep the stored metadata. Server-owned keys are ignored and keep their stored values: principal_static_account, target_account_adoption, target_account_key, github_account_type, principal_password_rotated_at. The retired secret_ref key is ignored and removed.
Deprecated compatibility field. Ownership is derived. Omit this field or echo the identity's current sources exactly. Changes are rejected.
Responses
OK
IdentityResponse · 25 fields
Provider-confirmed account classification. Absent when unknown.
Provider avatar or Gravatar URL for user identities.
Email from the identity metadata, when it is an address.
usergroupserviceDirect member total (group identities only): users, service accounts and nested groups, without GitLab access-token bots. GET /identities/graph reports the same number for the group.
Group identities only: members the group reaches only through its nested groups, at any depth, nested groups included, without GitLab access-token bots and without its own direct members. GET /identities/graph reports the same number.
Group identities only: people (users, a user marked as a service account too, no groups, no identities of kind service, no GitLab access-token bots) the group reaches only through its nested groups, each once, without its own direct members.
Group identities only: direct members that are people (users, a user marked as a service account too), without nested groups, identities of kind service and GitLab access-token bots.
True for a user an application uses instead of a person. A service account is the same user for rules, groups, credentials and targets. The mark only describes it. Absent for people, groups and service identities.
Service accounts only: where the application's secret is kept or is to be kept, as a path in the organization secret store. A description, never a secret. Principal does not read it. Absent when not recorded.
Returned only by GET /identities/{id}: the writer each profile field shows the value of, and other writers that hold a different value.
5 fields
usernamedisplay_name emailavatar_url account_type connector: a connector sync. Principal: set in Principal. Legacy: kept from before sources were recorded. Sign_in: value of the first Dex sign-in.
connectorprincipallegacysign_in Other writers that hold a different value. The shown value wins by priority.
4 fields
connectorprincipallegacysign_in Returned only by GET /identities/{id} for a person: whether an administrator or a connector suspended them.
3 fields
Who suspended the person, an administrator or a connector that no longer finds them.
administratorconnectorLogin from the identity provider. A single sign-on user may have a generated key here.
Forbidden: the caller's roles do not grant the permission of the operation, or metadata.email changes and the administrator's second factor was not confirmed recently (details.reason=mfa_reauth_required), or the request uses an API token issued without allow_security_changes (details.reason=api_token_security_changes_not_allowed).
Conflict (resource.conflict): the request changes a profile field a connector owns. Change it in that source. Nothing is updated.
Common errors: 400 401 404 413 429 503 504. They mean the same for every operation, see Errors.