User creation

Creates a new user. Note only administrators can create new
users. Either password, reset_password, or force_random_password
must be specified. If reset_password and force_random_password are
both false, then password is required.

Note that force_random_password and reset_password take priority
over password. In addition, reset_password and
force_random_password can be used together.

On password update, user will be forced to change it upon next login.
Note, at the moment this method does only return a 404 error,
even in cases where a 409 (Conflict) would be more appropriate.
For example, when renaming the email address to some existing one.

Delete authentication identity from user

Deletes a user's authentication identity using the provider name associated with that identity. Available only for administrators.

DELETE /users/:id/identities/:provider

Parameters:

id (required) - The ID of the user

provider (required) - External provider name

User deletion

Deletes a user. Available only for administrators.
This returns a 204 No Content status code if the operation was successfully, 404 if the resource was not found or 409 if the user cannot be soft deleted.

DELETE /users/:id

Parameters:

id (required) - The ID of the user

hard_delete (optional) - If true, contributions that would usually be
moved to the ghost user
will be deleted instead, as well as groups owned solely by this user.

Create an impersonation token

Requires admin permissions.
Token values are returned once. Make sure you save it - you won't be able to access it again.

It creates a new impersonation token. Note that only administrators can do this.
You are only able to create impersonation tokens to impersonate the user and perform
both API calls and Git reads and writes. The user will not see these tokens in their profile
settings page.

POST /users/:user_id/impersonation_tokens

Attribute

Type

Required

Description

user_id

integer

yes

The ID of the user

name

string

yes

The name of the impersonation token

expires_at

date

no

The expiration date of the impersonation token in ISO format (YYYY-MM-DD)

User memberships (admin only)

Lists all projects and groups a user is a member of. This endpoint is available for admins only.
It returns the source_id, source_name, source_type and access_level of a membership.
Source can be of type Namespace (representing a group) or Project. The response represents only direct memberships. Inherited memberships, for example in subgroups, are not included.
Access levels are represented by an integer value. For more details, read about the meaning of access level values.