Skip to content
Start here

List Prebuilt Policies

client.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list(PrebuiltPolicyListParams { account_id, destination_type } params, RequestOptionsoptions?): SinglePage<PrebuiltPolicyListResponse { applicable_destinations, policy_description, policy_name, policy_string } >
GET/accounts/{account_id}/magic/cloud/catalog-syncs/prebuilt-policies

List prebuilt catalog sync policies (Closed Beta).

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
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)
Magic WAN WriteMagic WAN Read
ParametersExpand Collapse
params: PrebuiltPolicyListParams { account_id, destination_type }
account_id: string

Path param

destination_type?: "NONE" | "ZERO_TRUST_LIST"

Query param: Specify type of destination, omit to return all.

One of the following:
"NONE"
"ZERO_TRUST_LIST"
ReturnsExpand Collapse
PrebuiltPolicyListResponse { applicable_destinations, policy_description, policy_name, policy_string }
applicable_destinations: Array<"NONE" | "ZERO_TRUST_LIST">
One of the following:
"NONE"
"ZERO_TRUST_LIST"
policy_description: string
policy_name: string
policy_string: string

List Prebuilt Policies

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const prebuiltPolicyListResponse of client.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list(
  { account_id: 'account_id' },
)) {
  console.log(prebuiltPolicyListResponse.applicable_destinations);
}
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "applicable_destinations": [
        "NONE"
      ],
      "policy_description": "policy_description",
      "policy_name": "policy_name",
      "policy_string": "policy_string"
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "applicable_destinations": [
        "NONE"
      ],
      "policy_description": "policy_description",
      "policy_name": "policy_name",
      "policy_string": "policy_string"
    }
  ],
  "success": true
}