The REST API endpoint you’re interacting with is not for administering Jira Cloud user accounts, it is for administering managed user accounts within an entire Organization via the Cloud Admin APIs. The path to that endpoint does not start with https://xxxxx.atlassian.net/ but starts with https://api.atlassian.com/. This is stated on the About page of the documentation.
Also, I suggest that you read more about those endpoints, since they are reserved for use by Organization Administrators only and require a special API token to access. You cannot access those endpoints using your Jira Cloud Administrator user account. This is stated in the Manage an Organization with the admin APIs documentation.
and i have set this :
curl -k -u “mail-admin:api_token” -X GET “https://api.atlassian.com/users/id-user” -H “Accept: application/json” and i have this error :
The clue is the 401 status for Unauthorized. API Tokens for the Cloud Admin APIs are Bearer tokens, not Basic auth. You can’t use curl’s user (-u) option.
i have fix my command line and now i have this error , i think it’s same error no ?
{“key”:“forbidden”,“context”:“Error: Caller must be a verified org admin of targeted account or be the targeted account”,“errorKey”:“forbidden”,“errorDetail”:“Error: Caller must be a verified org admin of targeted account or be the targeted account”}
This is not the same error and it does tell us something different. I think the error message might be wrong though. I cannot access my own profile through this API, even if the error message makes it seem like I can.
Are you an org admin for your company? And have you claimed your domain and added an IdP? For more details see my prior similar post:
In addition to what @ibuchanan has said, I suggest you use the Get user management permissions endpoint first to know what permissions you have in respect to that user account. You simply might not have profile.read permissions, hence that error message you got when trying to read that user’s profile via the Get profile endpoint.
Also, use the Get managed accounts in an organization endpoint to find out whether or not that user’s account you are trying to administer is or isn’t a MANAGED account.
In closing, I VERY STRONGLY SUGGEST that you spend some time reading the documentation about these APIs and learn about what they are used for, how to use them and who should be using them, as it seems to me that you are mostly just making random guesses and the consequences of mis-using this APIs can be fairly dramatic.