List a member's tenant access within an environment
curl --request GET \
--url https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"environment": "US-3",
"tenants": [
{
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "acme-development-tenant.us.auth0.com",
"roles": [
{
"role": "owner",
"client_ids": [
"App-A",
"App-B"
]
}
]
}
]
}{
"status": 400,
"type": "VALIDATION_ERROR",
"title": "Invalid payload"
}{
"status": 401,
"type": "UNAUTHORIZED",
"title": "Unauthorized"
}{
"status": 403,
"type": "TENANT_LIMIT_REACHED",
"title": "You have reached the limit for tenants in your current plan"
}{
"status": 404,
"type": "TENANT_NOT_FOUND",
"title": "The tenant was not found"
}{
"status": 429,
"type": "TOO_MANY_REQUESTS",
"title": "Too many requests"
}{
"status": 500,
"type": "UNKNOWN_ERROR",
"title": "An unknown error occurred"
}This endpoint retrieves a list of all tenants within a specific environment that the team member has access to. Environment identifiers required for this request can be obtained using the /api/environments endpoint, which provides details for all environments where tenants associated with your team exists.
GET
https://{teamSlug}.teams.auth0.com
/
api
/
members
/
{id}
/
tenants
/
{environment}
List a member's tenant access within an environment
curl --request GET \
--url https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{teamSlug}.teams.auth0.com/api/members/{id}/tenants/{environment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"environment": "US-3",
"tenants": [
{
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "acme-development-tenant.us.auth0.com",
"roles": [
{
"role": "owner",
"client_ids": [
"App-A",
"App-B"
]
}
]
}
]
}{
"status": 400,
"type": "VALIDATION_ERROR",
"title": "Invalid payload"
}{
"status": 401,
"type": "UNAUTHORIZED",
"title": "Unauthorized"
}{
"status": 403,
"type": "TENANT_LIMIT_REACHED",
"title": "You have reached the limit for tenants in your current plan"
}{
"status": 404,
"type": "TENANT_NOT_FOUND",
"title": "The tenant was not found"
}{
"status": 429,
"type": "TOO_MANY_REQUESTS",
"title": "Too many requests"
}{
"status": 500,
"type": "UNKNOWN_ERROR",
"title": "An unknown error occurred"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique ID of the team member.
The cloud environment identifier (e.g. 'US-3', 'EU-1', 'acme-dev').
Minimum string length:
1Was this page helpful?