---
title: "Show Custom Ruleset"
method: GET
path: "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
tags: ["Static Analysis"]
---

# Show Custom Ruleset

`GET /api/v2/static-analysis/custom/rulesets/{ruleset_name}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/static-analysis/custom/rulesets/{ruleset_name}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Get a custom ruleset by name

## Path parameters

- `ruleset_name` string, required

## Response `200`

Successful response

- CustomRulesetResponse: Response containing a single custom ruleset.
  - `data` CustomRuleset, required: A custom static analysis ruleset containing a set of user-defined rules.
    - `attributes` CustomRulesetAttributes, required: Attributes of a custom ruleset, including its name, description, and rules.
      - `created_at` string, date-time, required: Creation timestamp
      - `created_by` string, required: Creator identifier
      - `description` string, required: Base64-encoded full description
      - `name` string, required: Ruleset name
      - `rules` CustomRule[], nullable, required: Rules in the ruleset
        - `created_at` string, date-time, required: Creation timestamp
        - `created_by` string, required: Creator identifier
        - `last_revision` CustomRuleRevision, required: A specific revision of a custom static analysis rule.
          - `attributes` CustomRuleRevisionAttributes, required: Attributes of a custom rule revision, including code, metadata, and test cases.
            - `arguments` Argument[], required: Rule arguments
              - …
            - `category` 'SECURITY' | 'BEST_PRACTICES' | 'CODE_STYLE' | 'ERROR_PRONE' | 'PERFORMANCE', required: Rule category
            - `checksum` string, required: Code checksum
            - `code` string, required: Rule code
            - `created_at` string, date-time, required: Creation timestamp
            - `created_by` string, required: Creator identifier
            - `creation_message` string, required: Revision creation message
            - `cve` string, nullable, required: Associated CVE
            - `cwe` string, nullable, required: Associated CWE
            - `description` string, required: Full description
            - `documentation_url` string, nullable, required: Documentation URL
            - `is_published` boolean, required: Whether the revision is published
            - `is_testing` boolean, required: Whether this is a testing revision
            - `language` 'PYTHON' | 'JAVASCRIPT' | 'TYPESCRIPT' | 'JAVA' | 'GO' | 'YAML' | 'RUBY' | 'CSHARP' | 'PHP' | 'KOTLIN' | 'SWIFT', required: Programming language
            - `severity` 'ERROR' | 'WARNING' | 'NOTICE', required: Rule severity
            - `short_description` string, required: Short description
            - `should_use_ai_fix` boolean, required: Whether to use AI for fixes
            - `tags` string[], required: Rule tags
            - `tests` CustomRuleRevisionTest[], required: Rule tests
              - …
            - `tree_sitter_query` string, required: Tree-sitter query
          - `id` string, required: Revision identifier
          - `type` 'custom_rule_revision', required: Resource type
        - `name` string, required: Rule name
      - `short_description` string, required: Base64-encoded short description
    - `id` string, required: Ruleset identifier
    - `type` 'custom_ruleset', required: Resource type

## Other responses

- `400`: Bad request
- `401`: Unauthorized - custom rules not enabled
- `404`: Ruleset not found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
