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

# List AI custom rulesets

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

Get all AI custom rulesets for the authenticated organization.

## Query parameters

- `page[offset]` integer
- `page[limit]` integer

## Response `200`

Successful response

- AiCustomRulesetsResponse — Response containing a list of AI custom rulesets.
  - `data` AiCustomRulesetResponseData[], required — The list of AI custom rulesets.
    - `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

- `401` — Unauthorized
- `429` — Too many requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
