Atlassian uses the concept of the Atlassian Account ID (often shortned to AAID) as the unique identifier of a user on a cloud product.
From time to time, you might need to retrieve this ID for yourself or for a few users.
This step-by-step guide shows you how to find the Atlassian Account ID in different scenarios for Bitbucket cloud (bitbucket.org).
Get my own user AAID
The fastest way
Enter go.atlassian.com/aaid in the browser with an active session and look for the `account_id` in the response:
The UI option way
From the Bitbucket user interface, click on the cog icon and select Atlassian account settings:
This opens the https://id.atlassian.com/manage-profile/profile-and-visibility page.
When inspecting the browser Developer Tools, you’ll see a request to the
https://id.atlassian.com/gateway/api/me endpoint.
In its response, you’ll see the account_id field which is your user Atlassian Account ID.
REST API endpoint to retrieve the AAID of all members of a workspace
The members endpoint is a public and supported endpoint that can be used to retrieve the AAIDs of all members in a workspace.
If you are logged in to a browser session, you can simply access the values directly by entering the https://bitbucket.org/!api/2.0/workspaces/<workspace_name>/members URL.
Rest API endpoint to retrieve the AAID of specific members given their email address
The members endpoint public endpoint supports filtering by email address. This option is great when there is a need to reconcile or link user information from external systems (e.g. automations and itegrations) which usually identify users via their email.
You can try this endpoint out in a browser with an active session via the https://bitbucket.org/!api/2.0/workspaces/<workspace_name>/members?q=user.email IN ("user1@org.com","user2@org.com") URL.
Retrieve the AAIDs of the members of a workspace
The User directory page available to the workspace admins can be used to retrieve the Atlassian Account IDs of the workspace members.
From a workspace you have admin permissions, click on Workspace settings and then on User directory:
A page will open showing the list of users. In the browser Developer Tools, there will be a paginated request to the https://bitbucket.org/!api/internal/workspaces/<workspaceid>/members?page=N endpoint.
The response contains the AAIDs of all shown users in the account_id field for each one of the values:
FYI: When logged in with the Bitbucket account, you can enter the urls of the endpoints directly in the browser address bar and the results will be shown directly in the browser without the need to navigate to the pages.
However, since these APIs are not publicly available and, as a result, they can change without any notice, I wanted to share how to retrieve these information from the UI directly.
How do I use AAIDs?
If you are wondering why I might need to retrieve users' AAID, here is the answer:
I built an app to assign PRs randomly to a specific list of users.
You can run it to (or just check it out) by reading this article:
Assign PRs randomly to a specific list of users in Bitbucket Cloud
Caterina Curti
Developer Advocate
Sydney
109 accepted answers
0 comments