---
title: "Replace Policy"
method: PUT
path: "/api/v1/policy"
---

# Replace Policy

`PUT /api/v1/policy`

## Request

- Base URL: `https://api.stacktrace.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stacktrace.ai/api/v1/policy`
- Auth: none declared

Replace the policy's entries, or, from today's console, its document and
detection entries; then publish all three at the next revision (policy
entries spec, "Writes"). The four admission lists are the catalog's
decisions, never the draft's, so a draft read before a decision cannot
undo it.

## Headers

- `authorization` string, nullable

## Request body

- PolicyUpdateRequest
  - `expected_revision` integer, required
  - `document` object, nullable
  - `detection_rules` DetectionRuleIn[], nullable
    - `id` string, uuid, nullable
    - `name` string, required
    - `trigger` DetectionTrigger, required
      - `rule_id` string, required
      - `params` object, required
    - `action` 'block' | 'allow', required
    - `notify` boolean, required
  - `entries` PolicyEntryIn[], nullable
    - `id` string, uuid, nullable
    - `name` string, required
    - `rule_id` string, required
    - `params` object, required
    - `action` 'block' | 'allow', required
    - `notify` boolean, required
  - `known_rule_ids` string[], nullable

## Response `200`

Successful Response

- OrganizationPolicyResponse

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stacktrace/apis/stacktrace-fleet-api.md) - [All operations](https://skmtc.dev/stacktrace/apis/stacktrace-fleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stacktrace/apis/stacktrace-fleet-api/revisions/0ee5484d1d0b?raw)
