List tenant accounts
tenants.accounts.list(strtenant_id) -> SyncSinglePage[TenantAccount]
GET/tenants/{tenant_id}/accounts
List of accounts for the Tenant.
Security
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
List tenant accounts
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted
api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted
)
page = client.tenants.accounts.list(
"tenant_id",
)
page = page.result[0]
print(page.id){
"errors": [],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "id",
"created_on": "2019-12-27T18:11:19.117Z",
"name": "name",
"settings": {
"abuse_contact_email": "abuse_contact_email",
"access_approval_expiry": "2019-12-27T18:11:19.117Z",
"api_access_enabled": true,
"default_nameservers": "default_nameservers",
"enforce_twofactor": true,
"use_account_custom_ns_by_default": true
},
"type": "standard"
}
],
"success": true
}Returns Examples
{
"errors": [],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "id",
"created_on": "2019-12-27T18:11:19.117Z",
"name": "name",
"settings": {
"abuse_contact_email": "abuse_contact_email",
"access_approval_expiry": "2019-12-27T18:11:19.117Z",
"api_access_enabled": true,
"default_nameservers": "default_nameservers",
"enforce_twofactor": true,
"use_account_custom_ns_by_default": true
},
"type": "standard"
}
],
"success": true
}