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

# Update an AI custom ruleset

`PATCH /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`

Update the description of an existing AI custom ruleset.

## Path parameters

- `ruleset_name` string, required

## Request body

- AiCustomRulesetUpdateRequest: Request body for updating an AI custom ruleset.
  - `data` AiCustomRulesetUpdateData: Request data for updating an AI custom ruleset.
    - `attributes` AiCustomRulesetUpdateAttributes: Attributes for updating an AI custom ruleset.
      - `description` string: Base64-encoded full description of the ruleset.
      - `name` string: The ruleset name.
      - `short_description` string: Base64-encoded short description of the ruleset.
    - `id` string: The ruleset identifier.
    - `type` 'ai_ruleset': AI custom ruleset resource type.

## Response `200`

Successfully updated

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `412`: Precondition Failed - validation error or 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)
