---
title: Delete LLM Observability data
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > LLM Observability
---

# Delete LLM Observability data{% #delete-llm-observability-data %}
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 | POST https://api.ap1.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/llm-obs/deletion/data/llmobs      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/llm-obs/deletion/data/llmobs      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/llm-obs/deletion/data/llmobs  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs |

### Overview

Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range.

### Request

#### Body Data (required)

Data deletion request payload.

{% tab title="Model" %}

| Parent field         | Field                        | Type   | Description                                                                                              |
| -------------------- | ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
|                      | data [*required*]       | object | Data object for an LLM Observability data deletion request.                                              |
| data                 | attributes [*required*] | object | Attributes for an LLM Observability data deletion request.                                               |
| attributes           | delay                        | int64  | Optional delay in seconds before the deletion is executed.                                               |
| attributes           | from [*required*]       | int64  | Start of the deletion time range in milliseconds since Unix epoch.                                       |
| attributes           | query [*required*]      | object | Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter.       |
| additionalProperties | <any-key>                    | string |
| attributes           | to [*required*]         | int64  | End of the deletion time range in milliseconds since Unix epoch.                                         |
| data                 | type [*required*]       | enum   | Resource type for an LLM Observability data deletion request. Allowed enum values: `create_deletion_req` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "delay": 0,
      "from": 1705314600000,
      "query": {
        "<any-key>": "string"
      },
      "to": 1705315200000
    },
    "type": "create_deletion_req"
  }
}
```

{% /tab %}

### Response

{% tab title="202" %}
Accepted
{% tab title="Model" %}
Response containing details of a submitted LLM Observability data deletion request.

| Parent field | Field                        | Type      | Description                                                                                            |
| ------------ | ---------------------------- | --------- | ------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object    | Data object for an LLM Observability data deletion response.                                           |
| data         | attributes [*required*] | object    | Attributes of a submitted LLM Observability data deletion request.                                     |
| attributes   | created_at [*required*] | date-time | Timestamp when the deletion request was created.                                                       |
| attributes   | created_by [*required*] | string    | UUID of the user who created the deletion request.                                                     |
| attributes   | from_time [*required*]  | int64     | Start of the deletion time range in milliseconds since Unix epoch.                                     |
| attributes   | org_id [*required*]     | int64     | ID of the organization that submitted the deletion request.                                            |
| attributes   | product [*required*]    | string    | Product name for the deletion request.                                                                 |
| attributes   | query [*required*]      | string    | The query string used to select data for deletion.                                                     |
| attributes   | to_time [*required*]    | int64     | End of the deletion time range in milliseconds since Unix epoch.                                       |
| data         | id [*required*]         | string    | Unique identifier of the deletion request.                                                             |
| data         | type [*required*]       | enum      | Resource type for an LLM Observability data deletion response. Allowed enum values: `deletion_request` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "created_by": "user-uuid-1234",
      "from_time": 1705314600000,
      "org_id": 12345,
      "product": "llmobs",
      "query": "@trace_id:abc123def456",
      "to_time": 1705315200000
    },
    "id": "msg-abc123",
    "type": "deletion_request"
  }
}
```

{% /tab %}

{% /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="403" %}
Forbidden
{% 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 %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/llm-obs/deletion/data/llmobs" \
-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": 1705314600000,
      "query": {
        "query": "@trace_id:abc123def456"
      },
      "to": 1705315200000
    },
    "type": "create_deletion_req"
  }
}
EOF 
                
{% /tab %}
