---
title: "PUT /workspaces/{workspace}/policies/{policy}/"
method: PUT
path: "/workspaces/{workspace}/policies/{policy}/"
tags: ["workspaces"]
---

# PUT /workspaces/{workspace}/policies/{policy}/

`PUT /workspaces/{workspace}/policies/{policy}/`

Update a policy.

## Path parameters

- `policy` string, required
- `workspace` string, required

## Request body

- Policy
  - `created_at` string, date-time, required — The date and time the policy was created.
  - `description` string, nullable — The description of the Policy.
  - `name` string, required — The name of the Policy.
  - `rego` string, required — The rego code which constitutes the Policy logic.
  - `enabled` boolean — If true, the policy is enabled.
  - `is_terminal` boolean — If true and the policy matches, no further policies are evaluated.
  - `read_only` boolean, required — Whether this policy is read-only (only specific variables can be updated).
  - `slug_perm` string, required — The Policy identifier.
  - `updated_at` string, date-time, required — The date and time the policy was updated.
  - `version` integer, required — The version of the rego code.
  - `precedence` integer — The order in which this policy is evaluated relative to other policies.

## Response `200`

- Policy
  - `created_at` string, date-time, required — The date and time the policy was created.
  - `description` string, nullable — The description of the Policy.
  - `name` string, required — The name of the Policy.
  - `rego` string, required — The rego code which constitutes the Policy logic.
  - `enabled` boolean — If true, the policy is enabled.
  - `is_terminal` boolean — If true and the policy matches, no further policies are evaluated.
  - `read_only` boolean, required — Whether this policy is read-only (only specific variables can be updated).
  - `slug_perm` string, required — The Policy identifier.
  - `updated_at` string, date-time, required — The date and time the policy was updated.
  - `version` integer, required — The version of the rego code.
  - `precedence` integer — The order in which this policy is evaluated relative to other policies.

## Changes

> 13 revisions in range; 3 could not be searched.

- **2026-07-26** `3f44fa7d59b0` — 2 info
  - the endpoint scheme security `apikey` was removed from the API
  - the endpoint scheme security `basic` was removed from the API

[Change history](https://skmtc.dev/cloudsmith/apis/cloudsmith-api/changes/workspaces/:workspace/policies/:policy/put.md)

---

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