Skip to content

Get the tenants the signed-in principal belongs to

GET
/api/tenant/{tenantId}/Users/me/tenants
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.

tenantId
required
string format: uuid

Your tenant id.

OK

Media typeapplication/json
object
fields
object
key
additional properties
string
data
object
isPlatformAdministrator
required
boolean
canCreateTenants
boolean
tenants
required
Array<object>
nullable
object
tenantId
required
string format: uuid
name
required
string
nullable
uniqueName
required
string
nullable
logoId
string format: uuid
nullable
isHome
required
boolean
roles
required
Array<object>
nullable
object
roleDefinitionId
required
string format: uuid
roleName
required
string
nullable
scope
required
object
level
required
string
nullable
organizationId
string format: uuid
nullable
resourceGroupId
string format: uuid
nullable

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.

Media typeapplication/json

An RFC 9457 problem.

object
detail
string
nullable
instance
string
nullable
status
integer format: int32
nullable
title
string
nullable
type
string
nullable
key
additional properties

Example generated

{
"detail": "example",
"instance": "example",
"status": 1,
"title": "example",
"type": "example"
}