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

# List AI prompts

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

## Request

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

Get all AI prompts, including default prompts and custom AI rule prompts for the authenticated organization.

## Response `200`

Successful response

- AiPromptsResponse: Response containing a list of AI prompts.
  - `data` AiPromptResponseData[], required: The list of AI prompts.
    - `attributes` AiPromptResponseAttributes, required: Response attributes of an AI prompt.
      - `category` 'SECURITY' | 'BEST_PRACTICES' | 'CODE_STYLE' | 'ERROR_PRONE' | 'PERFORMANCE', required: Rule category
      - `checksum` string, required: Checksum of the prompt content.
      - `content` string, required: Base64-encoded AI prompt content.
      - `cwe` string: The CWE identifier associated with this prompt.
      - `description` string, required: Base64-encoded full description.
      - `directories` string[], required: Directory patterns this prompt applies to.
      - `execution_mode` 'auto' | 'manual' | 'always', required: The execution mode for an AI rule revision.
      - `file_search_keywords` string[], required: Keywords used to search for relevant files.
      - `globs` string[], required: File glob patterns this prompt applies to.
      - `is_default` boolean, required: Whether this is a default Datadog prompt.
      - `is_testing` boolean, required: Whether this prompt is for testing only.
      - `language` 'PYTHON' | 'JAVASCRIPT' | 'TYPESCRIPT' | 'JAVA' | 'GO' | 'YAML' | 'RUBY' | 'CSHARP' | 'PHP' | 'KOTLIN' | 'SWIFT': Programming language
      - `result_keywords_exclude` string[], required: Keywords to exclude from results.
      - `rule_version` string, required: The version of the rule this prompt is associated with.
      - `severity` 'ERROR' | 'WARNING' | 'NOTICE', required: Rule severity
      - `short_description` string, required: Base64-encoded short description.
    - `id` string, required: The prompt identifier.
    - `type` 'ai_prompt', required: AI prompt resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: 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)
