For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/data-deletion/creates-a-data-deletion-request.md. A documentation index is available at /llms.txt.
Language
Datadog site

Creates a data deletion request

POSThttps://api.datadoghq.com/api/v2/deletion/data/{product}https://api.us3.datadoghq.com/api/v2/deletion/data/{product}https://api.us5.datadoghq.com/api/v2/deletion/data/{product}https://api.datadoghq.eu/api/v2/deletion/data/{product}https://api.ap1.datadoghq.com/api/v2/deletion/data/{product}https://api.ap2.datadoghq.com/api/v2/deletion/data/{product}https://api.uk1.datadoghq.com/api/v2/deletion/data/{product}https://api.ddog-gov.com/api/v2/deletion/data/{product}https://api.us2.ddog-gov.com/api/v2/deletion/data/{product}

Overview

Creates a data deletion request by providing a query and a timeframe targeting the proper data.

This endpoint requires the logs_delete_data permission.

Arguments

Path Parameters

Name
Type
Description
product [required]
string

Name of the product to be deleted. Only logs is supported.

Request

Body Data (required)

Field
Type
Description
data [required]
object

Data needed to create a data deletion request.

Response

OK

The response from the create data deletion request endpoint.

Field
Type
Description
data
object

The created data deletion request information.

meta
object

The metadata of the data deletion response.

Code Example

Creates a data deletion request returns "OK" response
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF
# Path parameters
export product="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/deletion/data/${product}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "displayed_total": 100,
      "from": 1672527600000,
      "indexes": [
        "test-index",
        "test-index-2"
      ],
      "query": {
        "host": "abc",
        "service": "xyz"
      },
      "to": 1704063600000
    },
    "type": "create_deletion_req"
  }
}
EOF