> 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.

# Update customer DLP settings

PUT https://api-gateway.merge.dev/v1/customers/{customer_id}/dlp-settings
Content-Type: application/json

Replaces the customer's DLP override as a whole, keyed by entity type. Each entity must already exist for the organization. Changes propagate to request enforcement within about 60 seconds. Requires the customer_guardrails feature; without it the request is rejected with a 403.

Reference: https://docs.merge.dev/merge-gateway/embedded-routing/guardrails/update-customer-dlp-settings

## Authentication

- `Authorization` header (bearer token, required) — Your production key sent as a bearer token.

## Request

### Path parameters

- `customer_id` (string, required)

### Body (application/json)

This endpoint expects a CustomerDlpOverrideRequest.

- `override` (map from string to DlpEntityOverride, required) — Overrides keyed by entity type. Each entity must already exist in the organization's catalog, either as a seeded rule or a custom one; an unknown type is rejected with a 422 naming it

## Response

### 200

Successful Response

- `override` (map from string to DlpEntityOverride, optional) — What this customer sets, keyed by entity type. Keys the customer does not set are absent, and unset halves come back null
- `entities` (list of CustomerDlpEntityState, optional) — Every entity in the organization's catalog, with the merge applied

## Types

### DlpEntityOverride

A project's override for one entity type. Both fields are optional; omit one to inherit that half from the organization's rule.

- `enabled` (boolean, optional, nullable) — Whether this entity is scanned for this project
- `action` (enum, optional, nullable) — What to do on a match
  - Allowed values: `log`, `redact`, `block`

### CustomerDlpEntityState

How one entity type resolves for a customer.

- `entity_type` (string, optional)
- `display_name` (string, optional, nullable)
- `category` (string, optional)
- `is_seeded` (boolean, optional) — Whether this entity comes from the seeded rule set
- `org_action` (string, optional, nullable) — What the organization does with it. Null means not scanned
- `effective_action` (string, optional, nullable) — What this customer does with it after its override. Null means not scanned
- `overridden` (boolean, optional) — Whether the customer overrides this entity

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "override": {},
  "entities": [
    {
      "entity_type": "string",
      "display_name": "string",
      "category": "string",
      "is_seeded": true,
      "org_action": "string",
      "effective_action": "string",
      "overridden": true
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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/customers/customer_id/dlp-settings")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.put("https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/customers/customer_id/dlp-settings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```