Policies
Update Policy
Update an existing policy.
Only provided fields will be updated. Omit fields to leave them unchanged. Preset policies cannot be modified. Requires admin role.
Raises: ResourceNotFoundError: If the policy does not exist. PresetPolicyModificationError: If attempting to modify a preset policy. AdminRequiredError: If user is not an admin.
Path Parameters
policy_id*string
Request Body
application/json
name?Name|Name
description?Description|Description
categories?|Categories
mode?Mode|Mode
pre_violation_threshold?Pre Violation Threshold|Pre Violation Threshold
pre_jb_threshold?Pre Jb Threshold|Pre Jb Threshold
post_violation_threshold?Post Violation Threshold|Post Violation Threshold
post_violation_jb_threshold?Post Violation Jb Threshold|Post Violation Jb Threshold
scanners_config?|Scanners Config
Response Body
application/json
application/json
curl -X PUT "https://api.grayswan.ai/policies/string" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"name": "string",
"description": "string",
"rules": {
"property1": "string",
"property2": "string"
},
"mode": "string",
"pre_violation_threshold": 0,
"pre_jb_threshold": 0,
"post_violation_threshold": 0,
"post_violation_jb_threshold": 0,
"scanners_config": {},
"is_preset": false,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}