Upload or replace OPA policy
opa_put_policyUpload a Rego policy under a given ID, replacing any existing policy. OPA compiles it on the server; invalid policies return errors and are not stored.
Instructions
Upload a Rego policy under the given ID. Replaces any existing policy with that ID; replaced says whether one existed. The policy is uploaded as raw text/plain and OPA compiles it on the server, so a policy that does not compile comes back as INVALID_REGO with OPA's errors, and nothing is stored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Policy ID to create or replace. | |
| source | Yes | Rego source. |