> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Delete Project DLP Settings

DELETE https://api-gateway.merge.dev/v1/projects/{project_id}/dlp-settings

Clear the override so the project inherits the organization's DLP rules
as a whole.

Needs `manage_security_rules` or `manage_projects`.

Reference: https://docs.merge.dev/merge-gateway/management-api/security-rules/delete-project-dlp-settings

## Authentication

- `Authorization` header (bearer token, required) — A management key (`mgmt_...`), sent as `Authorization: Bearer <key>`. Reading /v1/routing-policies also accepts the organization's gateway API keys; writing there needs a management key.

## Request

### Path parameters

- `project_id` (string, required) — The project's `id`.

## Response

### 200

The project's DLP settings, now all inherited from the organization

- `entities` (list of ProjectDLPEntityStateV1, required) — Every entity type in the organization's rules, with the project's override applied.
- `override` (map from string to DLPEntityOverrideV1, required) — What the project sets, keyed by entity type. Entity types it doesn't set are absent.

## Errors

### 401 Unauthorized Error

The key is missing or invalid.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 403 Forbidden Error

The key lacks the scope this route needs, or the change is not allowed.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 404 Not Found Error

The resource does not exist in the key's organization.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 502 Bad Gateway Error

The gateway could not be updated. Retrying the same request is safe.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

## Types

### ProjectDLPEntityStateV1

How one entity type resolves for the project.

- `category` (string, required) — `custom` for the organization's own rules; `global` and `usa` are seeded.
- `entity_type` (string, required) — The entity type, like `US_SSN`.
- `is_seeded` (boolean, required) — Whether the entity type comes from the seeded catalog.
- `overridden` (boolean, required) — Whether the project overrides this entity type.
- `display_name` (string, optional, nullable) — The name the dashboard shows.
- `effective_action` (string, optional, nullable) — What the project does with it after its override. Null means not scanned.
- `org_action` (string, optional, nullable) — What the organization's rule does with it. Null means not scanned. `log` records a match and sends the prompt unchanged, `redact` replaces each match with a placeholder such as `<US_SSN>` before the prompt is sent, and `block` refuses the request with 422.

### DLPEntityOverrideV1

What the project does with one entity type. A field left null inherits the organization's rule.

- `action` (enum, optional, nullable) — `log` records a match and sends the prompt unchanged, `redact` replaces each match with a placeholder such as `<US_SSN>` before the prompt is sent, and `block` refuses the request with 422.
  - Allowed values: `log`, `redact`, `block`
- `enabled` (boolean, optional, nullable) — Whether the project scans for this entity.

### ErrorResponseDetail

A message, or an object with a `code` to branch on and a `message`.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ErrorDetail

A structured error. Some carry extra fields, like `count`.

- `code` (string, required) — A stable code to branch on, like `payment_method_required`.
- `message` (string, required) — A human-readable explanation.

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "entities": [
    {
      "category": "global",
      "entity_type": "EMAIL_ADDRESS",
      "is_seeded": true,
      "overridden": true,
      "display_name": "EMAIL_ADDRESS",
      "effective_action": "block",
      "org_action": "redact"
    },
    {
      "category": "global",
      "entity_type": "DATE_TIME",
      "is_seeded": true,
      "overridden": true,
      "display_name": "DATE_TIME",
      "effective_action": null,
      "org_action": "log"
    },
    {
      "category": "global",
      "entity_type": "CREDIT_CARD",
      "is_seeded": true,
      "overridden": false,
      "display_name": "CREDIT_CARD",
      "effective_action": "redact",
      "org_action": "redact"
    }
  ],
  "override": {
    "DATE_TIME": {
      "enabled": false
    },
    "EMAIL_ADDRESS": {
      "action": "block",
      "enabled": true
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/projects/project_id/dlp-settings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```