Get the tenants the signed-in principal belongs to
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.nimles.com/identity/api/tenant/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/Users/me/tenants"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://api.nimles.com/identity/api/tenant/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/Users/me/tenants';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nimles.com/identity/api/tenant/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/Users/me/tenants \ --header 'Authorization: Bearer <token>'Gets the tenants the signed-in principal belongs to: its home tenant (the tenant its token was issued in) and
every tenant where it holds a role assignment, directly or through a group, with its roles there. Callable
without a tenant (api/Users/me/tenants) or with any tenant in the route, which does not change the
answer: only the token’s subject and issuer count. A platform administrator gets the same list, flagged
Nimles.Identity.Contract.Models.User.MyTenantsModel.IsPlatformAdministrator; every tenant is in the unscoped GET Tenants.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Your tenant id.
Responses
Section titled “Responses”OK
object
object
object
object
object
object
Example generated
{ "data": { "isPlatformAdministrator": true, "canCreateTenants": true, "tenants": [ { "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "uniqueName": "example", "logoId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "isHome": true, "roles": [ { "roleDefinitionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "roleName": "example", "scope": { "level": "example", "organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "resourceGroupId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } } ] } ] }}Unauthorized: no bearer token, or one that is expired or not for this API.
Forbidden: the caller holds no role that allows this action at this scope. The body is empty, or a problem whose detail names the action.
An RFC 9457 problem.
object
Example generated
{ "detail": "example", "instance": "example", "status": 1, "title": "example", "type": "example"}