Update an AI custom ruleset

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.ap2.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.datadoghq.eu/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.ddog-gov.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.us2.ddog-gov.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}https://api.us3.datadoghq.com/api/v2/static-analysis/ai/rulesets/{ruleset_name}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)

Expand All

Field

Type

Description

data

object

Request data for updating an AI custom ruleset.

attributes

object

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

enum

AI custom ruleset resource type. Allowed enum values: ai_ruleset

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

Response

Successfully updated

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Precondition Failed - validation error or ruleset not found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Internal Server Error

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Code Example

                  ## default
# 

# Path parameters
export ruleset_name="my-ai-ruleset"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.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