Skip to main content
POST
/
ip_restrictions
Create
curl --request POST \
  --url https://api.ngrok.com/ip_restrictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '{
  "description": "<string>",
  "metadata": "<string>",
  "enforced": true,
  "type": "<string>",
  "ip_policy_ids": [
    "<string>"
  ]
}'
{
  "id": "<string>",
  "uri": "<string>",
  "created_at": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "enforced": true,
  "type": "<string>",
  "ip_policies": [
    {
      "id": "<string>",
      "uri": "<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
type
string
required

the type of IP restriction. this defines what traffic will be restricted with the attached policies. four values are currently supported: dashboard, api, agent, and endpoints

ip_policy_ids
string[]
required

the set of IP policy identifiers that are used to enforce the restriction

description
string

human-readable description of this IP restriction. optional, max 255 bytes.

metadata
string

arbitrary user-defined machine-readable data of this IP restriction. optional, max 4096 bytes.

enforced
boolean

true if the IP restriction will be enforced. if false, only warnings will be issued

Response

201 - application/json

Create a new IP restriction

id
string

unique identifier for this IP restriction

uri
string

URI of the IP restriction API resource

created_at
string

timestamp when the IP restriction was created, RFC 3339 format

description
string

human-readable description of this IP restriction. optional, max 255 bytes.

metadata
string

arbitrary user-defined machine-readable data of this IP restriction. optional, max 4096 bytes.

enforced
boolean

true if the IP restriction will be enforced. if false, only warnings will be issued

type
string

the type of IP restriction. this defines what traffic will be restricted with the attached policies. four values are currently supported: dashboard, api, agent, and endpoints

ip_policies
object[]

the set of IP policies that are used to enforce the restriction