The XML Policy Management API allows users to create new XML validation policies in Glasswall Halo.

## Creating a new XML policy

### 1. Make a post request to the XML Policy Management API

To submit a new ICAP profile, send a post request to the `api/v1/xml-policies/<policy-name>` endpoint. Include a JSON request body that contains the policy. The policy name is specified as a path parameter.

**Example:**

```json
{
    "policySettings": {
        "EnableWarningHandling": false,
        "BlockedTags": [
            "/XInclude:include",
            "/XSL/Transform:stylesheet"
        ],
        "AllowedEncodings": [
            "utf-8",
            "utf-16",
            "iso-8859-1"
        ],
        "AllowEmptyEncoding": true,
        "AllowDoctypeInCData": false
    }
}
```

If the request body is valid, the response will contain a summary of the newly created policy.

### 2. Use the policy in the XML Validation API

Heading back to the XML Validation API, the saved policy can be utilised via the `policyName` query parameter.

Example post request:`/api/v1/validate-xml?policyName=<policy-name>`.

If desired, a dynamic policy can be used. Provide a JSON value to the multipart/form field labelled`policy`. If no policy name and no dynamic policy is specified, the default policy is used.

#### Learn more

[XML Policy Management API documentation](https://api.docs.glasswall.com/xml-validation-policy-v1#XML-policy-management-API)

[XML Validation API documentation](https://api.docs.glasswall.com/xml-validation-v1#XML-validation-API)