Hello,
I have been trying to implement a feature where we can suspend our organization users with the help of an API but i can’t get past this error im facing. Im complying (i think) everything in the documentation and consulted several AI tools but not been able to get a reasonable conclusion on why I am getting this error:
Documentation im applying:
Retrieving the users account_id by this > Suspend user access
Suspending the user by this > Suspend user access (same page of the first just downwards)
I am using the following variables as a input for the commands:
ORG_API_KEY="org api key"
ORG_ID="id generated when generating my organization api"
JIRA_API_TOKEN="redacted"
JIRA_ADMIN_EMAIL="myadminemail@invent.ai"
JIRA_URL="https://mydomain.atlassian.net"
ACCOUNT_ID="account id of the user i want to suspend"
The suspend command:
curl --request POST --url "https://api.atlassian.com/admin/v1/orgs/$ORG_ID/users/$ACCOUNT_ID/suspend-access" --user "$ADMIN_EMAIL:$ORG_API_KEY" --header "Accept: application/json" --header "Content-Type: application/json"
Result:
{"code":401,"message":"Unauthorized"}
I can confirm the organization id & account id from above variables are correct because when i manually open the admin portal and navigate to the user from Directory > Users, both ids appears in the url link.
My account is already an admin and i have no trouble accessing the organization admin panel (Was able to create the org api key hence).
What am i missing here? I also increased the verbosity via curl -v and noticed this additionally:
x-failure-category: FAILURE_CLIENT_AUTH_MISMATCH
I think relates to authentication bearer with a basic whereas it requests OAuth 2.0 token but i havent seen anything related to this in the documentation so im not entirely sure.
Would appreciate any insights i can get, thank you.

