Policies

Create Policy

POST
/policies

Create a new policy.

The policy will be created under the organization associated with the API key. Requires admin role.

Docs: Guide | API Reference

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for creating a new policy.

Response Body

application/json

application/json

curl -X POST "https://example.com/policies" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "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"}