API document link:
We are getting the following error while calling the api and this error code is not specified in the api documentation .
{
"errors": [
{
"code": "ADMIN-401-2",
"status": "401",
"title": "INSUFFICIENT_SCOPE",
"detail": "Insufficient scope. Create a new API Key for your Organization https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/"
}
]
}
Also,
we had created a API key long back and the API worked for the old key. But when the same user created another API key , the API did not work with the new API key. And got the same above error.
Sumit, you are affected by this bug: https://jira.atlassian.com/browse/ID-8782
Atlassian said they will be rolling a fix by Friday, but no guarantees.
As @Florian Bonniec mentions, what are the permission on the user related to the API token?
This user, will need to have Org admin permission to use this API endpoint.
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.
401 is permission error. The token/account you use do not have enough permission.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey @Florian Bonniec , Where and how can we grant permission to the apiKey that is generated?
else how to generate token with correct permissions? because we are already org admin here when we created the api key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-groups/#api-group-groups
on the same docs, other apis like get events, get orgs are working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to create a token for this purpose with an account that have org admin permission.
Manage an organization with the admin APIs | Atlassian Support
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Florian Bonniec , the token was created with an org admins account itself. And as mentioned the api worked with an older apikey, but failed with an new apikey when created by the same user as previous.
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.