Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a Scoped API key for user query

Wood_ Jeremy September 19, 2025

I am working on following the below guide to map users jira accounts to an asset.

Mapping Azure AD (Entra ID) Users with Jira Users and Jira Groups - Web Site - Confluence

 

One of the first steps is to use a Get web request to Jira API to lookup the users Jira account ID. If i create an API key with no scope this works great. But when i try it with a API key with the scope read:jira-user i get no results on the web request.

 

I'm an org admin so creating an API key with all of my rights is a little worrisome. I would much rather create one with just read access. 

 

Am i using the wrong scope or any ideas what i might be doing wrong here? 

 

2 answers

0 votes
Harpreet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2025
Hello @Wood_ Jeremy ,
Try this URL -> 
https://api.atlassian.net/ex/jira/<cloud-id>/rest/api/3/search/jql?jql="YOUR_JQL_QUERY"

 

Permissions are required for OAuth 2.0 scopes required:

Classic :read:jira-work
Granular:  
read:issue-details:jira
read:audit-log:jira
read:avatar:jira
read:field-configuration:jira
read:issue-meta:jira
Hope this helps.
Wood_ Jeremy September 20, 2025

Hi Harpeet. It looks like you are correct. I'm using the wrong URL. Can you please see my reply to Marc asking for some more information on the different URL? 

Harpreet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2025

Hello @Wood_ Jeremy

The correct URL is below

https://api.atlassian.com/ex/jira/<your-cloud-id>/rest/api/3/user/search?query=email-address

  • /rest/api/2/: This refers to version 2 of the Jira REST API. It is the older version and has been around for quite some time.

  • /rest/api/3/: This refers to version 3 of the Jira REST API, which is the newer version introduced.

Permissions are required for Oauth2.0 required shared below:
Classic
read:jira-user

Granular
read:user:jira
read:user.property:jira
read:application-role:jira
read:avatar:jira
read:group:jira

Refer this DOC-> 
Find user 
0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2025

Hi @Wood_ Jeremy 

What is the API you are making?

Unscoped Token
https://<yourdomain>/atlassian.net/rest/api/3/search/jql

Scoped Token
https://api.atlassian.com/ex/jira/<cloudid>/rest/api/3/search/jql

Wood_ Jeremy September 20, 2025

Hi Marc, 

From you reply it sounds like i may have the wrong URL then. Doing some more digging into this i do see where Atlassian requires a different URL for scoped keys. But I'm a bit confused on how i would use the new URL for a user Query. 

 

Does the /2 vs the /3 after API in the URL make a difference? 

 


Here is what the guide instructed:
Send a GET web request to Jira API using the URL:

https://your-site-name.atlassian.net/rest/api/2/user/search?query={{object."E-mail Address"}}

 


Based on the new URL would this then be the correct version for a scoped API key?

https://api.atlassian.com/ex/jira/<cloudid>/rest/api/2/user/search?query={{object."E-mail Address"}}
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2025

Hi @Wood_ Jeremy 

Yes, but I would suggest to use the API v3.

https://api.atlassian.com/ex/jira/<cloudId>/api/3/user/search?query={{object."E-mail Address"}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events