Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting a full list of users across all products under a site with REST API

Andrey Popov September 2, 2021

Hello folks,

I'm wondering if there's a way to fetch all user accounts (managed and external) for a specific site via the REST API with at least their Atlassian userIDs and email addresses?

Atlassian Access provides a convenient way of doing this through the exporter and even lets me select what information I want to see, however, we have about a dozen sites within our org and ideally, we'd like to automate this process.

I realize that I can get a complete list of user accounts managed by our 1 central org with single export within Atlassian Access, however, this type of export excludes users that are not managed by our org. I need all accounts and not just the managed ones and as far as I know, there isn't a good way to do this. 

Is there something I'm missing here?

Thank you,

Andrey

1 answer

1 accepted

3 votes
Answer accepted
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2021

Hello @Andrey Popov,

Thank you for reaching out to Atlassian Community!

Searching on our documentation and some similar cases, I’m afraid to say that it’s not possible to get all users from different sites using one endpoint. 

With the API below, you can get all managed accounts from an Organization:

- https://developer.atlassian.com/cloud/admin/organization/rest/api-group-orgs/#api-orgs-orgid-users-get

curl --request GET \ 
--url 'https://api.atlassian.com/admin/v1/orgs/{orgId}/users' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'

Then, to get users from different sites, it will be necessary to use the API below for each one:

 - https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-rest-api-2-users-search-get

curl --request GET \ 
--url 'https://your-domain.atlassian.net/rest/api/2/users/search' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'

Note that, the Get all users API will only return their email addresses if they set the permission to “Anyone” on their profile on https://id.atlassian.com/manage-profile/profile-and-visibility, so to be honest, the best option would be to use the “Export users” on User management.

Kind regards,
Angélica

Dave Meyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2021

We do have plans to address the API gaps in this area. We'll provide updates on this feature request: https://jira.atlassian.com/browse/ID-6965

Like # people like this
Andrey Popov September 7, 2021

Thank you @Angélica Luz and @Dave Meyer - it's encouraging to hear that the API expansion is in the works. Can you please help me better understand if there's a specific threshold (ex: number of votes) that a feature request must exceed in order for the product team to move forward with development? 

Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2021

Hi Andrey,

There are many factors that are taken into consideration when implementing a new feature. 

For more information, please check our policy below:

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events