# List rules (https://docs.capy.ai/api-reference/reviewfilters/list-rules)

`GET https://api.capy.ai/api/v1/review-filters/rules`

## Authorization

Send an API key as a bearer token: `Authorization: Bearer $CAPY_API_KEY`. See https://docs.capy.ai/api-reference/authentication.md.

## Responses

- `200` ReviewFilterRuleList: `ReviewFilterRuleListEncoded`
- `400` capy/InvalidRequest: `capy_InvalidRequestEncoded`
- `401` capy/Unauthorized: `capy_UnauthorizedEncoded`
- `403` capy/Forbidden: `capy_ForbiddenEncoded \| capy_ForbiddenEncoded`
- `429` capy/RateLimited: `capy_RateLimitedEncoded`

## Example

```bash
curl -X GET "https://api.capy.ai/api/v1/review-filters/rules" \
  -H "Authorization: Bearer $CAPY_API_KEY"
```

## Referenced schemas

```json
{
  "ReviewFilterRuleListEncoded": {
    "type": "object",
    "properties": {
      "rules": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ReviewFilterRuleEncoded"
        }
      },
      "repositories": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "githubRepoId": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "enum": [
                    "Infinity",
                    "-Infinity",
                    "NaN"
                  ]
                }
              ]
            },
            "repo": {
              "type": "string"
            }
          },
          "required": [
            "githubRepoId",
            "repo"
          ],
          "additionalProperties": false
        }
      },
      "repositoryConditionsEnabled": {
        "type": "boolean"
      }
    },
    "required": [
      "rules"
    ],
    "additionalProperties": false
  },
  "ReviewFilterRuleEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "allOf": [
          {
            "minLength": 32
          },
          {
            "maxLength": 32
          }
        ],
        "pattern": "^rfilt_"
      },
      "repo": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "githubRepoId": {
        "anyOf": [
          {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "enum": [
                  "Infinity",
                  "-Infinity",
                  "NaN"
                ]
              }
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ReviewFilterCondition"
        }
      },
      "repositoryCondition": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ReviewFilterRepositoryCondition"
          },
          {
            "type": "null"
          }
        ]
      },
      "skipped": {
        "type": "boolean",
        "description": "True when a value exceeds the wildcard limit or a repository is unavailable, so admission skips the rule until it is edited"
      },
      "source": {
        "type": "string",
        "enum": [
          "hand",
          "greptile"
        ]
      },
      "createdByUserId": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "createdByName": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "createdAt": {
        "type": "string"
      },
      "updatedAt": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "repo",
      "githubRepoId",
      "conditions",
      "skipped",
      "source",
      "createdByUserId",
      "createdByName",
      "createdAt",
      "updatedAt"
    ],
    "additionalProperties": false
  },
  "ReviewFilterCondition": {
    "type": "object",
    "properties": {
      "field": {
        "type": "string",
        "enum": [
          "label",
          "base_branch",
          "title_or_body",
          "author"
        ]
      },
      "not": {
        "type": "boolean"
      },
      "values": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "field",
      "not",
      "values"
    ],
    "additionalProperties": false
  },
  "ReviewFilterRepositoryCondition": {
    "type": "object",
    "properties": {
      "not": {
        "type": "boolean"
      },
      "repoIds": {
        "type": "array",
        "items": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ]
        }
      }
    },
    "required": [
      "not",
      "repoIds"
    ],
    "additionalProperties": false
  },
  "capy_InvalidRequestEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/InvalidRequest"
        ]
      },
      "message": {
        "type": "string"
      }
    },
    "required": [
      "_tag",
      "message"
    ],
    "additionalProperties": false
  },
  "capy_UnauthorizedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Unauthorized"
        ]
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_ForbiddenEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Forbidden"
        ]
      },
      "mfaRequiredOrgId": {
        "type": "string"
      },
      "ssoRequired": {
        "type": "boolean"
      },
      "passkeyRequired": {
        "type": "boolean"
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_RateLimitedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/RateLimited"
        ]
      },
      "retryAfterSeconds": {
        "type": "integer"
      }
    },
    "required": [
      "_tag",
      "retryAfterSeconds"
    ],
    "additionalProperties": false
  }
}
```

Full document: https://docs.capy.ai/openapi.json