Policies
Create Policy
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
name*string
Policy name
Length
1 <= length <= 255description?|
Policy description
categories?
Rule definitions (key -> description)
mode?|
Policy mode
Default
"content_moderation"pre_violation_threshold?|
Default
0.5pre_jb_threshold?|
Default
0.3post_violation_threshold?|
Default
0.5post_violation_jb_threshold?|
Default
0.3scanners_config?|
Response Body
application/json
application/json
curl -X POST "https://api.grayswan.ai/policies" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"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"
}
]
}