---
type: api
title: List traffic filter rulesets
description: List all of the traffic filter rulesets.
url: https://www.elastic.co/docs/api/doc/cloud-enterprise/operation/operation-get-traffic-filter-rulesets
resource: https://www.elastic.co/docs/api/doc/cloud-enterprise/operation/operation-get-traffic-filter-rulesets
products:
  - Elastic Cloud Enterprise
---

# List traffic filter rulesets

Authentication: required

## Paths

- `GET` `/deployments/traffic-filter/rulesets`

## Description

List all of the traffic filter rulesets.

## Query string parameters

- `include_associations` (boolean · default: false) — optional
  Retrieves a list of resources that are associated to the specified ruleset.
- `region` (string) — optional
  If provided limits the rulesets to that region only.
- `organization_id` (string) — optional
  Retrieves a list of resources that are associated to the specified organization ID. It only takes effect if the user is an admin.

## Responses

#### `200`

The collection of traffic filter routes

`application/json`

- `rulesets` (object[])
  List of traffic filter rules
  - `id` (string)
    The ruleset ID
  - `name` (string)
    Name of the ruleset
  - `description` (string)
    Description of the ruleset
  - `type` (enum)
    Type of the ruleset
    Values: `ip`, `azure_private_endpoint`, `gcp_private_service_connect_endpoint`, `vpce`, `egress_firewall`, `remote_cluster`
  - `include_by_default` (boolean)
    Should the ruleset be automatically included in the new deployments
  - `region` (string)
    The ruleset can be attached only to deployments in the specific region
  - `rules` (object[])
    List of rules
    - `id` (string)
      The rule ID
    - `remote_cluster_org_id` (string)
      The remote cluster organization ID
    - `remote_cluster_id` (string)
      The remote cluster ID
    - `description` (string)
      Description of the rule
    - `source` (string)
      Allowed traffic filter source: IP address, CIDR mask, or VPC endpoint ID
    - `azure_endpoint_name` (string)
      Name of the Azure Private Endpoint to allow connections from
    - `azure_endpoint_guid` (string)
      Resource GUID of the Azure Private Endpoint to allow connections from
    - `egress_rule` (object)
      The rule detail for a traffic filter egress rule.
      - `target` (string)
        Allowed traffic filter egress target: IP address or CIDR mask
      - `ports` (integer[] · format: int32)
        A list of target ports for an egress rule
      - `protocol` (enum)
        The target protocol for an egress rule
        Values: `all`, `tcp`, `udp`
  - `associations` (object[])
    List of associations. Returned only when include_associations query parameter is true
    - `entity_type` (string)
      Type of the traffic filter ruleset association, such as 'deployment', 'cluster'
    - `id` (string)
      ID of the entity, such as the deployment ID or Elasticsearch cluster ID.
  - `total_associations` (integer · format: int32)
    Total number of associations. This includes associations the user does not have permission to view.Returned only when include_associations query parameter is true
#### `500`

Error fetching traffic filter rulesets. (code: `traffic_filter.request_execution_failed`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X GET "${API_URL}/deployments/traffic-filter/rulesets" \
  -u "${USERNAME}:${PASSWORD}"
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "rulesets": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "type": "ip",
      "include_by_default": false,
      "region": "string",
      "rules": [
        {
          "id": "string",
          "remote_cluster_org_id": "string",
          "remote_cluster_id": "string",
          "description": "string",
          "source": "string",
          "azure_endpoint_name": "string",
          "azure_endpoint_guid": "string",
          "egress_rule": {
            "target": "string",
            "protocol": "all"
          }
        }
      ],
      "associations": [
        {
          "entity_type": "string",
          "id": "string"
        }
      ],
      "total_associations": 0
    }
  ]
}
```

#### 500

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

