Hello Jai Garg, as discussed, the API https://app.vssps.visualstudio.com/_apis/accounts?memberId=<id> is intended to be used in a user context, specifically with a user Object ID (OID) from Azure AD (Entra). When using the client credentials flow with a service principal, this endpoint doesn't return the expected results because service principals aren't treated the same way as users in this context.
If your goal is to list Azure DevOps organizations for an identity, the supported way is to use the OAuth2 Authorization Code flow with a real user account. Alternatively, for testing purposes, you can use a Personal Access Token (PAT) tied to a user, which works reliably with this API.
As of now, there's no public API that supports listing organizations for a service principal via the client credentials flow. The service principal can still be used to access specific Azure DevOps organizations it’s been added to, but discovering all accessible orgs programmatically isn't supported in this flow.