Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi!
I tried to do smth like confluence/rest/api/user?username=a and username=* and some other cases but it shows an error
No user found with key : null
so is the key the must parameter?
and is there a wildcard for any parameter so I could get the list of all users
or any other way I could do it?
any help would be really appreciated
Hi!
The documentation mentions that a parameter is required and there is no known wildcard option. That being said, the usual trick I use is to query the confluence-users group members which list all users having access:
/rest/api/group/confluence-users/member
You can also create a group with all users even unlicensed and use the same endpoint.
Feels like a workaround but it's working well!
Hope it helps!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @mzhydenko,
Have you tried adding ?limit=500 to get more results?
Also, the group name in the URL is the group you're browsing, are non-admin users members of this group? Just tried it locally and it worked well :(
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great!
Keep us posted!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me, thank you so much!
I did want to point out though that confluence-users is the default user group that gets some one access, but it could be something else if configured so. for instance, my company uses the group atlassian-users to grant access to Confluence, JIRA, and BitBucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And this is why the accepted answer should not be accepted.
The suggested answer only returns licensed users, not all users.
Edit:
In fact it will return both active and disabled users. But only active users will count as licensed users. My point was that you may have users without any groups. They will not be included and there is no other way to get them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI:
In case anyone might want to spend an extra buck on a plugin/app, I have successfully managed to export all users (also over 1000 users) using the API for Techtime User Management for Jira/Confluence.
Since it allows you to get all users you can also iterate over each user and do whatever you want with it. That is, if you know some programming of course.
https://marketplace.atlassian.com/apps/1215285/
https://techtime.co.nz/display/TECHTIME/User+Management+-+Retrieve+Group+Membership+using+REST+API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I thought I'd update this with my Python code as it seems the API has changed:
You will need to have an API token to run this. You will also need to know the group name.
def getGroupMembers(self, strGrpName):
#group/member?name={name}
strAuth = "Basic YOUR BASE64ENCODED CREDENTIALS AND TOKEN"
strURL = (f'https://xxxxxx.atlassian.net/wiki/rest/api/group/member?name={strGrpName}')
strConfHeaders = {'Authorization': strAuth, 'Content-Type': 'application/json'}
response = requests.get(strURL, headers=strConfHeaders)
if response.status_code == 200:
return {"success":True, "data":response.json()}
elif response.status_code > 200:
return {"success":False, "msg":"There was an error with your requests: \n\n" + "Status Code: " + str(response.status_code) + "\nURL: " + strURL}
Use:
dictMemberResults = getGroupMembers(A-GROUP-NAME)
if dictMemberResults["success"] == True:
lstUsers = dictMemberResults["data"]["results"]
for thisUser in lstUsers:
if thisUser["displayName"] == A-USER-NAME:
return thisUser
else:
print(dictMemberResults["msg"])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know I'm a bit late to the party but you future reference. There is one more way to get a list of all users without specifying the limi by making a get request to the following end point:
http://localhost:1990/confluence/rest/user-management/1.0/users
This will return you all the users. I hope this helps :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it helps !
It works file with Jira Server v8.5.
Thank you for this trick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will be surprised if the end point worked for Jira as I mentioned, this endpoint is for confluence, having said that I haven't tried it for Jira. Just to reconfirm, it did work for you when you tried it for Jira and not confluence, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried that URL, but got a 401 - Unauthorized response on a server where I am not admin. Probably it is meant - as the name suggests - for user management, and that needs the user to be admin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can only access the Users page if you are a system admin hence, it will only work if you're the admin of the instance. If you try it with the admin user, it will work. Normal users cannot access the 'Users' page in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.