---
title: Delete an AI Gateway data capture override
description: Delete an override using its revision and the current configuration_revision.
breadcrumbs: Docs > API > Delete an AI Gateway data capture override
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Delete an AI Gateway data capture override

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in Preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                            |
| ----------------- | ----------------------------------------------------------------------- |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/data-capture/overrides/{id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/data-capture/overrides/{id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/data-capture/overrides/{id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/data-capture/overrides/{id}      |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/data-capture/overrides/{id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/data-capture/overrides/{id} |
| uk1.datadoghq.com | DELETE https://api.uk1.datadoghq.com/api/v2/data-capture/overrides/{id} |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/data-capture/overrides/{id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/data-capture/overrides/{id}  |

### Overview

Delete an override using its `revision` and the current `configuration_revision`. If deleting the override can enable full capture for affected traffic, set `confirm_full_capture` to `true`. Returns HTTP 409 when `configuration_revision` or the override `revision` is stale, including a concurrent change during deletion. Missing revisions or required full-capture confirmation returns HTTP 400.

This endpoint requires the `ai_gateway_config_write` permission.

OAuth apps require the `ai_gateway_config_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#ai-gateway) to access this endpoint.

### Arguments

#### Path Parameters

| Field           | Type   | Description               |
| --------------- | ------ | ------------------------- |
| id [*required*] | string | Data capture override ID. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field         | Field                               | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------- | ----------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | data [*required*]                   | object  | Override identifier, revisions, and confirmation required for deletion.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| data                 | attributes [*required*]             | object  | Revisions and confirmation used to delete the override.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| attributes           | configuration_revision [*required*] | string  | Opaque revision of the organization default and all overrides. Writes require the revision returned by a current read or preview.                                                                                                                                                                                                                                                                                                                                                                                       |
| attributes           | confirm_full_capture                | boolean | Set to `true` to confirm a change that can enable full capture, including a deletion that causes a `full_capture` override or the organization default to apply.                                                                                                                                                                                                                                                                                                                                                        |
| attributes           | mode                                | enum    | Capture mode for matching traffic. Allowed enum values: `metadata_only`, `full_capture`.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes           | name                                | string  | Display name of the override. Names need not be unique; identify overrides by `id`.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes           | operation                           | enum    | Proposed operation for preview. Write endpoints infer it from the HTTP method. Allowed enum values: `create`, `replace`, `delete`.                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes           | revision [*required*]               | int64   | Current override revision, required for replacement or deletion.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes           | scope                               | object  | All selected filters combine with AND, with one value per filter. The `model` and `provider` tags apply to each actual direct or routed attempt, including fallback destinations. Routes are not selectable filters. At least one filter is required. If any matching override uses `metadata_only`, that mode applies. Otherwise, if any matching override uses `full_capture`, that mode applies. The organization default applies only when no override matches. Overrides have no priority or specificity ordering. |
| scope                | tags                                | object  | Exact-match request tags with lowercase keys. The reserved `model` tag is the canonical model ID, and the reserved `provider` tag is the configured connection slug. The server sets both. Custom tags come from `x-dd-tag` headers. Keys and values must not have leading or trailing white space. Values are case-sensitive.                                                                                                                                                                                          |
| additionalProperties | <any-key>                           | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| scope                | team_id                             | uuid    | UUID of a Datadog team. Matches the authorized team selected by the `x-ai-gateway-team` request header. Requests without this header do not match team-scoped overrides. Open-membership teams cannot scope overrides.                                                                                                                                                                                                                                                                                                  |
| scope                | user_id                             | uuid    | Authenticated Datadog user UUID in this organization.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| data                 | id [*required*]                     | uuid    | UUID of the override to delete. Must match the `id` path parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| data                 | type [*required*]                   | enum    | Data capture overrides resource type. Allowed enum values: `data-capture-overrides`. Default: `data-capture-overrides`.                                                                                                                                                                                                                                                                                                                                                                                                 |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "configuration_revision": "capture-revision-1",
      "confirm_full_capture": false,
      "mode": "metadata_only",
      "name": "Research",
      "operation": "create",
      "revision": 1,
      "scope": {
        "tags": {
          "<any-key>": "string"
        },
        "team_id": "string",
        "user_id": "string"
      }
    },
    "id": "11111111-1111-4111-8111-111111111111",
    "type": "data-capture-overrides"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="204" %}
No Content
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="409" %}
Conflict

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, 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 DELETE "https://api.${DD_SITE}/api/v2/data-capture/overrides/${id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "configuration_revision": "capture-revision-1",
      "mode": "metadata_only",
      "name": "Research",
      "operation": "create",
      "revision": 1,
      "scope": {
        "tags": {
          "env": "prod"
        }
      }
    },
    "id": "11111111-1111-4111-8111-111111111111",
    "type": "data-capture-overrides"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
