curl --request PATCH \
--url https://api.ngrok.com/edges/https/{edge_id}/routes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'ngrok-version: <ngrok-version>' \
--data '
{
"edge_id": "<string>",
"id": "<string>",
"match_type": "<string>",
"match": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": true,
"backend_id": "<string>"
},
"ip_restriction": {
"enabled": true,
"ip_policy_ids": [
"<string>"
]
},
"circuit_breaker": {
"enabled": true,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": {
"enabled": true
},
"request_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"response_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"webhook_verification": {
"enabled": true,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": true,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
],
"teams": [
"<string>"
],
"organizations": [
"<string>"
]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
}
},
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"nameid_format": "<string>"
},
"oidc": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
]
},
"websocket_tcp_converter": {
"enabled": true
},
"user_agent_filter": {
"enabled": true,
"allow": [
"<string>"
],
"deny": [
"<string>"
]
},
"traffic_policy": {
"enabled": true,
"value": "<string>"
}
}
'import requests
url = "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}"
payload = {
"edge_id": "<string>",
"id": "<string>",
"match_type": "<string>",
"match": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": True,
"backend_id": "<string>"
},
"ip_restriction": {
"enabled": True,
"ip_policy_ids": ["<string>"]
},
"circuit_breaker": {
"enabled": True,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": { "enabled": True },
"request_headers": {
"enabled": True,
"add": {},
"remove": ["<string>"]
},
"response_headers": {
"enabled": True,
"add": {},
"remove": ["<string>"]
},
"webhook_verification": {
"enabled": True,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": True,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"],
"teams": ["<string>"],
"organizations": ["<string>"]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
}
},
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": True,
"allow_idp_initiated": True,
"authorized_groups": ["<string>"],
"nameid_format": "<string>"
},
"oidc": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"]
},
"websocket_tcp_converter": { "enabled": True },
"user_agent_filter": {
"enabled": True,
"allow": ["<string>"],
"deny": ["<string>"]
},
"traffic_policy": {
"enabled": True,
"value": "<string>"
}
}
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'ngrok-version': '<ngrok-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_id: '<string>',
id: '<string>',
match_type: '<string>',
match: '<string>',
description: '<string>',
metadata: '<string>',
backend: {enabled: true, backend_id: '<string>'},
ip_restriction: {enabled: true, ip_policy_ids: ['<string>']},
circuit_breaker: {
enabled: true,
tripped_duration: 123,
rolling_window: 123,
num_buckets: 123,
volume_threshold: 123,
error_threshold_percentage: 123
},
compression: {enabled: true},
request_headers: {enabled: true, add: {}, remove: ['<string>']},
response_headers: {enabled: true, add: {}, remove: ['<string>']},
webhook_verification: {enabled: true, provider: '<string>', secret: '<string>'},
oauth: {
enabled: true,
provider: {
github: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>'],
teams: ['<string>'],
organizations: ['<string>']
},
facebook: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
microsoft: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
google: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
linkedin: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
gitlab: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
twitch: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
amazon: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
}
},
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
auth_check_interval: 123
},
saml: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
idp_metadata: '<string>',
force_authn: true,
allow_idp_initiated: true,
authorized_groups: ['<string>'],
nameid_format: '<string>'
},
oidc: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
issuer: '<string>',
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>']
},
websocket_tcp_converter: {enabled: true},
user_agent_filter: {enabled: true, allow: ['<string>'], deny: ['<string>']},
traffic_policy: {enabled: true, value: '<string>'}
})
};
fetch('https://api.ngrok.com/edges/https/{edge_id}/routes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edge_id' => '<string>',
'id' => '<string>',
'match_type' => '<string>',
'match' => '<string>',
'description' => '<string>',
'metadata' => '<string>',
'backend' => [
'enabled' => true,
'backend_id' => '<string>'
],
'ip_restriction' => [
'enabled' => true,
'ip_policy_ids' => [
'<string>'
]
],
'circuit_breaker' => [
'enabled' => true,
'tripped_duration' => 123,
'rolling_window' => 123,
'num_buckets' => 123,
'volume_threshold' => 123,
'error_threshold_percentage' => 123
],
'compression' => [
'enabled' => true
],
'request_headers' => [
'enabled' => true,
'add' => [
],
'remove' => [
'<string>'
]
],
'response_headers' => [
'enabled' => true,
'add' => [
],
'remove' => [
'<string>'
]
],
'webhook_verification' => [
'enabled' => true,
'provider' => '<string>',
'secret' => '<string>'
],
'oauth' => [
'enabled' => true,
'provider' => [
'github' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
],
'teams' => [
'<string>'
],
'organizations' => [
'<string>'
]
],
'facebook' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'microsoft' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'google' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'linkedin' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'gitlab' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'twitch' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'amazon' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
]
],
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'auth_check_interval' => 123
],
'saml' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'idp_metadata' => '<string>',
'force_authn' => true,
'allow_idp_initiated' => true,
'authorized_groups' => [
'<string>'
],
'nameid_format' => '<string>'
],
'oidc' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'issuer' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
]
],
'websocket_tcp_converter' => [
'enabled' => true
],
'user_agent_filter' => [
'enabled' => true,
'allow' => [
'<string>'
],
'deny' => [
'<string>'
]
],
'traffic_policy' => [
'enabled' => true,
'value' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}"
payload := strings.NewReader("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"edge_id": "<string>",
"id": "<string>",
"created_at": "<string>",
"match_type": "<string>",
"match": "<string>",
"uri": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": true,
"backend": {
"id": "<string>",
"uri": "<string>"
}
},
"ip_restriction": {
"enabled": true,
"ip_policies": [
{
"id": "<string>",
"uri": "<string>"
}
]
},
"circuit_breaker": {
"enabled": true,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": {
"enabled": true
},
"request_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"response_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"webhook_verification": {
"enabled": true,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": true,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
],
"teams": [
"<string>"
],
"organizations": [
"<string>"
]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
}
},
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"entity_id": "<string>",
"assertion_consumer_service_url": "<string>",
"single_logout_url": "<string>",
"request_signing_certificate_pem": "<string>",
"metadata_url": "<string>",
"nameid_format": "<string>"
},
"oidc": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
]
},
"websocket_tcp_converter": {
"enabled": true
},
"user_agent_filter": {
"enabled": true,
"allow": [
"<string>"
],
"deny": [
"<string>"
]
},
"traffic_policy": {
"enabled": true,
"value": "<string>"
}
}Update
Update an existing route on an HTTPS edge with new match rules or module configurations.
curl --request PATCH \
--url https://api.ngrok.com/edges/https/{edge_id}/routes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'ngrok-version: <ngrok-version>' \
--data '
{
"edge_id": "<string>",
"id": "<string>",
"match_type": "<string>",
"match": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": true,
"backend_id": "<string>"
},
"ip_restriction": {
"enabled": true,
"ip_policy_ids": [
"<string>"
]
},
"circuit_breaker": {
"enabled": true,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": {
"enabled": true
},
"request_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"response_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"webhook_verification": {
"enabled": true,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": true,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
],
"teams": [
"<string>"
],
"organizations": [
"<string>"
]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
}
},
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"nameid_format": "<string>"
},
"oidc": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
]
},
"websocket_tcp_converter": {
"enabled": true
},
"user_agent_filter": {
"enabled": true,
"allow": [
"<string>"
],
"deny": [
"<string>"
]
},
"traffic_policy": {
"enabled": true,
"value": "<string>"
}
}
'import requests
url = "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}"
payload = {
"edge_id": "<string>",
"id": "<string>",
"match_type": "<string>",
"match": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": True,
"backend_id": "<string>"
},
"ip_restriction": {
"enabled": True,
"ip_policy_ids": ["<string>"]
},
"circuit_breaker": {
"enabled": True,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": { "enabled": True },
"request_headers": {
"enabled": True,
"add": {},
"remove": ["<string>"]
},
"response_headers": {
"enabled": True,
"add": {},
"remove": ["<string>"]
},
"webhook_verification": {
"enabled": True,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": True,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"],
"teams": ["<string>"],
"organizations": ["<string>"]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"],
"email_addresses": ["<string>"],
"email_domains": ["<string>"]
}
},
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": True,
"allow_idp_initiated": True,
"authorized_groups": ["<string>"],
"nameid_format": "<string>"
},
"oidc": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": ["<string>"]
},
"websocket_tcp_converter": { "enabled": True },
"user_agent_filter": {
"enabled": True,
"allow": ["<string>"],
"deny": ["<string>"]
},
"traffic_policy": {
"enabled": True,
"value": "<string>"
}
}
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'ngrok-version': '<ngrok-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_id: '<string>',
id: '<string>',
match_type: '<string>',
match: '<string>',
description: '<string>',
metadata: '<string>',
backend: {enabled: true, backend_id: '<string>'},
ip_restriction: {enabled: true, ip_policy_ids: ['<string>']},
circuit_breaker: {
enabled: true,
tripped_duration: 123,
rolling_window: 123,
num_buckets: 123,
volume_threshold: 123,
error_threshold_percentage: 123
},
compression: {enabled: true},
request_headers: {enabled: true, add: {}, remove: ['<string>']},
response_headers: {enabled: true, add: {}, remove: ['<string>']},
webhook_verification: {enabled: true, provider: '<string>', secret: '<string>'},
oauth: {
enabled: true,
provider: {
github: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>'],
teams: ['<string>'],
organizations: ['<string>']
},
facebook: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
microsoft: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
google: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
linkedin: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
gitlab: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
twitch: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
},
amazon: {
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>'],
email_addresses: ['<string>'],
email_domains: ['<string>']
}
},
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
auth_check_interval: 123
},
saml: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
idp_metadata: '<string>',
force_authn: true,
allow_idp_initiated: true,
authorized_groups: ['<string>'],
nameid_format: '<string>'
},
oidc: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
issuer: '<string>',
client_id: '<string>',
client_secret: '<string>',
scopes: ['<string>']
},
websocket_tcp_converter: {enabled: true},
user_agent_filter: {enabled: true, allow: ['<string>'], deny: ['<string>']},
traffic_policy: {enabled: true, value: '<string>'}
})
};
fetch('https://api.ngrok.com/edges/https/{edge_id}/routes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edge_id' => '<string>',
'id' => '<string>',
'match_type' => '<string>',
'match' => '<string>',
'description' => '<string>',
'metadata' => '<string>',
'backend' => [
'enabled' => true,
'backend_id' => '<string>'
],
'ip_restriction' => [
'enabled' => true,
'ip_policy_ids' => [
'<string>'
]
],
'circuit_breaker' => [
'enabled' => true,
'tripped_duration' => 123,
'rolling_window' => 123,
'num_buckets' => 123,
'volume_threshold' => 123,
'error_threshold_percentage' => 123
],
'compression' => [
'enabled' => true
],
'request_headers' => [
'enabled' => true,
'add' => [
],
'remove' => [
'<string>'
]
],
'response_headers' => [
'enabled' => true,
'add' => [
],
'remove' => [
'<string>'
]
],
'webhook_verification' => [
'enabled' => true,
'provider' => '<string>',
'secret' => '<string>'
],
'oauth' => [
'enabled' => true,
'provider' => [
'github' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
],
'teams' => [
'<string>'
],
'organizations' => [
'<string>'
]
],
'facebook' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'microsoft' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'google' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'linkedin' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'gitlab' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'twitch' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
],
'amazon' => [
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
],
'email_addresses' => [
'<string>'
],
'email_domains' => [
'<string>'
]
]
],
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'auth_check_interval' => 123
],
'saml' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'idp_metadata' => '<string>',
'force_authn' => true,
'allow_idp_initiated' => true,
'authorized_groups' => [
'<string>'
],
'nameid_format' => '<string>'
],
'oidc' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'issuer' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'scopes' => [
'<string>'
]
],
'websocket_tcp_converter' => [
'enabled' => true
],
'user_agent_filter' => [
'enabled' => true,
'allow' => [
'<string>'
],
'deny' => [
'<string>'
]
],
'traffic_policy' => [
'enabled' => true,
'value' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}"
payload := strings.NewReader("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"match_type\": \"<string>\",\n \"match\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"backend\": {\n \"enabled\": true,\n \"backend_id\": \"<string>\"\n },\n \"ip_restriction\": {\n \"enabled\": true,\n \"ip_policy_ids\": [\n \"<string>\"\n ]\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"tripped_duration\": 123,\n \"rolling_window\": 123,\n \"num_buckets\": 123,\n \"volume_threshold\": 123,\n \"error_threshold_percentage\": 123\n },\n \"compression\": {\n \"enabled\": true\n },\n \"request_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"response_headers\": {\n \"enabled\": true,\n \"add\": {},\n \"remove\": [\n \"<string>\"\n ]\n },\n \"webhook_verification\": {\n \"enabled\": true,\n \"provider\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"oauth\": {\n \"enabled\": true,\n \"provider\": {\n \"github\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"organizations\": [\n \"<string>\"\n ]\n },\n \"facebook\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"microsoft\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"google\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"linkedin\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"gitlab\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"twitch\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n },\n \"amazon\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"email_addresses\": [\n \"<string>\"\n ],\n \"email_domains\": [\n \"<string>\"\n ]\n }\n },\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"auth_check_interval\": 123\n },\n \"saml\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n },\n \"oidc\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"issuer\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n },\n \"websocket_tcp_converter\": {\n \"enabled\": true\n },\n \"user_agent_filter\": {\n \"enabled\": true,\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n },\n \"traffic_policy\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"edge_id": "<string>",
"id": "<string>",
"created_at": "<string>",
"match_type": "<string>",
"match": "<string>",
"uri": "<string>",
"description": "<string>",
"metadata": "<string>",
"backend": {
"enabled": true,
"backend": {
"id": "<string>",
"uri": "<string>"
}
},
"ip_restriction": {
"enabled": true,
"ip_policies": [
{
"id": "<string>",
"uri": "<string>"
}
]
},
"circuit_breaker": {
"enabled": true,
"tripped_duration": 123,
"rolling_window": 123,
"num_buckets": 123,
"volume_threshold": 123,
"error_threshold_percentage": 123
},
"compression": {
"enabled": true
},
"request_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"response_headers": {
"enabled": true,
"add": {},
"remove": [
"<string>"
]
},
"webhook_verification": {
"enabled": true,
"provider": "<string>",
"secret": "<string>"
},
"oauth": {
"enabled": true,
"provider": {
"github": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
],
"teams": [
"<string>"
],
"organizations": [
"<string>"
]
},
"facebook": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"microsoft": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"google": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"linkedin": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"gitlab": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"twitch": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
},
"amazon": {
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
],
"email_addresses": [
"<string>"
],
"email_domains": [
"<string>"
]
}
},
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"auth_check_interval": 123
},
"saml": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"entity_id": "<string>",
"assertion_consumer_service_url": "<string>",
"single_logout_url": "<string>",
"request_signing_certificate_pem": "<string>",
"metadata_url": "<string>",
"nameid_format": "<string>"
},
"oidc": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"issuer": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"scopes": [
"<string>"
]
},
"websocket_tcp_converter": {
"enabled": true
},
"user_agent_filter": {
"enabled": true,
"allow": [
"<string>"
],
"deny": [
"<string>"
]
},
"traffic_policy": {
"enabled": true,
"value": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
unique identifier of this edge
unique identifier of this edge route
Body
unique identifier of this edge
unique identifier of this edge route
Type of match to use for this route. Valid values are "exact_path" and "path_prefix".
Route selector: "/blog" or "example.com" or "example.com/blog"
human-readable description of what this edge will be used for; optional, max 255 bytes.
arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
backend module configuration or null
Show child attributes
Show child attributes
ip restriction module configuration or null
Show child attributes
Show child attributes
circuit breaker module configuration or null
Show child attributes
Show child attributes
compression module configuration or null
Show child attributes
Show child attributes
request headers module configuration or null
Show child attributes
Show child attributes
response headers module configuration or null
Show child attributes
Show child attributes
webhook verification module configuration or null
Show child attributes
Show child attributes
oauth module configuration or null
Show child attributes
Show child attributes
saml module configuration or null
Show child attributes
Show child attributes
oidc module configuration or null
Show child attributes
Show child attributes
websocket to tcp adapter configuration or null
Show child attributes
Show child attributes
n/a
Show child attributes
Show child attributes
the traffic policy associated with this edge or null
Show child attributes
Show child attributes
Response
Updates an HTTPS Edge Route 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.
unique identifier of this edge
unique identifier of this edge route
timestamp when the edge configuration was created, RFC 3339 format
Type of match to use for this route. Valid values are "exact_path" and "path_prefix".
Route selector: "/blog" or "example.com" or "example.com/blog"
URI of the edge API resource
human-readable description of what this edge will be used for; optional, max 255 bytes.
arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
backend module configuration or null
Show child attributes
Show child attributes
ip restriction module configuration or null
Show child attributes
Show child attributes
circuit breaker module configuration or null
Show child attributes
Show child attributes
compression module configuration or null
Show child attributes
Show child attributes
request headers module configuration or null
Show child attributes
Show child attributes
response headers module configuration or null
Show child attributes
Show child attributes
webhook verification module configuration or null
Show child attributes
Show child attributes
oauth module configuration or null
Show child attributes
Show child attributes
saml module configuration or null
Show child attributes
Show child attributes
oidc module configuration or null
Show child attributes
Show child attributes
websocket to tcp adapter configuration or null
Show child attributes
Show child attributes
n/a
Show child attributes
Show child attributes
the traffic policy associated with this edge or null
Show child attributes
Show child attributes
Was this page helpful?