Api for getting accountId from organization

Hi,
There are any way to find account on organization by email?
I found this endpoint
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v1-orgs-orgid-users-get
but seems like this endpoint doesn’t has any filtering, just need to loop through all users, it’s not a problem when in your org like 50-100 users, but what about a few thousands…

Welcome to the Atlassian developer community @KyryloFilipenkov1,

Using the Jira API instead of Cloud Admin, you can search users with GET /rest/api/3/user/search. The query parameter specifies:

A query string that is matched against user attributes ( displayName, and emailAddress) to find relevant users. The string can match the prefix of the attribute’s value. For example, query=john matches a user with a displayName of John Smith and a user with an emailAddress of johnson@example.com. Required, unless accountId or property is specified.

Following the example above, you should be able to GET /rest/api/3/user/search?query=johnson@example.com and find a specific user, and accountId is 1 of the fields in the response.

Or, is there a reason you need to use the platform capability in Cloud Admin?

Hi,
Thanks for your response.
That api is working fine when user is in site, but what about organizational user search ?
For example user was removed from our site but in the directory this account is still active.

Hi there,

Yes, there are a few ways to find an account on an organization by email. One way is to use the API endpoint you mentioned. However, as you mentioned, this endpoint does not have any filtering, so you would need to loop through all of the users in the organization. This could be time-consuming if there are a large number of users.

Another way to find an account by email is to use the Google Admin console. You can search for users by email address, and you can also filter the results by organization. OR you can find help to manage your users. This is a more efficient way to find an account if you know the email address of the user you are looking for.

I hope this helps! Let me know if you have any other questions.

Hi,
I guess that I need to clarify some details, we don’t use google directory, we are using own manage domain as well.

Ohh I seee. If you are not using Google Directory, then use a third-party tool. There are a number of tools available, such as Hunter.io, that can help you find email addresses and other information about employees of a particular organization. Hopefully it solves.

This is not a third party tool, this is atlassian solution, we just added our domain @intellias.com as managed domain and we want to manage accounts through organization.
So my question is, do we have any API to find accountId in organization?
When I say accountId I mean Atlassian accountId.

Hi Kyrylo,

I understand that you are looking for an API to find the account ID in an organization by email address. The Atlassian Cloud Organizations REST API does have an endpoint that can be used for this purpose. The endpoint is GET /api/v1/orgs/{orgId}/users. You can pass the email address of the user you are looking for in the query parameter. The response will include the account ID of the user, if they are a member of the organization. This how we do user management. I can share the commands if you want.

I hope this helps! Let me know if you have any other questions.

Best regards,
Rehes