---
title: "Get an AI custom ruleset"
method: GET
path: "/api/v2/static-analysis/ai/rulesets/{ruleset_name}"
tags: ["Static Analysis"]
---

# Get an AI custom ruleset

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

## Request

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

Get an AI custom ruleset by name.

## Path parameters

- `ruleset_name` string, required

## Response `200`

Successful response

- AiCustomRulesetResponse: Response containing a single AI custom ruleset.
  - `data` AiCustomRulesetResponseData, required: Response data for an AI custom ruleset.
    - `attributes` AiCustomRulesetResponseAttributes, required: Response attributes of an AI custom ruleset.
      - `created_at` string, date-time, required: The creation timestamp.
      - `created_by` string, required: The identifier of the user who created the ruleset.
      - `description` string, required: Base64-encoded full description of the ruleset.
      - `name` string, required: The ruleset name.
      - `rules` AiCustomRuleItem[], nullable, required: The rules contained in the ruleset.
        - `created_at` string, date-time, required: The creation timestamp.
        - `created_by` string, required: The identifier of the user who created the rule.
        - `last_revision` AiCustomRuleRevisionResponseAttributes, required: Response attributes of an AI custom rule revision.
          - `category` 'SECURITY' | 'BEST_PRACTICES' | 'CODE_STYLE' | 'ERROR_PRONE' | 'PERFORMANCE', required: Rule category
          - `checksum` string, required: Checksum of the revision content.
          - `content` string, required: Base64-encoded AI model content for this revision.
          - `created_at` string, date-time, required: The creation timestamp.
          - `created_by` string, required: The identifier of the user who created the revision.
          - `cwe` string, nullable, required: The associated CWE identifier.
          - `description` string, required: Base64-encoded full description.
          - `directories` string[], required: Directory patterns this rule applies to.
          - `execution_mode` 'auto' | 'manual' | 'always', required: The execution mode for an AI rule revision.
          - `globs` string[], required: File glob patterns this rule applies to.
          - `is_default` boolean, required: Whether this is a default Datadog rule.
          - `is_published` boolean, required: Whether this revision is published.
          - `is_testing` boolean, required: Whether this revision is for testing only.
          - `severity` 'ERROR' | 'WARNING' | 'NOTICE', required: Rule severity
          - `short_description` string, required: Base64-encoded short description.
          - `version_id` integer, required: The version identifier for this revision.
        - `name` string, required: The rule name.
      - `short_description` string, required: Base64-encoded short description of the ruleset.
    - `id` string, required: The ruleset identifier.
    - `type` 'ai_ruleset', required: AI custom ruleset resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Ruleset not found
- `429`: Too many requests
- `500`: Internal Server Error

---

[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)
