> ## Documentation Index
> Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

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




## OpenAPI

````yaml https://raw.githubusercontent.com/ngrok/ngrok-openapi/refs/heads/main/ngrok.yaml post /ip_policy_rules
openapi: 3.0.0
info:
  title: ngrok OpenAPI
  version: 1.0.0
servers:
  - url: https://api.ngrok.com
security:
  - authentication: []
paths:
  /ip_policy_rules:
    post:
      tags:
        - IPPolicyRules
      summary: Create
      description: |
        Create a new IP policy rule attached to an IP Policy.
      operationId: IpPolicyRulesCreate
      parameters:
        - $ref: '#/components/parameters/ngrokVersion'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IPPolicyRuleCreate'
      responses:
        '201':
          description: |
            Create a new IP policy rule attached to an IP Policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IPPolicyRule'
components:
  parameters:
    ngrokVersion:
      name: ngrok-version
      in: header
      required: true
      schema:
        type: integer
        default: 2
  schemas:
    IPPolicyRuleCreate:
      type: object
      required:
        - cidr
        - ip_policy_id
        - action
      properties:
        description:
          description: >
            human-readable description of the source IPs of this IP rule.
            optional, max 255 bytes.
          type: string
        metadata:
          description: >
            arbitrary user-defined machine-readable data of this IP policy rule.
            optional, max 4096 bytes.
          type: string
        cidr:
          description: >
            an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both
            supported.
          type: string
        ip_policy_id:
          description: |
            ID of the IP policy this IP policy rule will be attached to
          type: string
        action:
          description: |
            the action to apply to the policy rule, either `allow` or `deny`
          type: string
    IPPolicyRule:
      type: object
      properties:
        id:
          description: |
            unique identifier for this IP policy rule
          type: string
        uri:
          description: |
            URI of the IP policy rule API resource
          type: string
        created_at:
          description: |
            timestamp when the IP policy rule was created, RFC 3339 format
          type: string
        description:
          description: >
            human-readable description of the source IPs of this IP rule.
            optional, max 255 bytes.
          type: string
        metadata:
          description: >
            arbitrary user-defined machine-readable data of this IP policy rule.
            optional, max 4096 bytes.
          type: string
        cidr:
          description: >
            an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both
            supported.
          type: string
        ip_policy:
          $ref: '#/components/schemas/Ref'
          description: |
            object describing the IP policy this IP Policy Rule belongs to
        action:
          description: |
            the action to apply to the policy rule, either `allow` or `deny`
          type: string
    Ref:
      type: object
      properties:
        id:
          description: |
            a resource identifier
          type: string
        uri:
          description: |
            a uri for locating a resource
          type: string
  securitySchemes:
    authentication:
      type: http
      scheme: bearer

````