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

# Clear customer controls

DELETE https://api-gateway.merge.dev/v1/customers/{customer_id}/controls

Clears the override so the customer inherits the organization's controls again.

Reference: https://docs.merge.dev/merge-gateway/embedded-routing/controls/delete-customer-controls

## Authentication

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

## Request

### Path parameters

- `customer_id` (string, required)

## Response

### 200

The (now empty) override and the effective controls.

- `scope` (string, optional)
- `scope_id` (string, optional)
- `override` (CustomerControlsOverride, optional) — Exactly what this scope stores, unit-wrapped: `zero_data_retention`, `vendors` \{ignored\_vendors, allowed\_vendors, vendor\_routing\_preference}, `regions` \{ignored\_regions, allowed\_regions}. Empty means it inherits everything.
- `effective` (CustomerControlsEffective, optional) — The controls actually in force for the scope: the organization's with this scope's units applied. For a customer, a project is not folded in; at request time a customer override still wins over a project's.
- `sources` (map from string to string, optional) — Per unit (`zero_data_retention`, `vendors`, `regions`), which scope supplied the effective value: `org` or this scope

## Types

### CustomerControlsOverride

Exactly what this scope stores, unit-wrapped: `zero_data_retention`, `vendors` \{ignored\_vendors, allowed\_vendors, vendor\_routing\_preference}, `regions` \{ignored\_regions, allowed\_regions}. Empty means it inherits everything.

### CustomerControlsEffective

The controls actually in force for the scope: the organization's with this scope's units applied. For a customer, a project is not folded in; at request time a customer override still wins over a project's.

## Examples

**Response**

```json
{
  "scope": "customer",
  "scope_id": "string",
  "override": {
    "vendors": {
      "allowed_vendors": [
        "openai",
        "bedrock"
      ],
      "ignored_vendors": [],
      "vendor_routing_preference": []
    }
  },
  "effective": {
    "allowed_regions": [
      "NA"
    ],
    "allowed_vendors": [
      "openai",
      "bedrock"
    ],
    "ignored_regions": [],
    "ignored_vendors": [],
    "vendor_routing_preference": [],
    "zero_data_retention": true
  },
  "sources": {
    "regions": "org",
    "vendors": "customer",
    "zero_data_retention": "org"
  }
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/customers/customer_id/controls';
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/customers/customer_id/controls"

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

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/customers/customer_id/controls")
  .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/customers/customer_id/controls', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/customers/customer_id/controls");
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/customers/customer_id/controls")! 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()
```