IP Policies
Create IP Policy
Create a new IP policy. It will not apply to any traffic until you associate to a traffic source via an endpoint configuration or IP restriction.
Request
POST /ip_policies
Example Request
curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"description":"API Outbound Gateway"}' \
https://api.ngrok.com/ip_policies
Parameters
Name | Type | Description |
---|---|---|
description | string | human-readable description of the source IPs of this IP policy. optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this IP policy. optional, max 4096 bytes. |
Response
Returns a 201 response on success
Example Response
{
"created_at": "2024-10-17T20:26:22Z",
"description": "API Outbound Gateway",
"id": "ipp_2na2I0JeTsGwphCco2fuMD5zdBL",
"uri": "https://api.ngrok.com/ip_policies/ipp_2na2I0JeTsGwphCco2fuMD5zdBL"
}
Fields
Name | Type | Description |
---|---|---|
id | string | unique identifier for this IP policy |
uri | string | URI of the IP Policy API resource |
created_at | string | timestamp when the IP policy was created, RFC 3339 format |
description | string | human-readable description of the source IPs of this IP policy. optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this IP policy. optional, max 4096 bytes. |
Delete IP Policy
Delete an IP policy. If the IP policy is referenced by another object for the purposes of traffic restriction it will be treated as if the IP policy remains but has zero rules.
Request
DELETE /ip_policies/{id}
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/ip_policies/ipp_2na2I0JeTsGwphCco2fuMD5zdBL
Response
Returns a 204 response with no body on success
Get IP Policy
Get detailed information about an IP policy by ID.
Request
GET /ip_policies/{id}
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/ip_policies/ipp_2na2I0JeTsGwphCco2fuMD5zdBL
Response
Returns a 200 response on success
Example Response
{
"created_at": "2024-10-17T20:26:22Z",
"description": "API Outbound Gateway",
"id": "ipp_2na2I0JeTsGwphCco2fuMD5zdBL",
"metadata": "metadata={\"pod-id\": \"b3d9c464-4f48-4783-a741-d7d7d5db310f\"}",
"uri": "https://api.ngrok.com/ip_policies/ipp_2na2I0JeTsGwphCco2fuMD5zdBL"
}
Fields
Name | Type | Description |
---|---|---|
id | string | unique identifier for this IP policy |
uri | string | URI of the IP Policy API resource |
created_at | string | timestamp when the IP policy was created, RFC 3339 format |
description | string | human-readable description of the source IPs of this IP policy. optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this IP policy. optional, max 4096 bytes. |