Policies
Create Policy
Create a new policy.
The policy will be created under the organization associated with the API key. Requires admin role.
Request Body
application/json
name*string
Policy name
Length
1 <= length <= 255description?Description|Description
Policy description
categories?
Rule definitions (key -> description)
mode?Mode|Mode
Policy mode
Default
"content_moderation"pre_violation_threshold?Pre Violation Threshold|Pre Violation Threshold
Default
0.5pre_jb_threshold?Pre Jb Threshold|Pre Jb Threshold
Default
0.3post_violation_threshold?Post Violation Threshold|Post Violation Threshold
Default
0.5post_violation_jb_threshold?Post Violation Jb Threshold|Post Violation Jb Threshold
Default
0.3scanners_config?|Scanners 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"
}
]
}