Create an AI memory violation result

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

POST https://api.ap1.datadoghq.com/api/v2/static-analysis/ai/memoryhttps://api.ap2.datadoghq.com/api/v2/static-analysis/ai/memoryhttps://api.datadoghq.eu/api/v2/static-analysis/ai/memoryhttps://api.ddog-gov.com/api/v2/static-analysis/ai/memoryhttps://api.us2.ddog-gov.com/api/v2/static-analysis/ai/memoryhttps://api.datadoghq.com/api/v2/static-analysis/ai/memoryhttps://api.us3.datadoghq.com/api/v2/static-analysis/ai/memoryhttps://api.us5.datadoghq.com/api/v2/static-analysis/ai/memory

Overview

Add a new AI memory violation result for the authenticated organization.

Request

Body Data (required)

Expand All

Field

Type

Description

data

object

Request data for creating an AI memory violation result.

attributes

object

Attributes for creating an AI memory violation result.

line [required]

int64

The line number where the violation was found.

message [required]

string

A message explaining the violation result.

name [required]

string

The file path where the violation was found.

repository_id [required]

string

The repository identifier.

rule [required]

string

The rule identifier in the format ruleset/rule.

sha [required]

string

The git commit SHA where the violation was found.

type [required]

enum

The type of AI memory violation result indicating whether it is a true positive or false positive. Allowed enum values: TP,FP

id

string

The violation result identifier.

type

enum

AI memory violation result resource type. Allowed enum values: ai_memory_violation_result

{
  "data": {
    "attributes": {
      "line": 10,
      "message": "This is a false positive because the input is sanitized.",
      "name": "src/main.py",
      "repository_id": "my-repo",
      "rule": "my-ai-ruleset/my-ai-rule",
      "sha": "abc123def456789012345678901234567890abcd",
      "type": "FP"
    },
    "id": "violation-abc",
    "type": "ai_memory_violation_result"
  }
}

Response

Successfully created

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"
    }
  ]
}

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
# 

# Curl command
curl -X POST "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/memory" \ -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": { "line": 10, "message": "This is a false positive.", "name": "src/main.py", "repository_id": "my-repo", "rule": "my-ai-ruleset/my-ai-rule", "sha": "abc123def456789012345678901234567890abcd", "type": "FP" }, "id": "violation-abc", "type": "ai_memory_violation_result" } } EOF