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
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
{
"id": "ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"uri": "https://api.ngrok.com/ip_policies/ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"created_at": "2023-07-31T23:17:17Z",
"description": "API Outbound Gateway"
}
Fields
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_2TMGGCISN6MLWglZBZWrmyzPoA2
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_2TMGGCISN6MLWglZBZWrmyzPoA2
Response
Returns a 200 response on success
Example Response
{
"id": "ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"uri": "https://api.ngrok.com/ip_policies/ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"created_at": "2023-07-31T23:17:17Z",
"description": "API Outbound Gateway",
"metadata": "metadata={\"pod-id\": \"b3d9c464-4f48-4783-a741-d7d7d5db310f\"}"
}
Fields
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. |
List IP Policies
List all IP policies on this account
Request
GET /ip_policies
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/ip_policies
Response
Returns a 200 response on success
Example Response
{
"ip_policies": [
{
"id": "ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"uri": "https://api.ngrok.com/ip_policies/ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"created_at": "2023-07-31T23:17:17Z",
"description": "API Outbound Gateway"
},
{
"id": "ipp_2TMGG77q6dAqx34tc2W8nAO3STY",
"uri": "https://api.ngrok.com/ip_policies/ipp_2TMGG77q6dAqx34tc2W8nAO3STY",
"created_at": "2023-07-31T23:17:17Z",
"description": "Developer Environments"
}
],
"uri": "https://api.ngrok.com/ip_policies",
"next_page_uri": null
}
Fields
ip_policies | IPPolicy | the list of all IP policies on this account |
uri | string | URI of the IP policy list API resource |
next_page_uri | string | URI of the next page, or null if there is no next page |
IPPolicy fields
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. |
Update IP Policy
Update attributes of an IP policy by ID
Request
PATCH /ip_policies/{id}
Example Request
curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"metadata":"metadata={\"pod-id\": \"b3d9c464-4f48-4783-a741-d7d7d5db310f\"}"}' \
https://api.ngrok.com/ip_policies/ipp_2TMGGCISN6MLWglZBZWrmyzPoA2
Parameters
id | string | |
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 200 response on success
Example Response
{
"id": "ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"uri": "https://api.ngrok.com/ip_policies/ipp_2TMGGCISN6MLWglZBZWrmyzPoA2",
"created_at": "2023-07-31T23:17:17Z",
"description": "API Outbound Gateway",
"metadata": "metadata={\"pod-id\": \"b3d9c464-4f48-4783-a741-d7d7d5db310f\"}"
}
Fields
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. |