---
title: "Compile a PhiSQL policy."
method: POST
path: "/api/policies/compile"
tags: ["Policies"]
---

# Compile a PhiSQL policy.

`POST /api/policies/compile`

Compiles a policy authored in PhiSQL into the native Phileas policy format. The request body is PhiSQL source; the response carries the policy name and description and the compiled policy JSON, which can then be saved via POST /api/policies. Requires the `policies:read` scope.

## Headers

- `Authorization` string, required

## Response `200`

The policy compiled successfully.

- string

## Other responses

- `400` — The PhiSQL failed to parse/compile, or the compiled policy failed validation.
- `401` — The Authorization header is absent or the API key is not recognized.
- `413` — Content Too Large
- `415` — Unsupported Media Type
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/philterd/apis/philter-api.md) · [All operations](https://skmtc.net/philterd/apis/philter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/philterd/philter-api/versions/67443cd5a65b/schema)
