Skip to content

Create or replace a stored policy (`policy`).

PUT
/v1/policies/{name}
curl --request PUT \
--url https://ferritor.example.internal:7070/v1/policies/example \
--header 'Content-Type: application/json' \
--data '{ "actions": [ "read" ], "all_paths": true, "description": "example", "expected_version": 1, "identity": "example", "paths": [ "example" ] }'
name
required
string

A stored policy’s name (secret-path rules, may contain /), or config:… for a config rule.

Media typeapplication/json

A stored policy to create or replace; its name is the path’s.

object
actions
required
Array<string>
>= 1 items
Allowed values: read write delete list label
all_paths
boolean
description

What it’s for (printable ASCII, newlines and tabs; at most 1 KiB).

string
expected_version

Check-and-set: 0 only creates; N only replaces version N.

integer | null format: int32
identity
required

The <name> of a ferritor://<name> identity, or <prefix>/* for every identity below the prefix.

string
paths

Path prefixes, whole segments; exactly one of paths and all_paths.

Array<string>
<= 64 items

Stored.

Media typeapplication/json
object
created
required

False: it replaced an existing policy.

boolean
revision
required

The stored set’s revision now.

integer format: int64
version
required
integer format: int32

Example generated

{
"created": true,
"revision": 1,
"version": 1
}

An error: see error.code.

Media typeapplication/json

Every error’s body.

object
error
required
object
code
required

Match on this, never on the message.

string
Allowed values: invalid_argument unauthenticated permission_denied not_found method_not_allowed version_mismatch live_version no_namespace unknown_profile busy aborted misdirected_request sealed unaudited unknown_kek policy_unverified rate_limited unavailable failed_precondition internal
message
required

For people; may change.

string

Example

{
"error": {
"code": "invalid_argument"
}
}