Skip to content
Start here

List Organizations

Deprecated
user.organizations.list(OrganizationListParams**kwargs) -> SyncV4PagePaginationArray[Organization]
GET/user/organizations

Lists organizations the user is associated with.

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
Accepted Permissions (at least one required)
Memberships WriteMemberships Read
ParametersExpand Collapse
direction: Optional[Literal["asc", "desc"]]

Direction to order organizations.

One of the following:
"asc"
"desc"
match: Optional[Literal["any", "all"]]

Whether to match all search requirements or at least one (any).

One of the following:
"any"
"all"
name: Optional[str]

Organization name.

maxLength100
order: Optional[Literal["id", "name", "status"]]

Field to order organizations by.

One of the following:
"id"
"name"
"status"
page: Optional[float]

Page number of paginated results.

minimum1
per_page: Optional[float]

Number of organizations per page.

maximum50
minimum5
status: Optional[Literal["member", "invited"]]

Whether the user is a member of the organization or has an inivitation pending.

One of the following:
"member"
"invited"
ReturnsExpand Collapse
class Organization:
id: Optional[str]

Identifier

maxLength32
minLength32
name: Optional[str]

Organization name.

maxLength100
permissions: Optional[List[Permission]]

Access permissions for this User.

roles: Optional[List[str]]

List of roles that a user has within an organization.

status: Optional[Status]

Whether the user is a member of the organization or has an invitation pending.

One of the following:
"member"
"invited"

List Organizations

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.user.organizations.list()
page = page.result[0]
print(page.id)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Cloudflare, Inc.",
      "permissions": [
        "#zones:read"
      ],
      "roles": [
        "All Privileges - Super Administrator"
      ],
      "status": "member"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Cloudflare, Inc.",
      "permissions": [
        "#zones:read"
      ],
      "roles": [
        "All Privileges - Super Administrator"
      ],
      "status": "member"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}