---
title: "Update policy"
method: PUT
path: "/policies/{id}"
tags: ["policies"]
---

# Update policy

`PUT /policies/{id}`

## Request

- Base URL: `https://api.instruxi.dev/api/v1/enforcer`
- URL: `https://api.instruxi.dev/api/v1/enforcer/policies/{id}`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-API-Key`

Recompiles the stored Rego source in place, same untrusted-code constraints as createPolicy. Write access is role-gated, not ownership-gated: tenant_write for the policy's own tenant, cross_tenant (admin) for a global one — the row's creator (created_by) is provenance only and grants no standing write access, unlike the normal "write your own row" baseline, because a policy is executable authorization logic other tenants may consume.

## Path parameters

- `id` string, required

## Request body

- EnforcerV3InternalUsecasePoliciesWriteInput
  - `active` boolean: Active defaults to true on create; on update it is applied as given.
  - `description` string
  - `name` string
  - `source` string
  - `tenant_id` string: TenantID targets a tenant-scoped policy (admin may target any tenant; a tenant_admin is always pinned to their own). Empty = a global policy (admin only).

## Response `200`

OK

- InternalDeliveryHttpHandlerPolicyResponse
  - `data` EnforcerV3InternalDomainPolicyPolicy
    - `active` boolean
    - `created_at` string
    - `created_by` string
    - `description` string
    - `id` string
    - `name` string
    - `source` string
    - `source_sha` string
    - `tenant_id` string: nil = global
    - `updated_at` string
  - `success` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/instruxi/apis/enforcer-api.md) · [All operations](https://skmtc.dev/instruxi/apis/enforcer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/instruxi/apis/enforcer-api/revisions/fa82bc1becc0?raw)
