Portal Community

zone/list

List all Cloudflare zones accessible to the configured API Token.

When to Use

Configuration

Connection

FieldTypeRequiredDescription
ApiTokenstringrequiredScoped Cloudflare API Token. Requires Zone.Read permission. Store in BizFirst Credentials Manager — never hardcode.

Operation Fields

This operation takes no additional fields. The API Token scope determines which zones are returned.

Sample Configuration

{
  "resource": "zone",
  "operation": "list",
  "connection": {
    "ApiToken": "{{ $credentials.cloudflare_readonly }}"
  }
}

Validation Errors

CodeConditionResolution
MISSING_API_TOKENApiToken is empty or not configuredSet the ApiToken credential in the connection panel
UNKNOWN_ERRORCloudflare API returned an unexpected errorCheck error port output for Cloudflare error codes and messages

Output

Success Port

FieldTypeDescription
zonesarrayArray of zone objects accessible to the API Token
zones[].idstring32-character hex Zone ID used in all other operations
zones[].namestringDomain name (e.g., example.com)
zones[].statusstringZone status: active, pending, initializing, moved, or deleted
zones[].nameserversarrayCloudflare nameservers assigned to this zone
zones[].planobjectCurrent plan details including name (Free, Pro, Business, Enterprise)
zones[].typestringZone type: full, partial, or secondary
zones[].activatedOnstringISO 8601 timestamp when the zone became active

Error Port

On failure the error port receives an object with code (error code string) and message (human-readable description).

Sample Output

{
  "zones": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "example.com",
      "status": "active",
      "nameservers": ["alice.ns.cloudflare.com", "bob.ns.cloudflare.com"],
      "plan": { "name": "Pro" },
      "type": "full",
      "activatedOn": "2024-01-15T10:30:00Z"
    },
    {
      "id": "7c5dae5552338874e5053f2534d2767a",
      "name": "staging.example.com",
      "status": "active",
      "nameservers": ["alice.ns.cloudflare.com", "bob.ns.cloudflare.com"],
      "plan": { "name": "Free" },
      "type": "full",
      "activatedOn": "2024-03-01T08:00:00Z"
    }
  ]
}

Expression Reference

ExpressionReturns
{{ $node.CloudflareList.output.zones }}Full array of zone objects
{{ $node.CloudflareList.output.zones[0].id }}Zone ID of the first zone
{{ $node.CloudflareList.output.zones[0].name }}Domain name of the first zone
{{ $node.CloudflareList.output.zones[0].status }}Status of the first zone
{{ $node.CloudflareList.output.zones.length }}Total number of zones returned

Node Policies & GuardRails

PolicyDetail
Use scoped tokens onlyThis operation needs only Zone.Read — do not use an Edit-scoped token for read-only operations
Store ApiToken in Credentials ManagerNever paste the token directly into the configuration JSON
Validate zone status before writesAdd a Filter node downstream to confirm status === "active" before any DNS or settings changes
Rate limit awarenesszone/list counts toward the 1,200 req/5 min limit; avoid polling in tight loops
Token scope limits resultsThe returned list is bounded by which zones the token is scoped to — account-wide tokens return all zones

Examples

Example 1: Find Zone ID by Domain Name

Use zone/list followed by a Function node to extract the zone ID for a specific domain:

// Function node — find zone by domain name
const targetDomain = "example.com";
const zones = $input.item.json.zones;
const match = zones.find(z => z.name === targetDomain);
if (!match) throw new Error(`Zone not found: ${targetDomain}`);
return [{ json: { zoneId: match.id, zoneName: match.name } }];

Example 2: Filter Active Zones Only

Feed zone/list output into a Filter node configured as: zones[].status equals active. This ensures downstream DNS operations only run against healthy zones.

Example 3: Audit All Zones for Plan Type

Iterate over the zones array with a Loop node. For each zone, check plan.name. Send an alert if any zone is on the Free plan when Pro is required by policy.