---
title: "Check | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/preflight/web-api/check/"
---

# Check

> You can pass an array of preflight rules and a URL that link to a print file to check whether this file matches the rules. In the current implementation, you can use the **POST
> ~/api/rules/check** endpoint to check the following rules through this Web API:

-   ["colorspace"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#color-spaces)
-   ["spotcolors"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#spot-colors)
-   ["resolution"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#resolution)
-   ["sameorientation"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#page-orientation)
-   ["forbiddenfonts"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#forbidden-fonts)
-   ["allowedfonts"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#allowed-fonts)
-   ["fonttypes"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#font-types)
-   ["minfontsize"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#font-size)
-   ["textascurves"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#vector-text)
-   ["embeddedfonts"](https://customerscanvas.com/docs/on-premises/preflight/reference/rules.md#embedded-fonts)

## Request Payload

To validate your print file, you can pass its `name`, `resolution`, and required `rules` in the request body in the following format.

```json
{
    "file": "http://example.com/pt/api/files/get/425a3537-2e59-450d-bbc2-484fcd3d63bd.pdf",
    "dpi": 200,
    "rules": [
        {
            "type": "embeddedfonts"
        }
    ]
}
```

## Example call

```javascript
// The link to the print file.
const file = appUrl + "api/files/get/425a3537-2e59-450d-bbc2-484fcd3d63bd.pdf";
// Resolution of the print file.
const dpi = 300;
// The required color space and page orientation.
const rules = [
    {
        "type": "colorspace",
        "params": {
            "allowedColorSpaces": ["cmyk"]
        }
    },
    {
        "type": "sameorientation"
    }
];
// Check the file.
const check = async () => {
    const response = await fetch(appUrl + "api/rules/check", {
        method: "post",
        body: JSON.stringify({ dpi, file, rules }),
        headers: {
            'Content-Type': 'application/json'
        }
    });
    const result = await response.json();
    // Output the resulting array, where each element is an array of preflight results for a page.
    console.log(result);
}
```

## Success response

This endpoint returns an array, where each element corresponds to a page in the print file. These elements contain validation results. The result of validation of a one-page PDF file may look as follows:

```
Status Code: 200 OK
Content:
[
    [
        {
            name: "colorspace",
            result: false,
            expected: ["cmyk"],
            actual: ["rgb"]
        },
        {
            name: "sameorientation",
            result: true,
            expected: ["horizontal"],
            actual: []
        }
    ]
]
```
