---
type: api
title: Get associated rulesets
description: Retrieves the rulesets associated with a deployment.
url: https://www.elastic.co/docs/api/doc/cloud-enterprise/v4/operation/operation-get-traffic-filter-deployment-ruleset-associations
resource: https://www.elastic.co/docs/api/doc/cloud-enterprise/v4/operation/operation-get-traffic-filter-deployment-ruleset-associations
products:
  - Elastic Cloud Enterprise
---

# Get associated rulesets

Authentication: required

## Paths

- `GET` `/deployments/traffic-filter/associations/{association_type}/{associated_entity_id}/rulesets`

#### Path parameters

- `association_type` (string) — required
  Association type
- `associated_entity_id` (string) — required
  Associated entity ID

## Description

Retrieves the rulesets associated with a deployment.

## Responses

#### `200`

Rulesets in the deployment were successfully returned

`application/json`

- `rulesets` (string[])
  IDs of the traffic filter rulesets
#### `400`

Invalid association type. (code: `traffic_filter.invalid_association_type`)

`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

#### `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/associations/${ASSOCIATION_TYPE}/${ASSOCIATED_ENTITY_ID}/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": [
    "string"
  ]
}
```

#### 400

`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"
      ]
    }
  ]
}
```

#### 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"
      ]
    }
  ]
}
```

