---
title: "Create or update an authz policy"
method: POST
path: "/authz/policies"
tags: ["authz-policies"]
---

# Create or update an authz policy

`POST /authz/policies`

(reserved for future use) Validates the Rego policy (compile + smoke test in an isolated sandbox) and registers it as a new active version, then syncs it to OPA.

Required scope: \`policy:authz:manage\`

## Request body

- CreateAuthzPolicyRequest
  - `name` string, required
  - `rego` string, required — Rego source. package must be qaip.authz.tenants["<tenant>"]["<name>"].
  - `description` string

## Response `201`

Policy created

- CreateAuthzPolicyResponse
  - `name` string, required
  - `version` integer, required
  - `rego_sha256` string, required
  - `warnings` string[], required

## Other responses

- `400` — Bad Request - the policy failed validation
- `401` — Unauthorized - Authentication failed
- `403` — Forbidden - the API key is missing the scope required by this endpoint
- `503` — Service Unavailable - authz/OPA is not configured in this environment

## Changes

> 65 revisions in range; 12 not diffed.

- **2026-06-17** `05add33422b2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/qlonolink/apis/qaip-apis/changes/authz/policies/post.md)

---

[API](https://skmtc.dev/qlonolink/apis/qaip-apis.md) · [All operations](https://skmtc.dev/qlonolink/apis/qaip-apis/llms.txt) · [OpenAPI document](https://skmtc.dev/qlonolink/apis/qaip-apis/revisions/430440bbcc56?raw)
