Create a new manual identity (user, group, or service identity). Ownership is derived as managed=false and sources=[manual]. Deprecated ownership fields may be omitted or echo that state.
A service account (service_account: true) may omit external_id (derived from display_name). Returns 409 on duplicate external_id, or 400 if a generated target name collides with an existing account or reserved name (root, postgres).
Request body application/json · CreateIdentityRequest
Identity creation request
usergroupserviceRequired, except for a service account (service_account=true) that does not sign in to Principal (no principal_login, principal_password or send_invitation). Such a service account without it gets a login made from display_name: Latin letters and digits joined by hyphens, Cyrillic transliterated, at most 32 characters with a -2, -3 suffix when the login is taken. Its accounts on targets are named after the login. A service account's external_id that another identity already has is refused with 409. It is refused with 400 when a member or an account found on a target already has a name it would give on targets, and when that name is reserved, such as root or postgres.
Deprecated compatibility field. Ownership is derived as false for public creates. Omit this field or send false. Sending true is rejected.
Custom attributes, for example email. Server-owned keys are ignored: principal_static_account, target_account_adoption, target_account_key, github_account_type, principal_password_rotated_at, secret_ref.
Manual password. Validated in UTF-8 bytes: 12-72 bytes, including uppercase, lowercase, digit, and special characters. Omit to auto-generate.
Create a service account: a user an application uses instead of a person. kind=user only, otherwise 400. It is the same user for rules, groups, credentials and targets.
Requires service_account=true. 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. Never the secret itself. A value that is not such a path is rejected with 400.
Email a one-time password setup link after creation. Omitted or false disables invitations. Requires configured SMTP, a public base URL, kind=user, Principal login, and an email external_id. Delivery failure retains the user and returns invitation_status=failed with the generated password for recovery. The link expires in 24 hours.
Deprecated compatibility field. Ownership is derived as [manual] for public creates. Omit this field, send an empty array, or send exactly [manual]. Other values are rejected.
Responses
Created
IdentityWithPrincipalPasswordResponse · 27 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.
Present only when an invitation was requested. Failed does not roll back user creation.
sentfailedThe caller's roles do not grant the permission of the operation
Conflict - identity already exists
Common errors: 400 401 413 429 503 504. They mean the same for every operation, see Errors.