Search code examples
gitlabgitlab-omnibusgitlab-api

Using GitLab API, how do I get a list of active users?


Gitlab-CE v8.14.3

I'm reading the GitLAB API docs, and am trying to get the list of active users. I'm an admin and created a personal token. I do this

$ curl -XGET "Private-Token: kfjakjfkjkd" https://company.domain.com/api/v3/users?active=true

and keep getting 401 (Unauthorized) error. Like I said, I'm an admin. What gives?


Solution

  • You need to specify that Private-Token: kfjakjfkjkd is an HTTP header with -H :

    curl -H "Private-Token: kfjakjfkjkd" https://company.domain.com/api/v4/users?active=true