API referenceModeration
POST /moderation/rules
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/moderation/rules" \ -H "Content-Type: application/json" \ -d '{ "action": "allow", "detector": "string", "name": "string" }'{ "$schema": "https://example.com/schemas/RuleDTO.json", "action": "string", "createdAt": "string", "detector": "string", "enabled": true, "name": "string", "pattern": "string", "ruleId": "string", "target": "string"}action*string
Value in
- "allow"
- "redact"
- "block"
- "flag"
detector*string
builtin detector name, or 'regex'/'keyword'/'tool_name'/'tool_arg'
name*string
Length
1 <= length <= 120pattern?string
regex/keyword; tool name for tool_name; a JSON-path expression for tool_arg (e.g. 'amount > 10000', 'account =~ ^ext-')
target?string
which part of the loop to evaluate (default request)
Value in
- "request"
- "response"
- "tool_call"