Policies

Update Policy

PUT
/policies/{policy_id}

Update an existing policy.

Only provided fields will be updated. Omit fields to leave them unchanged. Preset policies cannot be modified. Requires admin role.

Docs: Guide | API Reference

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*Policy Id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for updating an existing policy (all fields optional).

Response Body

application/json

application/json

curl -X PUT "https://example.com/policies/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "description": "string",  "rules": {    "property1": "string",    "property2": "string"  },  "rule_modes": {    "property1": "block",    "property2": "block"  },  "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"}