Update one policy while preserving its ID, evaluation position, and all omitted fields. Supply the fields to update in a single policy JSON object. At least one update field is required, and at most one rule field may be supplied.
Usage#
Flags#
Project ID or slug.
Application ID or slug.
Environment ID or slug.
Current policy ID from
gateway.listPolicies.Policy fields to update. Supported fields are name, enabled, match,
keyauth, ratelimit, firewall, openapi, and logging. Omitted fields
remain unchanged. Set match to null or an empty array to clear all match
expressions. Include at most one rule field.
Global Flags#
| Flag | Type | Description |
|---|---|---|
--root-key | string | Override root key ($UNKEY_ROOT_KEY) |
--api-url | string | Override API base URL (default: https://api.unkey.com) |
--config | string | Path to config file (default: ~/.unkey/config.toml) |
--output | string | Output format, use json for raw JSON |
--body | string | Send this JSON string as the request body. You cannot combine it with request-building flags. |
Examples#
See the API reference.