# Get review rule (https://docs.capy.ai/api-reference/reviewrules/get-review-rule)

`GET https://api.capy.ai/api/v1/review-rules/{id}`

## Authorization

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

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

## Responses

- `200` ReviewRuleRead: `ReviewRuleReadEncoded`
- `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-rules/{id}" \
  -H "Authorization: Bearer $CAPY_API_KEY"
```

## Referenced schemas

```json
{
  "ReviewRuleReadEncoded": {
    "type": "object",
    "properties": {
      "rule": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ReviewRuleEncoded"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "rule"
    ],
    "additionalProperties": false
  },
  "ReviewRuleEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "allOf": [
          {
            "minLength": 32
          },
          {
            "maxLength": 32
          }
        ],
        "pattern": "^rrule_"
      },
      "body": {
        "type": "string"
      },
      "scopes": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "repo": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "paths": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "githubRepoId": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "covered": {
              "type": "boolean"
            },
            "heldByCaller": {
              "type": "boolean"
            }
          },
          "required": [
            "repo",
            "paths",
            "githubRepoId",
            "covered",
            "heldByCaller"
          ],
          "additionalProperties": false
        }
      },
      "file": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "repo": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "githubRepoId": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "covered": {
                "type": "boolean"
              }
            },
            "required": [
              "repo",
              "path",
              "githubRepoId",
              "covered"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "source": {
        "type": "string",
        "enum": [
          "app",
          "api",
          "tool",
          "comment"
        ]
      },
      "sourceRef": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "createdByUserId": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "createdByName": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "firedCount": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "string",
            "enum": [
              "Infinity",
              "-Infinity",
              "NaN"
            ]
          }
        ]
      },
      "lastFired": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "repo": {
                "type": "string"
              },
              "prNumber": {
                "type": "integer"
              },
              "at": {
                "type": "string"
              }
            },
            "required": [
              "repo",
              "prNumber",
              "at"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "createdAt": {
        "type": "string"
      },
      "updatedAt": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "body",
      "scopes",
      "file",
      "status",
      "source",
      "sourceRef",
      "createdByUserId",
      "createdByName",
      "firedCount",
      "lastFired",
      "createdAt",
      "updatedAt"
    ],
    "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