Skip to content
Start here

List organization accounts

GET/organizations/{organization_id}/accounts

Retrieve the accounts immediately attached to a specific organization. Accounts attached to sub-organizations are not included. Use page_token and page_size for cursor pagination, or provide page and per_page together for legacy offset pagination. Cursor pagination takes precedence when requested. The default response uses Account fields; Accept: application/json; legacy=true requests the LegacyAccount representation.

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
Path ParametersExpand Collapse
organization_id: string
Query ParametersExpand Collapse
account_pubname: optional object { contains, endsWith, startsWith }
contains: optional string

(case-insensitive) Filter the list of accounts to where the account_pubname contains a particular string.

endsWith: optional string

(case-insensitive) Filter the list of accounts to where the account_pubname ends with a particular string.

startsWith: optional string

(case-insensitive) Filter the list of accounts to where the account_pubname starts with a particular string.

direction: optional "asc" or "desc"

Sort direction for the order_by field. Valid values: asc, desc. Defaults to asc when order_by is specified.

One of the following:
"asc"
"desc"
include_tags: optional boolean

Include Account tags from the resource tag mirror. Omit this parameter to preserve the existing Account response shape.

include_total: optional boolean

Whether to calculate and return the exact result_info.total_size for cursor pagination. Defaults to true. When false, total_size is omitted. page_size and include_total may change between pages; next_page_token remains the authoritative continuation signal. Legacy page/per_page requests always calculate total_count.

name: optional object { contains, endsWith, startsWith }
contains: optional string

(case-insensitive) Filter the list of accounts to where the name contains a particular string.

endsWith: optional string

(case-insensitive) Filter the list of accounts to where the name ends with a particular string.

startsWith: optional string

(case-insensitive) Filter the list of accounts to where the name starts with a particular string.

order_by: optional "account_name"

Field to order results by. Currently supported values: account_name.

page: optional number

Legacy offset page number. Must be provided with per_page. Values below 1 are treated as

  1. Cursor pagination takes precedence when requested.
page_size: optional number

The amount of items to return. Defaults to 10.

maximum1000
minimum0
page_token: optional string

An opaque token returned from the last list response that when provided will retrieve the next page.

Parameters used to filter the retrieved list must remain in subsequent requests with a page token.

per_page: optional number

Legacy offset page size. Must be provided with page. Values are clamped to the range 1-100. Cursor pagination takes precedence when requested.

status: optional "active" or "deleted"

Filter accounts by lifecycle status. Defaults to active.

One of the following:
"active"
"deleted"
Header ParametersExpand Collapse
Accept: optional string
ReturnsExpand Collapse
errors: array of unknown
messages: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
result: array of TenantAccount { id, created_on, name, 3 more } or object { account_pubname, account_tag, account_type, 2 more }
One of the following:
TenantAccount object { id, created_on, name, 3 more }
id: string
created_on: string
formatdate-time
name: string
settings: object { abuse_contact_email, access_approval_expiry, api_access_enabled, 3 more }
abuse_contact_email: string
access_approval_expiry: string
formatdate-time
api_access_enabled: boolean
Deprecateddefault_nameservers: string

Use DNS Settings instead. Deprecated.

enforce_twofactor: boolean
Deprecateduse_account_custom_ns_by_default: boolean

Use DNS Settings instead. Deprecated.

type: "standard" or "enterprise"
One of the following:
"standard"
"enterprise"
tags: optional map[string]

Account tags, present only when include_tags=true is requested.

OrganizationsAPILegacyAccount object { account_pubname, account_tag, account_type, 2 more }
account_pubname: string
account_tag: string
account_type: "standard" or "enterprise"
One of the following:
"standard"
"enterprise"
created_on: string
formatdate-time
settings: object { access_approval_expiry, api_access_enabled, enforce_two_factor, use_account_custom_ns_by_default }
access_approval_expiry: string
formatdate-time
api_access_enabled: boolean
enforce_two_factor: boolean
use_account_custom_ns_by_default: boolean
result_info: object { next_page_token, total_size } or object { count, page, per_page, total_count }
One of the following:
OrganizationsAPIPageTokenResultInfo object { next_page_token, total_size }
next_page_token: optional string

Use this opaque token in the next request to retrieve the next page.

Parameters used to filter the retrieved list must remain in subsequent requests with a page token.

total_size: optional number

Counts the total amount of items in a list with the applied filters. The API omits next_page_token to indicate no more items in a particular list.

OrganizationsAPILegacyPaginationResultInfo object { count, page, per_page, total_count }
count: number
page: number
per_page: number
total_count: number
success: true

List organization accounts

curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/accounts \
    -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
    -H "X-Auth-Key: $CLOUDFLARE_API_KEY"
{
  "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"
      }
    }
  ],
  "result_info": {
    "next_page_token": "next_page_token",
    "total_size": 0
  },
  "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",
      "tags": {
        "foo": "string"
      }
    }
  ],
  "result_info": {
    "next_page_token": "next_page_token",
    "total_size": 0
  },
  "success": true
}