> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kernite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Policy Check API

> POST /policy/check and POST /v1/policy/check.

Check OpenAPI write-operation coverage against Kernite `x-kernite` contract and optional generated artifacts.

For CI/CD pipeline usage patterns, see `/integrations/ci-cd-policy-check`.

Endpoints:

* `POST /policy/check`
* `POST /v1/policy/check`

## Request

```json theme={null}
{
  "openapi": {},
  "mapping": {},
  "bundle": {},
  "options": {
    "strict": true
  }
}
```

Fields:

* `openapi` (required): OpenAPI 3.x JSON object
* `mapping` (optional): generated mapping artifact (`kernite.policy.mapping.v1`)
* `bundle` (optional): generated bundle artifact (`kernite.policy.bundle.v1`)
* `options.strict` (optional, default `true`): when true, uncovered governance fails validation

## Response

```json theme={null}
{
  "ctx_id": "ctx_...",
  "message": "Schema coverage check failed.",
  "data": {
    "valid": false,
    "summary": {
      "write_operations": 1,
      "violations": 1,
      "warnings": 0,
      "strict": true
    },
    "violations": [],
    "warnings": []
  }
}
```

## Violation Codes

* `missing_x_kernite`
* `invalid_x_kernite_field`
* `missing_policy_key`
* `mapping_missing_operation`
* `bundle_missing_policy`
* `unsupported_openapi_shape`
