Where is my user ID in GitLab.com?

When calling GitLab.com’s Add a member to a group or project API to add an user as the member to a project, the user ID (integer) must be provided. Where can GitLab.com users get their user ID’s?

I can not find mine here and here.

2 Likes

Hi,

Try opening your browser and going to this URL:

 https://gitlab.com/api/v4/users?username=YOUR_USERNAME

where YOUR_USERNAME is your username.

:point_right: This will only work if you are already logged into GitLab.

Alternatively,

  1. Go to https://gitlab.com/profile/account

  2. Copy your Personal Access Token.

  3. Run the following command from a terminal:

    curl --header "PRIVATE-TOKEN: TTTT" https://gitlab.com/api/v4/users?username=YOUR_USERNAME
    

where TTTT is your private token and YOUR_USERNAME is your username.

Éibhear

5 Likes

Thank you a lot!

It will be nice to see this instruction be added to FAQ.

1 Like