Skip to content

Configure a Cloud Connector rule via API

Last updated View as MarkdownAgent setup

You can configure Cloud Connector rules using the Cloudflare API.

Required permissions

The API token used in API requests to manage Cloud Connector rules must have at least the following permission:

  • Zone > Cloud Connector > Write

Endpoints

To obtain the complete endpoint, append the Cloud Connector endpoints listed below to the Cloudflare API base URL:

https://api.cloudflare.com/client/v4

The {zone_id} argument is the zone ID (a hexadecimal string). You can find this value in the Cloudflare dashboard.

The following table summarizes the available operations.

Operation Verb + Endpoint
List Cloud Connector rules GET /zones/{zone_id}/cloud_connector/rules
Create/update/delete Cloud Connector rules PUT /zones/{zone_id}/cloud_connector/rules

Example API calls

List of Cloud Connector rules

The following example returns a list of existing Cloud Connector rules:

Required API token permissions

At least one of the following token permissions is required:
  • Cloud Connector Read
  • Cloud Connector Write
Rulesbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cloud_connector/rules" \
	--request GET \
	--header "X-Auth-Email: $CLOUDFLARE_EMAIL" \
	--header "X-Auth-Key: $CLOUDFLARE_API_KEY"
{
	"result": [
		{
			"id": "<RULE_1_ID>",
			"provider": "aws_s3",
			"expression"