action openpolicy_post_compile { label: "Compile" description: "This API endpoint allows you to partially evaluate Rego queries and obtain a simplified version of the policy. The example below assumes that OPA has been given the following policy (use `PUT /v1/policies/{path}`):\n\n```yaml\npackage example\nallow {\n input.subject.clearance_level >= data.reports[_].clearance_level\n}\n```\nCompile API **request body** so that it contain the following fields:\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `query` | `string` | Yes | The query to partially evaluate and compile. |\n| `input` | `any` | No | The input document to use during partial evaluation (default: undefined). |\n| `unknowns` | `array[string]` | No | The terms to treat as unknown during partial evaluation (default: `[\"input\"]`]). |\n\nFor example:\n\n```json\n{\n \"query\": \"data.example.allow == true\",\n \"input\": {\n \"subject\": {\n \"clearance_level\": 4\n }\n },\n \"unknowns\": [\n \"data.reports\"\n ]\n}\n```\n### Partial evaluation\nIn some cases, the result of partial valuation is a conclusive, unconditional answer. See [the guidance](https://www.openpolicyagent.org/docs/latest/rest-api/#unconditional-results-from-partial-evaluation) for details." provider: openpolicy method: POST path: "/v1/compile" encoding: json input: { type: "object" } output: { type: "object" additionalProperties: true } }