---
title: "Create Policy"
method: POST
path: "/api/policies"
tags: ["policies"]
---

# Create Policy

`POST /api/policies`

## Request

- Base URL: `https://www.gateco.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://www.gateco.ai/api/policies`
- Auth: OAuth 2 (password, token URL `/api/auth/login`)

## Request body

- CreatePolicyRequest
  - `name` string, required
  - `description` string, nullable
  - `type` string, required
  - `effect` string, required
  - `resource_selectors` object[], nullable
  - `rules` PolicyRuleRequest[]
    - `description` string, nullable
    - `effect` string, required
    - `conditions` object[], nullable
    - `priority` integer
  - `apply_to_all_resources` boolean

## Response `201`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gateco/apis/gateco-api.md) · [All operations](https://skmtc.dev/gateco/apis/gateco-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gateco/apis/gateco-api/revisions/5debaf204950?raw)
