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.
Deployment request headers
Section titled “Deployment request headers”| Header | Behavior |
|---|---|
Authorization | Bearer API key for Cloud instances and Node servers configured with API keys. Node servers without API keys do not require this header. |
Verdict-Read-Mode | Read 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-Revision | Opaque 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-Id | Cloud 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-Ms | For 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. |
Responses
Section titled “Responses”See common status codes and error bodies. Success responses and operation-specific exceptions are listed here.
| Status | Meaning |
|---|---|
| 200 | Successful 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.
200 JSON body
Section titled “200 JSON body”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
}Example response
Section titled “Example response”{ "rules": []}