---
title: "Create"
method: POST
path: "/ip_policy_rules"
tags: ["IPPolicyRules"]
---

# Create

`POST /ip_policy_rules`

Create a new IP policy rule attached to an IP Policy.

## Headers

- `ngrok-version` integer, required

## Request body

- IPPolicyRuleCreate
  - `description` string — human-readable description of the source IPs of this IP rule. optional, max 255 bytes.
  - `metadata` string — arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.
  - `cidr` string, required — an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both supported.
  - `ip_policy_id` string, required — ID of the IP policy this IP policy rule will be attached to
  - `action` string, required — the action to apply to the policy rule, either `allow` or `deny`

## Response `201`

Create a new IP policy rule attached to an IP Policy.

- IPPolicyRule
  - `id` string — unique identifier for this IP policy rule
  - `uri` string — URI of the IP policy rule API resource
  - `created_at` string — timestamp when the IP policy rule was created, RFC 3339 format
  - `description` string — human-readable description of the source IPs of this IP rule. optional, max 255 bytes.
  - `metadata` string — arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.
  - `cidr` string — an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both supported.
  - `ip_policy` Ref
    - `id` string — a resource identifier
    - `uri` string — a uri for locating a resource
  - `action` string — the action to apply to the policy rule, either `allow` or `deny`

## Other responses

- `4XX` — An error. The body carries a machine-readable error_code and a human-readable msg; every code is documented at https://ngrok.com/docs/errors. A 429 with error code ERR_NGROK_226 means the account exceeded the documented request-rate limit.
- `5XX` — An error. The body carries a machine-readable error_code and a human-readable msg; every code is documented at https://ngrok.com/docs/errors. A 429 with error code ERR_NGROK_226 means the account exceeded the documented request-rate limit.

## Changes

- **2024-10-22** `e40349f8ec6f` — 1 info
  - api operation id `IPPolicyRulesCreate` removed and replaced with `IpPolicyRulesCreate`

[Change history](https://skmtc.dev/ngrok/apis/ngrok-openapi/changes/ip_policy_rules/post.md)

---

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