---
title: "Export Policy By Id"
method: GET
path: "/policies/{policy_id}/export"
---

# Export Policy By Id

`GET /policies/{policy_id}/export`

Export a single policy as JSON.

Returns the policy in a format suitable for import.

Docs: [Guide](https://docs.grayswan.ai/policy-management/policies) |
[API Reference](https://docs.grayswan.ai/api-reference/policies/export-policy-by-id)

Raises:
    ResourceNotFoundError: If the policy does not exist.

## Path parameters

- `policy_id` string, required

## Response `200`

Successful Response

- PolicyExportData — Single policy export format (excludes org-specific and internal fields).
  - `name` string, required
  - `description` string, nullable
  - `categories` object
  - `rule_modes` object
  - `mode` string, nullable
  - `pre_violation_threshold` number, nullable
  - `pre_jb_threshold` number, nullable
  - `post_violation_threshold` number, nullable
  - `post_violation_jb_threshold` number, nullable
  - `scanners_config` object, nullable
  - `block_message` string, nullable
  - `export_version` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/grayswan/apis/gray-swan-ai-api.md) · [All operations](https://skmtc.net/grayswan/apis/gray-swan-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grayswan/gray-swan-ai-api/versions/6ef1ea32ff13/schema)
