---
title: "Create or update a policy (sub)tree"
method: PUT
path: "/policy"
tags: ["policy"]
---

# Create or update a policy (sub)tree

`PUT /policy`

## Query parameters

- `replace` boolean
- `replace-with-labels` string[]

## Request body

- string

## Response `200`

Success

- Policy — Policy definition
  - `revision` integer — Revision number of the policy. Incremented each time the policy is changed in the agent's repository
  - `policy` string — Policy definition as JSON.

## Other responses

- `400` — Invalid policy
- `403` — Forbidden
- `460` — Invalid path
- `500` — Policy import failed

## Changes

- **2024-09-03** (v1) `5b32623f4b87` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/cilium/apis/cilium-api/changes/policy/put.md)

---

[API](https://skmtc.dev/cilium/apis/cilium-api.md) · [All operations](https://skmtc.dev/cilium/apis/cilium-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cilium/cilium-api/revisions/5b32623f4b87/schema)
