Forums

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

OAuth 2.0: “Unauthorized; scope does not match” when calling Confluence API

Danu PMS
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2025

I’m building an OAuth 2.0 app and have added all the necessary scopes. However, when I try to call the Confluence API, I get a 401 error:

{
    "code": 401,
    "message": "Unauthorized; scope does not match"
}

Here are the scopes I’ve granted:

"scopes": [
    "read:confluence-content.all",
    "read:confluence-content.permission",
    "read:confluence-content.summary",
    "read:confluence-groups",
    "read:confluence-space.summary",
    "read:confluence-user"
]

And here’s my API call:

curl --location 'https://api.atlassian.com/ex/confluence/<cloudid>/wiki/api/v2/spaces?limit=20' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'

The <cloudid> is correct and matches the account for which the scopes are granted.

These are the Scopes given at the time of Authorization (init)

const scope =
    'read:confluence-content.all ' +  
    'read:space-details:confluence ' +
    'read:space:confluence ' +
    'read:confluence-space ' +   
    'read:confluence-content.summary ' +   
    'read:confluence-space.summary ' +     
    'read:confluence-content.props ' +      
    'read:confluence-content.permission ' +
    'read:confluence-user ' +             
    'read:confluence-groups ' +        
    'offline_access';                   
   

Has anyone faced this issue before? How can I resolve the “scope does not match” error for this API endpoint?

1 answer

0 votes
Benjamin
Community Champion
August 21, 2025

HI @Danu PMS ,

 

Might want to try process of elimination. Try adding all the classic scopes and see if it gets you moving forward, and gradually remove each one and see any changes. 

 

Although, you might be facing this error like this post:

 

https://community.atlassian.com/forums/Jira-questions/Getting-401-error-on-calling-rest-api-2-search-via-oauth/qaq-p/2640846

 

 

Suggest an answer

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

Atlassian Community Events