Skip to main content
POST
/
ip_policy_rules
Create
curl --request POST \
  --url https://api.ngrok.com/ip_policy_rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '{
  "description": "<string>",
  "metadata": "<string>",
  "cidr": "<string>",
  "ip_policy_id": "<string>",
  "action": "<string>"
}'
{
  "id": "<string>",
  "uri": "<string>",
  "created_at": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "cidr": "<string>",
  "ip_policy": {
    "id": "<string>",
    "uri": "<string>"
  },
  "action": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

ngrok-version
integer
default:2
required

Body

application/json
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

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.

Response

201 - application/json

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

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
object

object describing the IP policy this IP Policy Rule belongs to

action
string

the action to apply to the policy rule, either allow or deny