My goal is to retrieve the syncrhonized user data like “Department” and “Title” to display in issues, and I think I need to use Automation to call the SCIM API to read those data.
First, a point of correction. SCIM APIs are not “for this site” they are “for this organization”. The reason this matters is that sites and organizations are different sets of users. A site might have only users from an organization, but that is not strictly true in all cases. Many of our customers have sites with users from outside their own managed organization.
If you are always getting 401, it’s likely a problem with your API key. A common confusion is admin API keys with the common API tokens for accessing the Jira REST API. Those are not the same. The API token you obtain from your user profile will not work. You must obtain a token from the organization admin screen. To generate the admin API key, follow these instructions:
(At time of writing, the admin API docs about auth navigate to the org admin pages correctly but don’t navigate to the API key section correctly. Close, but not entirely accurate.)
I just generated a new admin API key and it works correctly for me.