---
title: "List Custom Rulesets"
method: GET
path: "/api/v2/static-analysis/custom/rulesets"
tags: ["Static Analysis"]
---

# List Custom Rulesets

`GET /api/v2/static-analysis/custom/rulesets`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/static-analysis/custom/rulesets`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `code_analysis_read`

Get all custom rulesets for the authenticated organization.

## Response `200`

OK

- CustomRulesetListResponse: Response containing a list of custom rulesets for the authenticated organization.
  - `data` CustomRuleset[], required: The list of custom rulesets.
    - `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

- `401`: Unauthorized
- `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)
