Get list of organization from azure devops [Microsoft Account]

Shivampatel
2 min readDec 14, 2023

--

Answer of this is also present in Question no 2 in the Following article.

Azure Devops Rest API.

Get list of organization from azure devops.

→ To get list of organization, you have to do 3 steps.

step 1 :- Login to microsoft azure account, you are able to view organization list on the left panel.

→ To get that organization list using API call, first you need to generate access token.

→ To generate access token, go to settings (left side of your profile icon present on top right corner), personal access token -> new token

→ Give any name of token and select — all accessible organization and then generat the token.

step 2 :- Get microsoft account id from the following GET API call from postman as show below in image.

→ Note :- In Authorization tab, select Basic Auth and enter azure devops user id in username and pass the generated access token in password.

https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=6.0

step 3 :- Call the following API to get list of organization.

https://app.vssps.visualstudio.com/_apis/accounts?memberId={id}&api-version=6.0

Here {id} — copy the id get from the first api response.

--

--