---
title: "Create policy"
method: POST
path: "/v2/policy/create"
tags: ["Policy"]
---

# Create policy

`POST /v2/policy/create`

## Request body

- PolicyRequest
  - `cluster_id` string, required
  - `heartbeat_time` integer, required
  - `id` string, nullable
  - `job_filter` JobFilter
    - `namespace` string, nullable
    - `priority` integer, nullable
  - `policy_type` 'heartbeat'
  - `resource` 'pods' | 'namespace' | 'jobs'
  - `resource_ids` string[], required
  - `resource_name` string
  - `runc_root` string, nullable

## Response `200`

Policy created successfully

## Other responses

- `400` — Invalid request body
- `500` — Failed to create policy in policy table

---

[API](https://skmtc.dev/cedana/apis/cedana-api.md) · [All operations](https://skmtc.dev/cedana/apis/cedana-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cedana/cedana-api/revisions/f1a3fa319485/schema)
