---
title: Update an AI custom ruleset
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Static Analysis
---

# Update an AI custom ruleset{% #update-an-ai-custom-ruleset %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/static-analysis/ai/rulesets/{ruleset_name}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name} |

### Overview

Update the description of an existing AI custom ruleset.

### Arguments

#### Path Parameters

| Name                           | Type   | Description       |
| ------------------------------ | ------ | ----------------- |
| ruleset_name [*required*] | string | The ruleset name. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field             | Type   | Description                                                        |
| ------------ | ----------------- | ------ | ------------------------------------------------------------------ |
|              | data              | object | Request data for updating an AI custom ruleset.                    |
| data         | attributes        | object | Attributes for updating an AI custom ruleset.                      |
| attributes   | description       | string | Base64-encoded full description of the ruleset.                    |
| attributes   | name              | string | The ruleset name.                                                  |
| attributes   | short_description | string | Base64-encoded short description of the ruleset.                   |
| data         | id                | string | The ruleset identifier.                                            |
| data         | type              | enum   | AI custom ruleset resource type. Allowed enum values: `ai_ruleset` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "Ruleset description",
      "name": "my-ai-ruleset",
      "short_description": "Ruleset short description"
    },
    "id": "my-ai-ruleset",
    "type": "ai_ruleset"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
Successfully updated
{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="412" %}
Precondition Failed - validation error or ruleset not found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="500" %}
Internal Server Error
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export ruleset_name="my-ai-ruleset" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/static-analysis/ai/rulesets/${ruleset_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Ruleset description",
      "name": "my-ai-ruleset",
      "short_description": "Ruleset short description"
    },
    "id": "my-ai-ruleset",
    "type": "ai_ruleset"
  }
}
EOF 
                
{% /tab %}
