How to retrieve complete user list using JIRA REST API

I’m working on a Java application and need to fetch the entire user base from our JIRA instance via REST API. My goal is to store this user information in my local database for further processing.

Can this be accomplished through the available API endpoints?

I’ve been looking through the documentation but want to make sure I’m taking the right approach. What would be the best method to pull all user accounts from JIRA and handle the data transfer to my database? Are there any limitations or specific endpoints I should be aware of when dealing with bulk user data extraction?

Any guidance on the implementation would be really helpful.

The /rest/api/2/users/search endpoint is what you’re looking for, but there’s a catch with pagination you need to handle properly. JIRA limits results to 1000 users per request, so you’ll need to implement a loop with startAt and maxResults parameters to fetch all users incrementally. I ran into performance issues when I tried this on a large instance with 10k+ users - the API calls became quite slow after the first few thousand records. Make sure to add some delay between requests to avoid hitting rate limits. Also worth noting that you’ll need admin permissions to access the full user list, and some user data might be restricted depending on your JIRA configuration. Consider running this during off-peak hours since it can put some load on the JIRA instance.

just a heads up - i’ve done something similar and ran into issues with the api timing out on larger batches. ended up using /rest/api/2/user/picker with smaller chunks instead, worked way better for me. also dont forget to handle the 401 errors properly when users get deleted mid-process, really messed up my import the first time!

You can definitely pull the complete user list, but be prepared for some gotchas beyond just the pagination aspect. The /rest/api/2/user/search endpoint works well, though I found using an empty query parameter or a wildcard search gives you broader results than the users/search endpoint mentioned earlier. One thing that caught me off guard was dealing with deactivated users - by default the API excludes them, so you might want to include the includeInactive=true parameter if you need historical user data for your database. Also watch out for the response format - some fields like email addresses might be null depending on privacy settings and user permissions. I’d recommend doing a small test batch first to see what data structure you actually get back, then build your database schema accordingly. The transfer to your local database should be straightforward once you handle the pagination loop properly.