---
title: "Get custom rule"
method: POST
path: "/api/v2/rules/get"
tags: ["Rules"]
---

# Get custom rule

`POST /api/v2/rules/get`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/rules/get`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Get details of a specific custom rule including associated repositories

## Request body

- GetRuleInput
  - `organizationId` string
  - `ruleId` string, required

## Response `200`

Successful response

- RuleWithRepositories
  - `id` string, required
  - `name` string, required
  - `rule` string, required: Natural language description of the security rule
  - `globPattern` string, required
  - `sourceTypes` string[], required
  - `source` 'USER' | 'SECURITY_COMPASS'
  - `repositories` object[], required
    - `id` string, required
    - `name` string, required
  - `tags` RuleTag[], required
    - `id` string, required
    - `name` string, required
  - `scope` 'allRepositories' | 'repositories' | 'tags', required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: Error Response
- `401`: Error Response
- `404`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
