Policies

Export Policy By Id

Export a single policy as JSON.

Returns the policy in a format suitable for import.

Raises: ResourceNotFoundError: If the policy does not exist.

GET
/policies/{policy_id}/export

Path Parameters

policy_id*string

Response Body

application/json

application/json

curl -X GET "https://api.grayswan.ai/policies/string/export"
{
  "name": "string",
  "description": "string",
  "categories": {
    "property1": "string",
    "property2": "string"
  },
  "mode": "content_moderation",
  "pre_violation_threshold": 0.5,
  "pre_jb_threshold": 0.3,
  "post_violation_threshold": 0.5,
  "post_violation_jb_threshold": 0.3,
  "scanners_config": {},
  "export_version": "1.0"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}