Skip to main content

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

NameTypeDescription
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
hostportsList<string>hostports served by this edge
backendEndpointBackendMutateedge modules
ip_restrictionEndpointIPPolicyMutate
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackendMutate parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backend_idstringbackend to be used to back this endpoint

EndpointIPPolicyMutate parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policy_idsList<string>list of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule parameters

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction parameters

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

Response

Returns a 201 response on success

Example Response

{
"backend": null,
"created_at": "2024-04-19T20:23:47Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa"
}

Fields

NameTypeDescription
idstringunique identifier of this edge
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
created_atstringtimestamp when the edge was created, RFC 3339 format
uristringURI of the edge API resource
hostportsList<string>hostports served by this edge
backendEndpointBackendedge modules
ip_restrictionEndpointIPPolicy
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackend fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backendRefbackend to be used to back this endpoint

Ref fields

NameTypeDescription
idstringa resource identifier
uristringa uri for locating a resource

EndpointIPPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policiesReflist of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

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_2fKmd37Wyeu4DdgGCWJGeIcvtOa

Response

Returns a 200 response on success

Example Response

{
"backend": null,
"created_at": "2024-04-19T20:23:47Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa"
}

Fields

NameTypeDescription
idstringunique identifier of this edge
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
created_atstringtimestamp when the edge was created, RFC 3339 format
uristringURI of the edge API resource
hostportsList<string>hostports served by this edge
backendEndpointBackendedge modules
ip_restrictionEndpointIPPolicy
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackend fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backendRefbackend to be used to back this endpoint

Ref fields

NameTypeDescription
idstringa resource identifier
uristringa uri for locating a resource

EndpointIPPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policiesReflist of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

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-04-19T20:23:47Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa",
"ip_restriction": null,
"metadata": "{\"environment\": \"staging\"}",
"policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa"
}
],
"uri": "https://api.ngrok.com/edges/tcp"
}

Fields

NameTypeDescription
tcp_edgesTCPEdgethe list of all TCP Edges on this account
uristringURI of the TCP Edge list API resource
next_page_uristringURI of the next page, or null if there is no next page

TCPEdge fields

NameTypeDescription
idstringunique identifier of this edge
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
created_atstringtimestamp when the edge was created, RFC 3339 format
uristringURI of the edge API resource
hostportsList<string>hostports served by this edge
backendEndpointBackendedge modules
ip_restrictionEndpointIPPolicy
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackend fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backendRefbackend to be used to back this endpoint

Ref fields

NameTypeDescription
idstringa resource identifier
uristringa uri for locating a resource

EndpointIPPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policiesReflist of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

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_2fKmd37Wyeu4DdgGCWJGeIcvtOa

Parameters

NameTypeDescription
idstringunique identifier of this edge
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
hostportsList<string>hostports served by this edge
backendEndpointBackendMutateedge modules
ip_restrictionEndpointIPPolicyMutate
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackendMutate parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backend_idstringbackend to be used to back this endpoint

EndpointIPPolicyMutate parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policy_idsList<string>list of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule parameters

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction parameters

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

Response

Returns a 200 response on success

Example Response

{
"backend": null,
"created_at": "2024-04-19T20:23:47Z",
"description": "acme tcp edge",
"hostports": null,
"id": "edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa",
"ip_restriction": null,
"metadata": "{\"environment\": \"production\"}",
"policy": null,
"uri": "https://api.ngrok.com/edges/tcp/edgtcp_2fKmd37Wyeu4DdgGCWJGeIcvtOa"
}

Fields

NameTypeDescription
idstringunique identifier of this edge
descriptionstringhuman-readable description of what this edge will be used for; optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
created_atstringtimestamp when the edge was created, RFC 3339 format
uristringURI of the edge API resource
hostportsList<string>hostports served by this edge
backendEndpointBackendedge modules
ip_restrictionEndpointIPPolicy
policyEndpointPolicythe traffic policy associated with this edge or null

EndpointBackend fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
backendRefbackend to be used to back this endpoint

Ref fields

NameTypeDescription
idstringa resource identifier
uristringa uri for locating a resource

EndpointIPPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
ip_policiesReflist of all IP policies that will be used to check if a source IP is allowed access to the endpoint

EndpointPolicy fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
inboundEndpointRulethe inbound rules of the traffic policy.
outboundEndpointRulethe outbound rules on the traffic policy.

EndpointRule fields

NameTypeDescription
expressionsList<string>cel expressions that filter traffic the policy rule applies to.
actionsEndpointActionthe set of actions on a policy rule.
namestringthe name of the rule that is part of the traffic policy.

EndpointAction fields

NameTypeDescription
typestringthe type of action on the policy rule.
configobjectthe configuration for the action on the policy rule.

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_2fKmd37Wyeu4DdgGCWJGeIcvtOa

Response

Returns a 204 response with no body on success