Introduction
If you want to see the complete list of the users on your CircleCI server installation, you can leverage the below API to query these details which include:
Username
VCS Login ID
Suspended User Flag
Creation Timestamp
Admin Permissions that are scoped
Total Sign-in count
Prerequisites:
CircleCI Server
Must be a Server admin to run this endpoint
Instructions
Use the following endpoint with your CircleCI instance URL to query:
https://$CIRCLE_HOSTNAME/api/v1/admin/users
Note: Do not include the app.* prefix in the endpoint
To further filter these results to isolate the usernames and names, this can be done using jq :
curl -H "Circle-Token: <admin-personal-api-token>" -s 'https://$CIRCLE_HOSTNAME/api/v1/admin/users' | jq '.[] | select(.suspended == false) | {name: .name, login: .login}'Outcome
It will show the user name, VCS login ID, suspended user flag, and a few other details as shown below:
[ {
"login" : "<user-id>",
"name" : "<user-name>",
"sign_in_count" : 1,
"basic_email_prefs" : "smart"
"created_at" : "2020-07-15T14:35:56.510Z",
"suspended": true,
"current_sign_in_at" : "2020-07-15T14:35:56.510Z",
"admin_scopes" : [ "none" ]
}, {
"login" : "<user-id>",
"name" : "<user-name>",
"sign_in_count" : 7,
"basic_email_prefs" : "smart"
"created_at" : "2020-02-25T14:45:56.785Z",
"suspended": false,
"current_sign_in_at" : "2020-07-31T17:50:12.316Z",
"admin_scopes" : [ "write-settings", "view-builds", "trigger-builds, "all, "status", "none" ]
} ]Additional Notes:
This is for Server Only and is not available on the cloud product