Skip to main content

Policies

Versioned weights and thresholds; the digest of the active version is on every record.

MethodPathScopeSummary
GET/policiesreadList Policies
POST/policiesadminCreate Policy

Try it

curl -sf -H "Authorization: Bearer $VIGIL_KEY" "$VIGIL_URL/policies"

Routes

GET /policies

List Policies. Scope: read.

Every version for the org, newest first. Exactly one is active.

Response 200:

[
{
"id": 0,
"version": 0,
"weights": {
"<key>": 0
},
"thresholds": {
"<key>": 0
},
"detectors": {},
"digest": "string",
"active": true,
"created_by": "string",
"created_at": "string"
}
]

POST /policies

Create Policy. Scope: admin.

Request body:

{
"weights": {
"<key>": 0
},
"thresholds": {
"<key>": 0
},
"detectors": {},
"created_by": "string | null"
}
FieldTypeRequiredNotes
weightsWeightsyes
thresholdsThresholdsyes
detectorsobject | nullno
created_bystring | nullno

Response 200:

{
"id": 0,
"version": 0,
"weights": {
"<key>": 0
},
"thresholds": {
"<key>": 0
},
"detectors": {},
"digest": "string",
"active": true,
"created_by": "string",
"created_at": "string"
}

Generated from openapi.json (VIGIL 0.2.0). Scopes follow the router dependencies in VIGIL_SPEC.md section 4.2.