---
title: Rules
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Cloud Connector](https://developers.cloudflare.com/api/go/resources/cloud_connector)

[Rules](https://developers.cloudflare.com/api/go/resources/cloud_connector/subresources/rules)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Rules

client.CloudConnector.Rules.List(ctx, query) (\*SinglePage\[[RuleListResponse](<https://developers.cloudflare.com/api/go/resources/cloud_connector#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)>)], error)

GET/zones/{zone\_id}/cloud\_connector/rules

Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.

##### 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`

##### Accepted Permissions (at least one required)

`Cloud Connector Read``Cloud Connector Write`

##### ParametersExpand Collapse

<details>

<summary>

query RuleListParams

</summary>

ZoneID param.Field\[string]

Identifier.

maxLength32

<a href="#(resource)%20cloud_connector.rules%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cloud_connector.rules%20%3E%20(method)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type RuleListResponse struct{…}

</summary>

ID stringOptional

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Description stringOptional

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

Enabled boolOptional

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

Expression stringOptional

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

<details>

<summary>

Parameters RuleListResponseParametersOptional

Parameters of Cloud Connector Rule

</summary>

Host stringOptional

Host to perform Cloud Connection to

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20parameters%20%3E%20(property)%20host">Link to this property</a>

</details>

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20parameters">Link to this property</a>

<details>

<summary>

Provider RuleListResponseProviderOptional

Cloud Provider type

</summary>

One of the following:

const RuleListResponseProviderAwsS3 RuleListResponseProvider = "aws\_s3"

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider%20%3E%20(member)%200">Link to this property</a>

const RuleListResponseProviderCloudflareR2 RuleListResponseProvider = "cloudflare\_r2"

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider%20%3E%20(member)%201">Link to this property</a>

const RuleListResponseProviderGcpStorage RuleListResponseProvider = "gcp\_storage"

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider%20%3E%20(member)%202">Link to this property</a>

const RuleListResponseProviderAzureStorage RuleListResponseProvider = "azure\_storage"

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider%20%3E%20(member)%203">Link to this property</a>

const RuleListResponseProviderOciStorage RuleListResponseProvider = "oci\_storage"

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)%20%3E%20(property)%20provider">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cloud_connector.rules%20%3E%20(model)%20RuleListResponse%20%3E%20(schema)>)

### Rules

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/cloud_connector"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  page, err := client.CloudConnector.Rules.List(context.TODO(), cloud_connector.RuleListParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "95c365e17e1b46599cd99e5b231fac4e",
      "description": "Rule description",
      "enabled": true,
      "expression": "http.cookie eq \"a=b\"",
      "parameters": {
        "host": "examplebucket.s3.eu-north-1.amazonaws.com"
      },
      "provider": "aws_s3"
    }
  ]
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "95c365e17e1b46599cd99e5b231fac4e",
      "description": "Rule description",
      "enabled": true,
      "expression": "http.cookie eq \"a=b\"",
      "parameters": {
        "host": "examplebucket.s3.eu-north-1.amazonaws.com"
      },
      "provider": "aws_s3"
    }
  ]
}
```