Skip to main content
PATCH
Partial update of a policy

Authorizations

Authorization
string
header
required

An Earnie API key, sent as Authorization: Bearer sk_earnie_.... Create one under Settings > API keys. The key's scopes decide which operations it may call.

Headers

If-Match
string
required

The policy revision the caller last read. Required: a policy mutation is never last-write-wins. Omitted → 428 precondition_required; no longer current → 409 policy_conflict.

The bare digest, its quoted form and its weak form all mean the same revision. * is refused with 409 rather than honoured as "any current representation", which would be exactly the unconditional write this exists to prevent. A comma-separated list of entity tags is refused with 400: a policy has one current revision, so offering several is not meaningful here, and saying so beats answering 409 for a request that was not understood.

Path Parameters

id
integer<int64>
required

Body

application/json

PATCH semantics. Presence of any of expression / parameter_spec classifies the request as authoring (recompile + revalidate, audit policy.expression_updated). Otherwise the request is a tweak (no recompile, audit policy.values_updated). Omitted fields are left unchanged.

name
string | null
description
string | null
agent_rule
string | null

The imperative sentence an AI coding agent reads instead of the CEL (see Policy.agent_rule). A tweak, never authoring: it changes no gating content, so it neither recompiles the expression nor moves the policy revision.

category
string | null

Grouping within a scanner (e.g. licenses, vulnerabilities). Mutable — users can re-categorize a policy from the editor. Treated as a tweak (no recompile, no audit beyond the standard policy.values_updated).

enabled
boolean | null
action
enum<string> | null

Enforcement action applied when the policy fires. Verdict mapping: block → block warn → warn require → require

Available options:
block,
warn,
require
values
object | null
expression
string | null
parameter_spec
object[] | null

Response

Updated

policy
object
required
change_kind
enum<string>
required
Available options:
tweak,
authoring