---
title: "Import Policy"
method: POST
path: "/policies/import"
---

# Import Policy

`POST /policies/import`

Import a single policy from JSON.

IDs from the import are ignored; a new ID will be generated.
Requires admin role.

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

## Request body

- PolicyImportRequest — Request body for importing a single policy.
  - `policy` PolicyExportData, required — 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

## Response `201`

Successful Response

- PolicyDetailResponse — Full policy response with all fields.
  - `id` string, required
  - `name` string, required
  - `description` string, nullable
  - `rules` object, required
  - `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
  - `is_preset` boolean
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable

## 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/revisions/6ef1ea32ff13/schema)
