Use this API to interact with user accounts on GitLab. These endpoints can help manage your account, manage accounts for other users, moderate user accounts, perform follower actions, and interact with email addresses for user accounts.

Retrieve current user details

GET /api/v4/user

Retrieves details about your user account.

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserPublic
401Unauthorized—
403Forbidden—

List all activity for a user

GET /api/v4/user/activities

Lists the last activity date of users, sorted from oldest to newest. By default, lists users active in the last six months. Use from to change the start date. Only users with public profiles are listed, unless you are an administrator or auditor.

Parameters

NameTypeDescription
from
Query
String (date-time)Date string in the format YEAR-MM-DD, for example 2016-03-11. Default is six months ago
Default: 2024-08-14T17:26:19.883Z
Example: 2024-08-14T17:26:19.883Z
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesUserActivity
400Bad Request—

List all email addresses for a user

GET /api/v4/user/emails

Lists all email addresses for the currently authenticated user.

Parameters

NameTypeDescription
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesEmail
400Bad Request—

Add an email address

POST /api/v4/user/emails

Adds an email address for the currently authenticated user. If the email address is already in use, returns a validation error with the message has already been taken.

Request body (application/json)

PropertyTypeDescription
email
Required
StringEmail address to add to the account

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesEmail
400Bad Request—

Retrieve details on an email address

GET /api/v4/user/emails/{email_id}

Retrieves details on a specified email address for the currently authenticated user.

Parameters

NameTypeDescription
email_id
Path, required
IntegerID of the email

Responses

CodeDescriptionSchema
200OKAPIEntitiesEmail
400Bad Request—
404Not Found—

Delete an email address

DELETE /api/v4/user/emails/{email_id}

Deletes the specified email address. You cannot delete a primary email address. Any future emails sent to the deleted email address are sent to the primary email address instead.

Parameters

NameTypeDescription
email_id
Path, required
IntegerID of the email

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

Retrieve your user preferences

GET /api/v4/user/preferences

Retrieves your user preferences.

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserPreferences
401Unauthorized—
403Forbidden—

Update your user preferences

PUT /api/v4/user/preferences

Updates your user preferences.

Request body (application/json)

PropertyTypeDescription
emoji_skin_toneStringDefault skin tone for emoji that have skin tone variants. One of default, light, medium_light, medium, medium_dark, or dark. Introduced in GitLab 19.6. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
Allowed values: default, light, medium_light, medium, medium_dark, dark
mobile_push_working_daysArray of stringsWeekdays with working hours, for example ["monday", "tuesday"]. Defaults to Monday through Friday. The array you send replaces the whole set. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
mobile_push_working_hours_enabledBooleanIf true, mobile push notifications are sent only during the working hours below. To-dos created outside them are summarized in one notification when the working hours begin. Setting this to true requires a start time, an end time that differs from it, a time zone, and at least one working day. Send them in the same request or set them first. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
mobile_push_working_hours_endIntegerEnd of the working hours as minutes after midnight. A value before the start means the window crosses midnight. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
Maximum: 1439
Minimum: 0
mobile_push_working_hours_startIntegerStart of the working hours as minutes after midnight, for example 540 for 09:00. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
Maximum: 1439
Minimum: 0
mobile_push_working_hours_time_zoneStringIANA time zone the working hours are defined in, for example Europe/Berlin. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
Maximum length: 64
pass_user_identities_to_ci_jwtBooleanIf true, passes the user’s external identities to CI jobs as part of a JSON web token. This attribute does not contain enough information to identify or authorize the user in an external system. It is internal to GitLab and must not be passed to third-party services. For more information, see Token Payload. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
policy_advanced_editorBooleanIf true, enables the advanced editor. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
show_whitespace_in_diffsBooleanIf true, the user sees whitespace changes in diffs. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided
view_diffs_file_by_fileBooleanIf true, the user sees only one file diff per page. At least one of view_diffs_file_by_file, show_whitespace_in_diffs, pass_user_identities_to_ci_jwt, policy_advanced_editor, emoji_skin_tone, mobile_push_working_hours_enabled, mobile_push_working_hours_start, mobile_push_working_hours_end, mobile_push_working_days, mobile_push_working_hours_time_zone must be provided

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserPreferences
400Bad Request—

Create a runner owned by currently authenticated user

POST /api/v4/user/runners

Creates a runner linked to the current user. The user is listed as the owner for audit purposes, but runner availability is based on runner_type. The token value is included in the response, but cannot be retrieved later. For instance_type, requires an administrator. For group_type, requires an administrator, the Owner role for the group, or a custom role with the admin_runners permission. For project_type, requires an administrator, at least the Maintainer role for the project, or a custom role with the admin_runners permission. For group_type and project_type, users who are not administrators can create the runner only when runner registration is allowed for the group or project. Requires a token with the create_runner or api scope.

Request body (application/json)

PropertyTypeDescription
access_levelStringAccess level of the runner
Allowed values: not_protected, ref_protected
descriptionStringDescription of the runner
group_id
Required
IntegerID of the group to create the runner in. Required if runner_type is group_type
Example: 1
lockedBooleanSpecifies if the runner should be locked for the current project
Default: false
maintenance_noteStringFree-form maintenance notes for the runner. Limited to 1024 characters
maximum_timeoutIntegerMaximum time, in seconds, that runners can spend running a job
pausedBooleanIf true, the runner ignores new jobs
project_id
Required
IntegerID of the project to create the runner in. Required if runner_type is project_type
Example: 1
run_untaggedBooleanSpecifies if the runner should handle untagged jobs
Default: true
runner_type
Required
StringScope of the runner
Allowed values: instance_type, group_type, project_type
Minimum length: 1
tag_listArray of stringsComma-separated list of runner tags

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiRunnerRegistrationDetails
400Bad Request—
403Forbidden—

Retrieve your user status

GET /api/v4/user/status

Retrieves your user status.

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserStatus
401Unauthorized—
403Forbidden—

Set a user status

PUT /api/v4/user/status

Sets the status of the currently authenticated user. Any parameters that are not passed are nullified. This operation is similar but distinct from the Update a user status operation.

Request body (application/json)

PropertyTypeDescription
availabilityStringAvailability of the user. Possible values are busy and not_set
clear_status_afterStringTime after which the status is cleared automatically
Allowed values: 30_minutes, 3_hours, 8_hours, 1_day, 3_days, 7_days, 30_days
emojiStringName of the emoji to use as a status. If omitted, speech_balloon is used. Must be one of the names in the Gemojione index
messageStringMessage to set as a status. Can contain emoji codes. Maximum of 100 characters

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserStatus
400Bad Request—

Update a user status

PATCH /api/v4/user/status

Sets the status of the currently authenticated user. Any parameters that are not passed are ignored. To clear a field, pass null explicitly. This operation is similar but distinct from the Set a user status operation.

Request body (application/json)

PropertyTypeDescription
availabilityStringAvailability of the user. Possible values are busy and not_set
clear_status_afterStringTime after which the status is cleared automatically
Allowed values: 30_minutes, 3_hours, 8_hours, 1_day, 3_days, 7_days, 30_days
emojiStringName of the emoji to use as a status. If omitted, speech_balloon is used. Must be one of the names in the Gemojione index
messageStringMessage to set as a status. Can contain emoji codes. Maximum of 100 characters

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserStatus
400Bad Request—

Retrieve Support PIN

GET /api/v4/user/support_pin

Retrieves a Support PIN for the currently authenticated user. GitLab Support may ask for this PIN to validate your identity. This feature was introduced in GitLab 17.8.

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserSupportPin
401Unauthorized—
403Forbidden—
404Not Found—

Create a Support PIN

POST /api/v4/user/support_pin

Creates a Support PIN for your user account. The PIN expires seven days after creation. GitLab Support may ask for this PIN to validate your identity. This feature was introduced in GitLab 17.8.

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesUserSupportPin
400Bad Request—

Update a user’s credit_card_validation (deprecated)

PUT /api/v4/user/{user_id}/credit_card_validation

Deprecated in 17.7

Parameters

NameTypeDescription
user_id
Path, required
StringID or username of the user

Request body (application/json)

PropertyTypeDescription
credit_card_expiration_month
Required
IntegerMonth the credit card expires
credit_card_expiration_year
Required
IntegerYear the credit card expires
credit_card_holder_name
Required
StringName of the credit card holder
credit_card_mask_number
Required
StringLast 4 digits of the credit card number
credit_card_type
Required
StringName of the credit card network
credit_card_validated_at
Required
String (date-time)Time when the user’s credit card was validated
stripe_card_fingerprintStringStripe credit card fingerprint
stripe_payment_method_xidStringID of the Stripe payment method
stripe_setup_intent_xidStringID of the Stripe setup intent
zuora_payment_method_xidStringID of the Zuora payment method

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserCreditCardValidations
400Bad Request—
404Not Found—

Return the user specific counts

GET /api/v4/user_counts

Returns counts for the current user: open issues and active merge requests assigned to the user, merge requests the user is requested to review, and pending to-do items.

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserCounts
401Unauthorized—

List all users

GET /api/v4/users

Lists all users on the instance. This endpoint supports keyset pagination. By default, offset pagination is limited to 50,000 results. Use keyset pagination to retrieve more. Only administrators and auditors can use the created_after, created_before, two_factor, and without_projects parameters. For other users, these parameters are ignored.

Parameters

NameTypeDescription
username
Query
StringReturn a single user with the specified username. The match is case-insensitive
extern_uid
Query
StringReturn a single user with the specified external authentication provider UID. Use with provider. Administrators only. All or none of extern_uid, provider must be provided
public_email
Query
StringReturn a single user with the specified public email
provider
Query
StringName of the external authentication provider. The scim provider is available in Premium and Ultimate only. All or none of extern_uid, provider must be provided
search
Query
StringSearch for users by name, username, or public email. Administrators can also search private email addresses. Email matches must be exact. Name and username matches are fuzzy
active
Query
BooleanIf true, returns only active users. false has no effect
Default: false
humans
Query
BooleanIf true, returns only regular users that are not bot or internal users
Default: false
external
Query
BooleanIf true, returns only external users. false has no effect
Default: false
blocked
Query
BooleanIf true, returns only blocked users. false has no effect
Default: false
created_after
Query
String (date-time)Return users created on or after the specified time
created_before
Query
String (date-time)Return users created on or before the specified time
without_projects
Query
BooleanIf true, returns only users that do not have any projects
Default: false
without_project_bots
Query
BooleanIf true, excludes bot users for projects and groups from the results
Default: false
admins
Query
BooleanIf true, returns only administrators
Default: false
two_factor
Query
StringFilter users by two-factor authentication. Possible values are enabled and disabled. By default, returns all users
exclude_active
Query
BooleanIf true, returns only users that are not active
Default: false
exclude_external
Query
BooleanIf true, returns only users that are not external
Default: false
exclude_humans
Query
BooleanIf true, returns only bot or internal users
Default: false
exclude_internal
Query
BooleanIf true, returns only users that are not internal. Internal users include the alert bot and the support bot. Bot users for projects and groups are not excluded
Default: false
order_by
Query
StringSort results by the specified field. Default is id
Allowed values: id, name, username, created_at, updated_at
sort
Query
StringSort results in ascending or descending order. Default is desc
Allowed values: asc, desc
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
with_custom_attributes
Query
BooleanIf true, includes custom attributes in the response. Administrators only
Default: false
custom_attributes
Query
ObjectFilter by custom attributes that match all of the specified key and value pairs. Administrators only

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesUserBasic
400Bad Request—

Create a user

POST /api/v4/users

Creates a user. If private_profile is not set, it defaults to the instance setting for new user profiles. If bio is not set, it defaults to an empty string. Administrators only.

Request body (multipart/form-data)

PropertyTypeDescription
adminBooleanFlag indicating the user is an administrator. Default is false for new users
avatarString (binary)Avatar image for user
bioStringThe biography of the user
can_create_groupBooleanFlag indicating the user can create top-level groups
color_scheme_idIntegerThe color scheme for the file viewer
commit_emailStringThe commit email, _private for private commit email
discordStringThe Discord user ID
email
Required
StringEmail address of the user
extern_uidStringThe external authentication provider UID. All or none of extern_uid, provider must be provided
externalBooleanFlag indicating the user is an external user. For new users, the default comes from the instance setting for new external users
force_random_passwordBooleanFlag indicating a random password will be set. Can be used with reset_password. Takes priority over password. At least one of password, reset_password, force_random_password must be provided
githubStringThe GitHub username
linkedinStringThe LinkedIn username
locationStringThe location of the user
name
Required
StringThe name of the user
noteStringAdmin note for this user
organizationStringThe organization of the user. Empty string or nil clears the field
passwordStringThe password of the new user. If force_random_password or reset_password is true, it takes priority over password. At least one of password, reset_password, force_random_password must be provided
policy_advanced_editorBooleanFlag indicating that advanced editor is enabled
private_profileBooleanFlag indicating the user has a private profile. For new users, the default comes from the instance setting for new user profiles
projects_limitIntegerThe number of projects a user can create
pronounsStringThe pronouns of the user
providerStringName of the external authentication provider. All or none of extern_uid, provider must be provided
public_emailStringThe public email of the user. Must be a verified email address of the user
reset_passwordBooleanFlag indicating the user will be sent a password reset token. Can be used with force_random_password. Takes priority over password. At least one of password, reset_password, force_random_password must be provided
skip_confirmationBooleanFlag indicating the account is confirmed. Default is false
theme_idIntegerThe GitLab theme for the user
twitterStringThe Twitter username
username
Required
StringThe username of the user
view_diffs_file_by_fileBooleanIf true, the user sees only one file diff per page
website_urlStringThe website of the user

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesUserWithAdmin
400Bad Request—

Retrieve a user

GET /api/v4/users/{id}

Retrieves a specified user. Requires authentication. Administrators and auditors see more attributes in the response.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
with_custom_attributes
Query
BooleanIf true, includes custom attributes in the response. Administrators only
Default: false
custom_attributes
Query
ObjectFilter by custom attributes that match all of the specified key and value pairs. Administrators only

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserProfile
400Bad Request—
404Not Found—

Update a user

PUT /api/v4/users/{id}

Updates the details of a specified user. If an administrator updates the password of another user, that user must change it when they next sign in. Administrators only. If email is a confirmed secondary email address of the user, it becomes the primary email address at once. Any other address is stored as unconfirmed and becomes the primary email address only after the user confirms it, unless skip_reconfirmation is true.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Request body (multipart/form-data)

PropertyTypeDescription
adminBooleanFlag indicating the user is an administrator. Default is false for new users
avatarString (binary)Avatar image for user
bioStringThe biography of the user
can_create_groupBooleanFlag indicating the user can create top-level groups
color_scheme_idIntegerThe color scheme for the file viewer
commit_emailStringThe commit email, _private for private commit email
discordStringThe Discord user ID
emailStringPrimary email address of the user
extern_uidStringThe external authentication provider UID. All or none of extern_uid, provider must be provided
externalBooleanFlag indicating the user is an external user. For new users, the default comes from the instance setting for new external users
githubStringThe GitHub username
linkedinStringThe LinkedIn username
locationStringThe location of the user
nameStringThe name of the user
noteStringAdmin note for this user
organizationStringThe organization of the user. Empty string or nil clears the field
passwordStringThe password of the user
policy_advanced_editorBooleanFlag indicating that advanced editor is enabled
private_profileBooleanFlag indicating the user has a private profile. For new users, the default comes from the instance setting for new user profiles
projects_limitIntegerThe number of projects a user can create
pronounsStringThe pronouns of the user
providerStringName of the external authentication provider. All or none of extern_uid, provider must be provided
public_emailStringThe public email of the user. Must be a verified email address of the user
skip_reconfirmationBooleanFlag indicating the account skips the confirmation by email. Default is false
theme_idIntegerThe GitLab theme for the user
twitterStringThe Twitter username
usernameStringThe username of the user
view_diffs_file_by_fileBooleanIf true, the user sees only one file diff per page
website_urlStringThe website of the user

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserWithAdmin
400Bad Request—
404Not Found—

Delete a user

DELETE /api/v4/users/{id}

Deletes a user. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
hard_delete
Query
BooleanIf true, contributions that would usually be moved to a ghost user are deleted instead, along with groups owned solely by this user

Responses

CodeDescriptionSchema
200OKAPIEntitiesEmail
400Bad Request—
404Not Found—

Reactivate a user

POST /api/v4/users/{id}/activate

Reactivates a specified user account that was previously deactivated. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Approve access to a user

POST /api/v4/users/{id}/approve

Approves access to a specified user account that is pending approval. If the user is not pending approval, returns the message The user you are trying to approve is not pending approval. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Retrieve association counts for a user

GET /api/v4/users/{id}/associations_count

Retrieves the number of groups, projects, issues, and merge requests associated with a specified user. Administrators can query any user. Other users can query only themselves.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserAssociationsCount
400Bad Request—
404Not Found—

Ban a user

POST /api/v4/users/{id}/ban

Bans a specified user account. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Block access to a user

POST /api/v4/users/{id}/block

Blocks a specified user account. A user cannot be blocked if they are blocked through LDAP, are an internal user, or are the user making the request. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Deactivate a user

POST /api/v4/users/{id}/deactivate

Deactivates a specified user account. A user cannot be deactivated if they are blocked by an administrator or by LDAP synchronization, are banned or pending approval, are not dormant, or are an internal user. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Disable two-factor authentication for a user

PATCH /api/v4/users/{id}/disable_two_factor

Disables two-factor authentication for a specified user account. Two-factor authentication cannot be disabled for administrators, including your own account. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserWithAdmin
400Bad Request—
404Not Found—

List all email addresses for a user

GET /api/v4/users/{id}/emails

Lists all email addresses for a specified user account. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesEmail
400Bad Request—
404Not Found—

Add an email address for a user

POST /api/v4/users/{id}/emails

Adds an email address for a specified user account. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Request body (application/json)

PropertyTypeDescription
email
Required
StringEmail address to add to the user account
skip_confirmationBooleanIf true, skips email confirmation and assumes the email is verified. Default is false

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesEmail
400Bad Request—
404Not Found—

Delete an email address for a user

DELETE /api/v4/users/{id}/emails/{email_id}

Deletes a specified email address for a user account. You cannot delete a primary email address. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
email_id
Path, required
IntegerID of the email

Responses

CodeDescriptionSchema
200OKAPIEntitiesEmail
400Bad Request—
404Not Found—

Follow a user

POST /api/v4/users/{id}/follow

Follows a specified user account.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesUser
400Bad Request—
404Not Found—

List all accounts that follow a user

GET /api/v4/users/{id}/followers

Lists all user accounts that follow a specified user.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesUserBasic
400Bad Request—
404Not Found—

List all accounts followed by a user

GET /api/v4/users/{id}/following

Lists all user accounts being followed by a specified user.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesUserBasic
400Bad Request—
404Not Found—

Delete authentication identity from a user

DELETE /api/v4/users/{id}/identities/{provider}

Deletes a user authentication identity using the provider name associated with that identity. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user
provider
Path, required
StringName of the external authentication provider

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserWithAdmin
400Bad Request—
404Not Found—

Reject access to a user

POST /api/v4/users/{id}/reject

Rejects access to a specified user account that is pending approval. If the user is not pending approval, returns the message User does not have a pending request. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Retrieve a Support PIN for a user

GET /api/v4/users/{id}/support_pin

Retrieves a Support PIN for a specified user. GitLab Support may ask for this PIN to validate your identity. Administrators only. This feature was introduced in GitLab 17.8.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserSupportPin
400Bad Request—
404Not Found—

Revoke a Support PIN for a user

POST /api/v4/users/{id}/support_pin/revoke

Revokes a Support PIN for a specified user before its natural expiration. This immediately expires and removes the PIN. Administrators only. This feature was introduced in GitLab 17.11.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

Unban a user

POST /api/v4/users/{id}/unban

Unbans a specified user account that was previously banned. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Unblock access to a user

POST /api/v4/users/{id}/unblock

Unblocks a specified user account that was previously blocked. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Unfollow a user

POST /api/v4/users/{id}/unfollow

Unfollows a specified user account.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the user

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesUser
400Bad Request—
404Not Found—

List all project and group memberships for a user

GET /api/v4/users/{user_id}/memberships

Lists all project and group memberships for a specified user. Only direct memberships are returned. Inherited memberships, for example in subgroups, are not included. Administrators only.

Parameters

NameTypeDescription
user_id
Path, required
IntegerID of the user
type
Query
StringFilter memberships by type
Allowed values: Project, Namespace
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesMembership
400Bad Request—
404Not Found—

Retrieve the status of a user

GET /api/v4/users/{user_id}/status

Retrieves the status of a user. You can access this endpoint without authentication.

Parameters

NameTypeDescription
user_id
Path, required
StringID or username of the user

Responses

CodeDescriptionSchema
200OKAPIEntitiesUserStatus
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCiRunnerRegistrationDetails

PropertyTypeDescription
idInteger (int64)Example: 1
tokenStringExample: glrt-abc123
token_expires_atString (date-time)Example: 2025-01-01T00:00:00.000Z

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesEmail

PropertyTypeDescription
confirmed_atString (date-time)Example: 2015-12-24T15:51:21.880Z
emailStringExample: user@example.com
idInteger (int64)Example: 1

APIEntitiesIdentity

PropertyTypeDescription
extern_uidStringID of the user at the identity provider
providerStringName of the identity provider, such as google_oauth2 or group_saml

APIEntitiesMembership

PropertyTypeDescription
access_levelStringAccess level of the user. Possible values: 0 (no access), 5 (minimal access), 10 (guest), 15 (planner), 20 (reporter), 25 (security manager), 30 (developer), 40 (maintainer), and 50 (owner)
source_idString—
source_nameString—
source_typeString—

APIEntitiesUser

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
bioStringBiography of the user
botBoolean—
created_atString (date-time)Creation date and time of the user account in ISO 8601 format
custom_attributesArray of APIEntitiesCustomAttribute—
discordStringDiscord user ID of the user
followersString—
followingString—
githubStringGitHub username of the user
idInteger (int64)ID of the user
Example: 1
is_followedString—
job_titleStringJob title of the user
linkedinStringLinkedIn username of the user
local_timeString—
locationStringLocation of the user
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
organizationStringOrganization of the user
pronounsStringPronouns of the user
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
twitterStringTwitter username of the user
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root
website_urlStringWebsite of the user
work_informationString—

APIEntitiesUserActivity

PropertyTypeDescription
last_activity_atString (date)Deprecated. Use last_activity_on instead
Example: 2015-12-24
last_activity_onString (date)Date of the last activity of the user. Updated by Git HTTP or SSH activity such as clone and push, signing in, visiting dashboard, project, issue, and merge request pages, and using the REST or GraphQL API
Example: 2015-12-24
usernameStringExample: johndoe

APIEntitiesUserAssociationsCount

PropertyTypeDescription
groups_countIntegerExample: 1
issues_countIntegerExample: 1
merge_requests_countIntegerExample: 1
projects_countIntegerExample: 1

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

APIEntitiesUserCounts

PropertyTypeDescription
assigned_issuesIntegerNumber of open issues assigned to the current user
Example: 10
assigned_merge_requestsIntegerNumber of active merge requests assigned to the current user
Example: 10
merge_requestsIntegerDeprecated. Use assigned_merge_requests instead
Example: 10
review_requested_merge_requestsIntegerNumber of open merge requests the current user is requested to review
Example: 10
todosIntegerNumber of pending to-do items for the current user
Example: 10

APIEntitiesUserCreditCardValidations

PropertyTypeDescription
credit_card_validated_atString (date-time)Example: 2025-01-01T00:00:00.000Z
user_idInteger (int64)Example: 1

APIEntitiesUserPreferences

PropertyTypeDescription
emoji_skin_toneIntegerExample: 0
idInteger (int64)Example: 1
mobile_push_working_daysArray of stringsExample: ["monday","tuesday","wednesday","thursday","friday"]
mobile_push_working_hours_enabledBooleanExample: true
mobile_push_working_hours_endIntegerExample: 1020
mobile_push_working_hours_startIntegerExample: 540
mobile_push_working_hours_time_zoneStringExample: Europe/Berlin
pass_user_identities_to_ci_jwtBoolean—
policy_advanced_editorBoolean—
show_whitespace_in_diffsBoolean—
user_idInteger (int64)Example: 1
view_diffs_file_by_fileBoolean—

APIEntitiesUserProfile

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
bioStringBiography of the user
bio_htmlStringExample: My <em>bio</em>.
botBoolean—
created_atString (date-time)Creation date and time of the user account in ISO 8601 format
custom_attributesArray of APIEntitiesCustomAttribute—
discordStringDiscord user ID of the user
followersString—
followingString—
githubStringGitHub username of the user
idInteger (int64)ID of the user
Example: 1
is_followedString—
job_titleStringJob title of the user
linkedinStringLinkedIn username of the user
local_timeString—
locationStringLocation of the user
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
organizationStringOrganization of the user
pronounsStringPronouns of the user
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
twitterStringTwitter username of the user
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root
website_urlStringWebsite of the user
work_informationString—

APIEntitiesUserPublic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
bioStringBiography of the user
botBoolean—
can_create_groupBooleanIf true, the user can create groups
Example: true
can_create_projectBooleanIf true, the user can create projects
Example: true
color_scheme_idIntegerColor scheme ID of the user
Example: 1
commit_emailString—
confirmed_atString (date-time)Confirmation date and time of the user in ISO 8601 format
Example: 2015-09-03T07:24:01.670Z
created_atString (date-time)Creation date and time of the user account in ISO 8601 format
current_sign_in_atString (date-time)Current sign-in date and time of the user in ISO 8601 format. Updated when the user signs in to GitLab, at most once an hour
Example: 2015-09-03T07:24:01.670Z
custom_attributesArray of APIEntitiesCustomAttribute—
discordStringDiscord user ID of the user
emailStringEmail address of the user
Example: john@example.com
externalBooleanIf true, the user is external
followersString—
followingString—
githubStringGitHub username of the user
idInteger (int64)ID of the user
Example: 1
identitiesArray of APIEntitiesIdentityIdentities associated with the user. An identity with the group_saml provider also has saml_provider_id
is_followedString—
job_titleStringJob title of the user
last_activity_onString (date-time)Last activity date of the user
Example: 2015-09-03T07:24:01.670Z
last_sign_in_atString (date-time)Last sign-in date and time of the user in ISO 8601 format
Example: 2015-09-03T07:24:01.670Z
linkedinStringLinkedIn username of the user
local_timeString—
locationStringLocation of the user
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
organizationStringOrganization of the user
preferred_languageStringExample: en
private_profileBooleanIf true, the user’s profile is private
Example: false
projects_limitIntegerProject limit of the user
Example: 10
pronounsStringPronouns of the user
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
theme_idIntegerTheme ID of the user
Example: 2
twitterStringTwitter username of the user
two_factor_enabledBooleanIf true, two-factor authentication is enabled for the user
Example: true
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root
website_urlStringWebsite of the user
work_informationString—

APIEntitiesUserStatus

PropertyTypeDescription
availabilityStringExample: busy
clear_status_atString (date-time)Example: 2026-10-28T10:00:00.000Z
emojiStringExample: coffee
messageStringExample: I crave coffee
message_htmlStringExample: <p dir="auto">I crave coffee</p>

APIEntitiesUserSupportPin

PropertyTypeDescription
expires_atString (date-time)The expiration time of the PIN
pinStringThe security PIN

APIEntitiesUserWithAdmin

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
bioStringBiography of the user
botBoolean—
can_create_groupBooleanIf true, the user can create groups
Example: true
can_create_projectBooleanIf true, the user can create projects
Example: true
color_scheme_idIntegerColor scheme ID of the user
Example: 1
commit_emailString—
confirmed_atString (date-time)Confirmation date and time of the user in ISO 8601 format
Example: 2015-09-03T07:24:01.670Z
created_atString (date-time)Creation date and time of the user account in ISO 8601 format
created_byAPIEntitiesUserBasicUser who created the account, when an administrator created it or it is a project bot user. null if the user registered the account themselves
current_sign_in_atString (date-time)Current sign-in date and time of the user in ISO 8601 format. Updated when the user signs in to GitLab, at most once an hour
Example: 2015-09-03T07:24:01.670Z
custom_attributesArray of APIEntitiesCustomAttribute—
discordStringDiscord user ID of the user
emailStringEmail address of the user
Example: john@example.com
externalBooleanIf true, the user is external
followersString—
followingString—
githubStringGitHub username of the user
idInteger (int64)ID of the user
Example: 1
identitiesArray of APIEntitiesIdentityIdentities associated with the user. An identity with the group_saml provider also has saml_provider_id
is_adminString—
is_followedString—
job_titleStringJob title of the user
last_activity_onString (date-time)Last activity date of the user
Example: 2015-09-03T07:24:01.670Z
last_sign_in_atString (date-time)Last sign-in date and time of the user in ISO 8601 format
Example: 2015-09-03T07:24:01.670Z
linkedinStringLinkedIn username of the user
local_timeString—
locationStringLocation of the user
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
namespace_idString—
noteString—
organizationStringOrganization of the user
preferred_languageStringExample: en
private_profileBooleanIf true, the user’s profile is private
Example: false
projects_limitIntegerProject limit of the user
Example: 10
pronounsStringPronouns of the user
provisioned_by_project_idIntegerID of the project that provisioned the user. Introduced in GitLab 19.3
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
theme_idIntegerTheme ID of the user
Example: 2
twitterStringTwitter username of the user
two_factor_enabledBooleanIf true, two-factor authentication is enabled for the user
Example: true
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root
website_urlStringWebsite of the user
work_informationString—