Skip to content

Read the compiled policy

GET /v1/policy

OpenAPI protocol version: 1.0.0.

Return compiled rule objects, not the original policy source. Returns no_policy when no policy has been loaded.

Paths are relative to your instance URL. JSON request bodies require Content-Type: application/json.

HeaderBehavior
AuthorizationBearer API key for Cloud instances and Node servers configured with API keys. Node servers without API keys do not require this header.
Verdict-Read-ModeRead mode: local (default) or authoritative. Cloud selects the writer for authoritative reads. Replicated Node servers require the writer for authoritative reads. Standalone Node servers do not interpret this header.
Verdict-Min-RevisionOpaque observed revision token for a minimum-revision read. Use a token from the same instance. Supported by Cloud and replicated Node deployments; standalone Node servers do not interpret it.
Verdict-Session-IdCloud replica-selection affinity identifier, 1 to 128 ASCII letters, digits, underscores, or hyphens. This is not an authentication credential. Node servers do not interpret it.
Connect-Timeout-MsFor replicated Node reads, a positive numeric timeout in milliseconds caps the revision wait at 5000 ms; the default is 5000 ms. This is not a universal REST request deadline.

See common status codes and error bodies. Success responses and operation-specific exceptions are listed here.

StatusMeaning
200Successful response

Successful response header Verdict-Revision: Observed revision token on successful Cloud and replicated Node responses. Absent on standalone Node servers. Preserve the token unchanged for a minimum-revision read.

sourcestringoptional

Original policy source, absent when unavailable. Republish the policy to retain its source.

rulesarrayrequired

Compiled rule objects.

Array items
any value
View JSON Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": [
    "rules"
  ],
  "properties": {
    "source": {
      "type": "string",
      "description": "Original policy source, absent when unavailable. Republish the policy to retain its source."
    },
    "rules": {
      "type": "array",
      "items": {},
      "description": "Compiled rule objects."
    }
  },
  "additionalProperties": false
}
{
"rules": []
}