Skip to content
Start here

List Prebuilt Policies

magic_cloud_networking.catalog_syncs.prebuilt_policies.list(PrebuiltPolicyListParams**kwargs) -> SyncSinglePage[PrebuiltPolicyListResponse]
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
account_id: str
destination_type: Optional[Literal["NONE", "ZERO_TRUST_LIST"]]

Specify type of destination, omit to return all.

One of the following:
"NONE"
"ZERO_TRUST_LIST"
ReturnsExpand Collapse
class PrebuiltPolicyListResponse:
applicable_destinations: List[Literal["NONE", "ZERO_TRUST_LIST"]]
One of the following:
"NONE"
"ZERO_TRUST_LIST"
policy_description: str
policy_name: str
policy_string: str

List Prebuilt Policies

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.magic_cloud_networking.catalog_syncs.prebuilt_policies.list(
    account_id="account_id",
)
page = page.result[0]
print(page.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
}