Edges Tcp
Create TCP Edge
Create a TCP Edge
Request
POST /edges/tcp
Example Request
curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"description":"acme tcp edge","metadata":"{\"environment\": \"staging\"}"}' \
https://api.ngrok.com/edges/tcp
Parameters
Name | Type | Description |
---|---|---|
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackendMutate | edge modules |
ip_restriction | EndpointIPPolicyMutate | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackendMutate parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend_id | string | backend to be used to back this endpoint |
EndpointIPPolicyMutate parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policy_ids | List<string> | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Response
Returns a 201 response on success
Example Response
{
"backend": null,
"created_at": "2024-08-02T07:15:43Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"traffic_policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN"
}
Fields
Name | Type | Description |
---|---|---|
id | string | unique identifier of this edge |
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
created_at | string | timestamp when the edge was created, RFC 3339 format |
uri | string | URI of the edge API resource |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackend | edge modules |
ip_restriction | EndpointIPPolicy | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackend fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend | Ref | backend to be used to back this endpoint |
Ref fields
Name | Type | Description |
---|---|---|
id | string | a resource identifier |
uri | string | a uri for locating a resource |
EndpointIPPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policies | Ref | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Get TCP Edge
Get a TCP Edge by ID
Request
GET /edges/tcp/{id}
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN
Response
Returns a 200 response on success
Example Response
{
"backend": null,
"created_at": "2024-08-02T07:15:43Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"traffic_policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN"
}
Fields
Name | Type | Description |
---|---|---|
id | string | unique identifier of this edge |
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
created_at | string | timestamp when the edge was created, RFC 3339 format |
uri | string | URI of the edge API resource |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackend | edge modules |
ip_restriction | EndpointIPPolicy | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackend fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend | Ref | backend to be used to back this endpoint |
Ref fields
Name | Type | Description |
---|---|---|
id | string | a resource identifier |
uri | string | a uri for locating a resource |
EndpointIPPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policies | Ref | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
List TCP Edges
Returns a list of all TCP Edges on this account
Request
GET /edges/tcp
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp
Response
Returns a 200 response on success
Example Response
{
"next_page_uri": null,
"tcp_edges": [
{
"backend": null,
"created_at": "2024-08-02T07:15:43Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"traffic_policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN"
}
],
"uri": "https://api.ngrok.com/edges/tcp"
}
Fields
Name | Type | Description |
---|---|---|
tcp_edges | TCPEdge | the list of all TCP Edges on this account |
uri | string | URI of the TCP Edge list API resource |
next_page_uri | string | URI of the next page, or null if there is no next page |
TCPEdge fields
Name | Type | Description |
---|---|---|
id | string | unique identifier of this edge |
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
created_at | string | timestamp when the edge was created, RFC 3339 format |
uri | string | URI of the edge API resource |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackend | edge modules |
ip_restriction | EndpointIPPolicy | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackend fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend | Ref | backend to be used to back this endpoint |
Ref fields
Name | Type | Description |
---|---|---|
id | string | a resource identifier |
uri | string | a uri for locating a resource |
EndpointIPPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policies | Ref | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Update TCP Edge
Updates a TCP Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
Request
PATCH /edges/tcp/{id}
Example Request
curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"metadata":"{\"environment\": \"production\"}"}' \
https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN
Parameters
Name | Type | Description |
---|---|---|
id | string | unique identifier of this edge |
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackendMutate | edge modules |
ip_restriction | EndpointIPPolicyMutate | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackendMutate parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend_id | string | backend to be used to back this endpoint |
EndpointIPPolicyMutate parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policy_ids | List<string> | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy parameters
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Response
Returns a 200 response on success
Example Response
{
"backend": null,
"created_at": "2024-08-02T07:15:43Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN",
"ip_restriction": null,
"metadata": "{\"environment\": \"production\"}",
"policy": null,
"traffic_policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN"
}
Fields
Name | Type | Description |
---|---|---|
id | string | unique identifier of this edge |
description | string | human-readable description of what this edge will be used for; optional, max 255 bytes. |
metadata | string | arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes. |
created_at | string | timestamp when the edge was created, RFC 3339 format |
uri | string | URI of the edge API resource |
hostports | List<string> | hostports served by this edge |
backend | EndpointBackend | edge modules |
ip_restriction | EndpointIPPolicy | |
traffic_policy | EndpointTrafficPolicy | the traffic policy associated with this edge or null |
EndpointBackend fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
backend | Ref | backend to be used to back this endpoint |
Ref fields
Name | Type | Description |
---|---|---|
id | string | a resource identifier |
uri | string | a uri for locating a resource |
EndpointIPPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
ip_policies | Ref | list of all IP policies that will be used to check if a source IP is allowed access to the endpoint |
EndpointTrafficPolicy fields
Name | Type | Description |
---|---|---|
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
value | string | the traffic policy that should be applied to the traffic on your endpoint. |
Delete TCP Edge
Delete a TCP Edge by ID
Request
DELETE /edges/tcp/{id}
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2k5oknhN0i1ttXh5oYUbeKb6wVN
Response
Returns a 204 response with no body on success