Mark a user as a service account (a user an application uses instead of a person), make it a person again, or change where its secret is kept. Only the mark and the secret location change: the identity keeps its ID, groups, rules, credentials and history, no job runs and nothing on a target changes. Connector sync does not change the mark.
Toggling a service account back to a person removes its trusted tokens. See Token exchange.
Parameters
Identity ID (UUID)
Request body application/json · SetIdentityServiceAccountRequest
true marks the user as a service account, or keeps it one and replaces its secret location. False makes it a person again and clears the location.
Service accounts only (400 with service_account=false). Where the application's secret is kept or is to be kept, as a path in the organization secret store, for example secret/data/billing/postgres: segments of letters, digits and . _ - : # separated by slashes. Omitted or empty clears it. Never the secret itself. A value that is not such a path is rejected with 400.
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.
Bad Request: the identity is not a user, the secret location is not a path in a secret store, or a location was sent with service_account=false.
The caller's roles do not grant the permission of the operation
The Idempotency-Key belongs to a running request with the same key (Retry-After) or to a request with another endpoint or body (resource.conflict). Also (details.error_code organization_administrator_required) the change would leave the organization without a person who holds every permission and can sign in.
Common errors: 401 404 413 429 503 504. They mean the same for every operation, see Errors.