Data Deletion

The Data Deletion API allows the user to target and delete data from the allowed products. It’s currently enabled for Logs and RUM and depends on logs_delete_data and rum_delete_data permissions respectively.

POST https://api.ap1.datadoghq.com/api/v2/deletion/data/{product}https://api.datadoghq.eu/api/v2/deletion/data/{product}https://api.ddog-gov.com/api/v2/deletion/data/{product}https://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}

Overview

Creates a data deletion request by providing a query and a time frame targeting the proper data. This endpoint requires any of the following permissions:

  • rum_delete_data
  • logs_delete_data

  • Arguments

    Path Parameters

    Name

    Type

    Description

    product [required]

    string

    Name of the product to be deleted, either logs or rum.

    Request

    Body Data (required)

    Expand All

    Field

    Type

    Description

    data [required]

    object

    Data needed to create a data deletion request.

    attributes [required]

    object

    Attributes for creating a data deletion request.

    from [required]

    int64

    Start of requested time window, milliseconds since Unix epoch.

    indexes

    [string]

    List of indexes for the search. If not provided, the search is performed in all indexes.

    query [required]

    object

    Query for creating a data deletion request.

    <any-key>

    string

    to [required]

    int64

    End of requested time window, milliseconds since Unix epoch.

    {
      "data": {
        "attributes": {
          "from": 1672527600000,
          "indexes": [
            "index-1",
            "index-2"
          ],
          "query": {
            "host": "abc",
            "service": "xyz"
          },
          "to": 1704063600000
        }
      }
    }

    Response

    OK

    The response from the create data deletion request endpoint.

    Expand All

    Field

    Type

    Description

    data

    object

    The created data deletion request information.

    attributes [required]

    object

    Deletion attribute for data deletion response.

    created_at [required]

    string

    Creation time of the deletion request.

    created_by [required]

    string

    User who created the deletion request.

    from_time [required]

    int64

    Start of requested time window, milliseconds since Unix epoch.

    indexes

    [string]

    List of indexes for the search. If not provided, the search is performed in all indexes.

    is_created [required]

    boolean

    Whether the deletion request is fully created or not.

    org_id [required]

    int64

    Organization ID.

    product [required]

    string

    Product name.

    query [required]

    string

    Query for creating a data deletion request.

    starting_at [required]

    string

    Starting time of the process to delete the requested data.

    status [required]

    string

    Status of the deletion request.

    to_time [required]

    int64

    End of requested time window, milliseconds since Unix epoch.

    total_unrestricted [required]

    int64

    Total number of elements to be deleted. Only the data accessible to the current user that matches the query and timeframe provided will be deleted.

    updated_at [required]

    string

    Update time of the deletion request.

    id [required]

    string

    The ID of the created data deletion request.

    type [required]

    string

    The type of the request created.

    meta

    object

    The metadata of the data deletion response.

    count_product

    object

    The total deletion requests created by product.

    <any-key>

    int64

    count_status

    object

    The total deletion requests created by status.

    <any-key>

    int64

    next_page

    string

    The next page when searching deletion requests created in the current organization.

    product

    string

    The product of the deletion request.

    request_status

    string

    The status of the executed request.

    {
      "data": {
        "attributes": {
          "created_at": "2024-01-01T00:00:00.000000Z",
          "created_by": "test.user@datadoghq.com",
          "from_time": 1672527600000,
          "indexes": [
            "index-1",
            "index-2"
          ],
          "is_created": true,
          "org_id": 321813,
          "product": "logs",
          "query": "service:xyz host:abc",
          "starting_at": "2024-01-01T02:00:00.000000Z",
          "status": "pending",
          "to_time": 1704063600000,
          "total_unrestricted": 100,
          "updated_at": "2024-01-01T00:00:00.000000Z"
        },
        "id": "1",
        "type": "deletion_request"
      },
      "meta": {
        "count_product": {
          "<any-key>": "integer"
        },
        "count_status": {
          "<any-key>": "integer"
        },
        "next_page": "cGFnZTI=",
        "product": "logs",
        "request_status": "canceled"
      }
    }

    Bad Request

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

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

    Precondition failed error

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

    {
      "errors": [
        "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]

    [string]

    A list of errors.

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

    Code Example

                              # Path parameters
    export product="CHANGE_ME"
    # Curl command
    curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/deletion/data/${product}" \ -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": { "from": 1672527600000, "indexes": [ "index-1", "index-2" ], "query": { "host": "abc", "service": "xyz" }, "to": 1704063600000 } } } EOF

    PUT https://api.ap1.datadoghq.com/api/v2/deletion/requests/{id}/cancelhttps://api.datadoghq.eu/api/v2/deletion/requests/{id}/cancelhttps://api.ddog-gov.com/api/v2/deletion/requests/{id}/cancelhttps://api.datadoghq.com/api/v2/deletion/requests/{id}/cancelhttps://api.us3.datadoghq.com/api/v2/deletion/requests/{id}/cancelhttps://api.us5.datadoghq.com/api/v2/deletion/requests/{id}/cancel

    Overview

    Cancels a data deletion request by providing its ID. This endpoint requires any of the following permissions:

  • rum_delete_data
  • logs_delete_data

  • Arguments

    Path Parameters

    Name

    Type

    Description

    id [required]

    string

    ID of the deletion request.

    Response

    OK

    The response from the cancel data deletion request endpoint.

    Expand All

    Field

    Type

    Description

    data

    object

    The created data deletion request information.

    attributes [required]

    object

    Deletion attribute for data deletion response.

    created_at [required]

    string

    Creation time of the deletion request.

    created_by [required]

    string

    User who created the deletion request.

    from_time [required]

    int64

    Start of requested time window, milliseconds since Unix epoch.

    indexes

    [string]

    List of indexes for the search. If not provided, the search is performed in all indexes.

    is_created [required]

    boolean

    Whether the deletion request is fully created or not.

    org_id [required]

    int64

    Organization ID.

    product [required]

    string

    Product name.

    query [required]

    string

    Query for creating a data deletion request.

    starting_at [required]

    string

    Starting time of the process to delete the requested data.

    status [required]

    string

    Status of the deletion request.

    to_time [required]

    int64

    End of requested time window, milliseconds since Unix epoch.

    total_unrestricted [required]

    int64

    Total number of elements to be deleted. Only the data accessible to the current user that matches the query and timeframe provided will be deleted.

    updated_at [required]

    string

    Update time of the deletion request.

    id [required]

    string

    The ID of the created data deletion request.

    type [required]

    string

    The type of the request created.

    meta

    object

    The metadata of the data deletion response.

    count_product

    object

    The total deletion requests created by product.

    <any-key>

    int64

    count_status

    object

    The total deletion requests created by status.

    <any-key>

    int64

    next_page

    string

    The next page when searching deletion requests created in the current organization.

    product

    string

    The product of the deletion request.

    request_status

    string

    The status of the executed request.

    {
      "data": {
        "attributes": {
          "created_at": "2024-01-01T00:00:00.000000Z",
          "created_by": "test.user@datadoghq.com",
          "from_time": 1672527600000,
          "indexes": [
            "index-1",
            "index-2"
          ],
          "is_created": true,
          "org_id": 321813,
          "product": "logs",
          "query": "service:xyz host:abc",
          "starting_at": "2024-01-01T02:00:00.000000Z",
          "status": "pending",
          "to_time": 1704063600000,
          "total_unrestricted": 100,
          "updated_at": "2024-01-01T00:00:00.000000Z"
        },
        "id": "1",
        "type": "deletion_request"
      },
      "meta": {
        "count_product": {
          "<any-key>": "integer"
        },
        "count_status": {
          "<any-key>": "integer"
        },
        "next_page": "cGFnZTI=",
        "product": "logs",
        "request_status": "canceled"
      }
    }

    Bad Request

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

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

    Precondition failed error

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

    {
      "errors": [
        "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]

    [string]

    A list of errors.

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

    Code Example

                      # Path parameters
    export id="CHANGE_ME"
    # Curl command
    curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/deletion/requests/${id}/cancel" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

    GET https://api.ap1.datadoghq.com/api/v2/deletion/requestshttps://api.datadoghq.eu/api/v2/deletion/requestshttps://api.ddog-gov.com/api/v2/deletion/requestshttps://api.datadoghq.com/api/v2/deletion/requestshttps://api.us3.datadoghq.com/api/v2/deletion/requestshttps://api.us5.datadoghq.com/api/v2/deletion/requests

    Overview

    Gets a list of data deletion requests based on several filter parameters. This endpoint requires any of the following permissions:

  • rum_delete_data
  • logs_delete_data

  • Arguments

    Query Strings

    Name

    Type

    Description

    next_page

    string

    The next page of the previous search. If the next_page parameter is included, the rest of the query elements are ignored.

    product

    string

    Retrieve only the requests related to the given product.

    query

    string

    Retrieve only the requests that matches the given query.

    status

    string

    Retrieve only the requests with the given status.

    page_size

    integer

    Sets the page size of the search.

    Response

    OK

    The response from the get data deletion requests endpoint.

    Expand All

    Field

    Type

    Description

    data

    [object]

    The list of data deletion requests that matches the query.

    attributes [required]

    object

    Deletion attribute for data deletion response.

    created_at [required]

    string

    Creation time of the deletion request.

    created_by [required]

    string

    User who created the deletion request.

    from_time [required]

    int64

    Start of requested time window, milliseconds since Unix epoch.

    indexes

    [string]

    List of indexes for the search. If not provided, the search is performed in all indexes.

    is_created [required]

    boolean

    Whether the deletion request is fully created or not.

    org_id [required]

    int64

    Organization ID.

    product [required]

    string

    Product name.

    query [required]

    string

    Query for creating a data deletion request.

    starting_at [required]

    string

    Starting time of the process to delete the requested data.

    status [required]

    string

    Status of the deletion request.

    to_time [required]

    int64

    End of requested time window, milliseconds since Unix epoch.

    total_unrestricted [required]

    int64

    Total number of elements to be deleted. Only the data accessible to the current user that matches the query and timeframe provided will be deleted.

    updated_at [required]

    string

    Update time of the deletion request.

    id [required]

    string

    The ID of the created data deletion request.

    type [required]

    string

    The type of the request created.

    meta

    object

    The metadata of the data deletion response.

    count_product

    object

    The total deletion requests created by product.

    <any-key>

    int64

    count_status

    object

    The total deletion requests created by status.

    <any-key>

    int64

    next_page

    string

    The next page when searching deletion requests created in the current organization.

    product

    string

    The product of the deletion request.

    request_status

    string

    The status of the executed request.

    {
      "data": [
        {
          "attributes": {
            "created_at": "2024-01-01T00:00:00.000000Z",
            "created_by": "test.user@datadoghq.com",
            "from_time": 1672527600000,
            "indexes": [
              "index-1",
              "index-2"
            ],
            "is_created": true,
            "org_id": 321813,
            "product": "logs",
            "query": "service:xyz host:abc",
            "starting_at": "2024-01-01T02:00:00.000000Z",
            "status": "pending",
            "to_time": 1704063600000,
            "total_unrestricted": 100,
            "updated_at": "2024-01-01T00:00:00.000000Z"
          },
          "id": "1",
          "type": "deletion_request"
        }
      ],
      "meta": {
        "count_product": {
          "<any-key>": "integer"
        },
        "count_status": {
          "<any-key>": "integer"
        },
        "next_page": "cGFnZTI=",
        "product": "logs",
        "request_status": "canceled"
      }
    }

    Bad Request

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    Field

    Type

    Description

    errors [required]

    [string]

    A list of errors.

    {
      "errors": [
        "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]

    [string]

    A list of errors.

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

    Code Example

                      # Curl command
    curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/deletion/requests" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"