---
title: List tenant accounts
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Tenants](https://developers.cloudflare.com/api/python/resources/tenants)

[Accounts](https://developers.cloudflare.com/api/python/resources/tenants/subresources/accounts)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# List tenant accounts

tenants.accounts.list(strtenant\_id) -> SyncSinglePage\[[TenantAccount](<https://developers.cloudflare.com/api/python/resources/tenants#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)>)]

GET/tenants/{tenant\_id}/accounts

Lists the Cloudflare accounts associated with this 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:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### ParametersExpand Collapse

tenant\_id: str

[Link to this property](<#(resource)%20tenants.accounts%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20tenant_id%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class TenantAccount: …

</summary>

id: str

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_on: datetime

formatdate-time

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

name: Optional\[str]

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

settings: Settings

</summary>

abuse\_contact\_email: Optional\[str]

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20abuse_contact_email">Link to this property</a>

access\_approval\_expiry: Optional\[datetime]

formatdate-time

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20access_approval_expiry">Link to this property</a>

api\_access\_enabled: Optional\[bool]

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20api_access_enabled">Link to this property</a>

Deprecateddefault\_nameservers: Optional\[str]

Use <a href="https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings">DNS Settings</a> instead. Deprecated.

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20default_nameservers">Link to this property</a>

enforce\_twofactor: Optional\[bool]

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20enforce_twofactor">Link to this property</a>

Deprecateduse\_account\_custom\_ns\_by\_default: Optional\[bool]

Use <a href="https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings">DNS Settings</a> instead. Deprecated.

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings%20%3E%20(property)%20use_account_custom_ns_by_default">Link to this property</a>

</details>

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20settings">Link to this property</a>

<details>

<summary>

type: Literal\["standard", "enterprise"]

</summary>

One of the following:

"standard"

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

"enterprise"

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

tags: Optional\[Dict\[str, str]]

Account tags, present only when <code>include_tags=true</code> is requested.

<a href="#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

</details>

[Link to this property](<#(resource)%20tenants.accounts%20%3E%20(model)%20tenant_account%20%3E%20(schema)>)

### List tenant accounts

Python

HTTPTypeScriptPythonGoTerraform

```
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)
```

200 example

```
{
  "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",
      "tags": {
        "foo": "string"
      }
    }
  ],
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "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",
      "tags": {
        "foo": "string"
      }
    }
  ],
  "success": true
}
```