---
title: Get Dynamic Config Rules
description: Get Dynamic Config Rules
product: general
token_estimate: 1785
---
# Get Dynamic Config Rules

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Get Dynamic Config Rules

**GET** `/console/v1/dynamic_configs/{id}/rules`

Full URL: `https://statsigapi.net/console/v1/dynamic_configs/{id}/rules`

Get Dynamic Config Rules

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | id |

## Response (application/json)

**200** — Get Dynamic Config Rules Response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object[] | Yes | — | — |
| data.rules | object[] | Yes | — | — |
| data.rules.name | string | Yes | — | The name of this rule. |
| data.rules.passPercentage | number | Yes | — | Of the users that meet the conditions of this rule, what percent should return true. Constraints: min: 0, max: 100 |
| data.rules.conditions | object[] | Yes | — | An array of Condition objects. |
| data.rules.conditions.targetValue | oneOf | No | — | Constraints: nullable, string[], number[], string, number |
| data.rules.conditions.operator | string | No | — | — |
| data.rules.conditions.field | string | No | — | Constraints: nullable |
| data.rules.conditions.customID | string | No | — | Constraints: nullable |
| data.rules.conditions.type | string | Yes | — | Allowed values: app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, user_agent, url, javascript, device_model, target_app, experiment_group |
| data.rules.environments | string[] | No | — | The environments this rule is enabled for. Constraints: nullable |
| data.rules.id | string | No | — | The Statsig ID of this rule. |
| data.rules.baseID | string | No | — | The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout |
| data.rules.returnValue | object | No | — | The return value of the rule. |
| data.rules.completedAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that have already completed. |
| data.rules.completedAutomatedRollouts.time | number | No | — | — |
| data.rules.completedAutomatedRollouts.passPercent | number | Yes | — | — |
| data.rules.pendingAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that are scheduled but not yet complete. |
| data.rules.pendingAutomatedRollouts.time | number | No | — | — |
| data.rules.pendingAutomatedRollouts.passPercent | number | Yes | — | — |
| pagination | object | Yes | — | Pagination metadata for checking if there is next page for example. |
| pagination.itemsPerPage | number | Yes | — | Constraints: format: double |
| pagination.pageNumber | number | Yes | — | Constraints: format: double |
| pagination.nextPage | string | Yes | — | Constraints: nullable |
| pagination.previousPage | string | Yes | — | Constraints: nullable |
| pagination.totalItems | number | No | — | Constraints: format: double |
| pagination.all | string | No | — | — |

```json
{
  "message": "Dynamic Config rules read successfully.",
  "data": [
    {
      "rules": [
        {
          "id": "5pjzfmF8KLFsh81kBPyxvR",
          "baseID": "5pjzfmF8KLFsh81kBPyxvR",
          "name": "rule name",
          "passPercentage": 1,
          "conditions": [
            {
              "type": "browser_name",
              "targetValue": [],
              "operator": "any"
            }
          ],
          "environments": null,
          "completedAutomatedRollouts": [],
          "pendingAutomatedRollouts": []
        },
        {
          "id": "6jQEnu1fCnXqjXhm1qGEnt",
          "baseID": "6jQEnu1fCnXqjXhm1qGEnt",
          "name": "Other2",
          "passPercentage": 80,
          "conditions": [],
          "environments": null,
          "completedAutomatedRollouts": [],
          "pendingAutomatedRollouts": []
        },
        {
          "id": "4DonExIcOjSV8kG3WSQ5Zm",
          "baseID": "4DonExIcOjSV8kG3WSQ5Zm",
          "name": "Austin's fav rule",
          "passPercentage": 8,
          "conditions": [],
          "environments": null,
          "completedAutomatedRollouts": [],
          "pendingAutomatedRollouts": []
        }
      ]
    }
  ],
  "pagination": {
    "itemsPerPage": 20000,
    "pageNumber": 1,
    "totalItems": 1,
    "nextPage": null,
    "previousPage": null,
    "all": ""
  }
}
```

## Code samples

### cURL

```bash
curl -X GET "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

