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

# Exclude data schemas

PUT http://{hostname}/test-suite/v2/exclude/schemas
Content-Type: application/json

Various sub-schemas do not publish.

Reference: https://akamai.ferndocs.com/demo-apis/api/exclude-components-and-custom-syntax/exclude/put-exclude-schemas

## Request

### Query parameters

- `accountSwitchKey` (string, optional) — For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).

### Body (application/json)

This endpoint expects an object.

- `retain` (ExcludeSchemasPutRequestBodyContentApplicationJsonSchemaRetain, optional) — This publishes in doc.

## Response

### 200

Successful response.

- `retain` (ExcludeSchemasPutResponsesContentApplicationJsonSchemaRetain, optional) — This publishes in doc.

## Types

### ExcludeSchemasPutRequestBodyContentApplicationJsonSchemaRetain

This publishes in doc.

- `excludeAlternators` (ExcludeSchemasPutRequestBodyContentApplicationJsonSchemaRetainExcludeAlternators, optional)
- `retainString` (string, optional) — This boolean schema doesn't publish in doc.

### ExcludeSchemasPutResponsesContentApplicationJsonSchemaRetain

This publishes in doc.

- `excludeAlternators` (ExcludeSchemasPutResponsesContentApplicationJsonSchemaRetainExcludeAlternators, optional)
- `retainString` (string, optional) — This boolean schema doesn't publish in doc.

### ExcludeSchemasPutRequestBodyContentApplicationJsonSchemaRetainExcludeAlternators

### ExcludeSchemasPutResponsesContentApplicationJsonSchemaRetainExcludeAlternators

### retain this harpo scenario

- `marxBrother` (enum, optional) — Choice is `harpo`.
  - Allowed values: `harpo`

### retain this harpo scenario

- `marxBrother` (enum, optional) — Choice is `harpo`.
  - Allowed values: `harpo`

## Examples

**Request**

```json
{
  "retain": {
    "excludeAlternators": {
      "marxBrother": "harpo"
    },
    "retainString": "enabled"
  },
  "bar": false,
  "foo": true
}
```

**Response**

```json
{
  "retain": {
    "excludeAlternators": {
      "marxBrother": "harpo"
    },
    "retainString": "enabled"
  },
  "bar": false,
  "foo": true
}
```

**SDK Code**

```python
import requests

url = "http://{hostname}/test-suite/v2/exclude/schemas"

payload = {
    "retain": {
        "excludeAlternators": { "marxBrother": "harpo" },
        "retainString": "enabled"
    },
    "bar": False,
    "foo": True
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'http://{hostname}/test-suite/v2/exclude/schemas';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"retain":{"excludeAlternators":{"marxBrother":"harpo"},"retainString":"enabled"},"bar":false,"foo":true}'
};

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 := "http://{hostname}/test-suite/v2/exclude/schemas"

	payload := strings.NewReader("{\n  \"retain\": {\n    \"excludeAlternators\": {\n      \"marxBrother\": \"harpo\"\n    },\n    \"retainString\": \"enabled\"\n  },\n  \"bar\": false,\n  \"foo\": true\n}")

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

	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("http://{hostname}/test-suite/v2/exclude/schemas")

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

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"retain\": {\n    \"excludeAlternators\": {\n      \"marxBrother\": \"harpo\"\n    },\n    \"retainString\": \"enabled\"\n  },\n  \"bar\": false,\n  \"foo\": true\n}"

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("http://{hostname}/test-suite/v2/exclude/schemas")
  .header("Content-Type", "application/json")
  .body("{\n  \"retain\": {\n    \"excludeAlternators\": {\n      \"marxBrother\": \"harpo\"\n    },\n    \"retainString\": \"enabled\"\n  },\n  \"bar\": false,\n  \"foo\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://{hostname}/test-suite/v2/exclude/schemas', [
  'body' => '{
  "retain": {
    "excludeAlternators": {
      "marxBrother": "harpo"
    },
    "retainString": "enabled"
  },
  "bar": false,
  "foo": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("http://{hostname}/test-suite/v2/exclude/schemas");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"retain\": {\n    \"excludeAlternators\": {\n      \"marxBrother\": \"harpo\"\n    },\n    \"retainString\": \"enabled\"\n  },\n  \"bar\": false,\n  \"foo\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "retain": [
    "excludeAlternators": ["marxBrother": "harpo"],
    "retainString": "enabled"
  ],
  "bar": false,
  "foo": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://{hostname}/test-suite/v2/exclude/schemas")! 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()
```