Skip to main content
POST
/
edges
/
https
Create
curl --request POST \
  --url https://api.ngrok.com/edges/https \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '
{
  "description": "<string>",
  "metadata": "<string>",
  "hostports": [
    "<string>"
  ],
  "mutual_tls": {
    "enabled": true,
    "certificate_authority_ids": [
      "<string>"
    ]
  },
  "tls_termination": {
    "enabled": true,
    "min_version": "<string>"
  }
}
'
import requests

url = "https://api.ngrok.com/edges/https"

payload = {
"description": "<string>",
"metadata": "<string>",
"hostports": ["<string>"],
"mutual_tls": {
"enabled": True,
"certificate_authority_ids": ["<string>"]
},
"tls_termination": {
"enabled": True,
"min_version": "<string>"
}
}
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'ngrok-version': '<ngrok-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: '<string>',
metadata: '<string>',
hostports: ['<string>'],
mutual_tls: {enabled: true, certificate_authority_ids: ['<string>']},
tls_termination: {enabled: true, min_version: '<string>'}
})
};

fetch('https://api.ngrok.com/edges/https', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'metadata' => '<string>',
'hostports' => [
'<string>'
],
'mutual_tls' => [
'enabled' => true,
'certificate_authority_ids' => [
'<string>'
]
],
'tls_termination' => [
'enabled' => true,
'min_version' => '<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"

payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"hostports\": [\n \"<string>\"\n ],\n \"mutual_tls\": {\n \"enabled\": true,\n \"certificate_authority_ids\": [\n \"<string>\"\n ]\n },\n \"tls_termination\": {\n \"enabled\": true,\n \"min_version\": \"<string>\"\n }\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.ngrok.com/edges/https")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"hostports\": [\n \"<string>\"\n ],\n \"mutual_tls\": {\n \"enabled\": true,\n \"certificate_authority_ids\": [\n \"<string>\"\n ]\n },\n \"tls_termination\": {\n \"enabled\": true,\n \"min_version\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ngrok.com/edges/https")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"hostports\": [\n \"<string>\"\n ],\n \"mutual_tls\": {\n \"enabled\": true,\n \"certificate_authority_ids\": [\n \"<string>\"\n ]\n },\n \"tls_termination\": {\n \"enabled\": true,\n \"min_version\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "created_at": "<string>",
  "uri": "<string>",
  "hostports": [
    "<string>"
  ],
  "mutual_tls": {
    "enabled": true,
    "certificate_authorities": [
      {
        "id": "<string>",
        "uri": "<string>"
      }
    ]
  },
  "tls_termination": {
    "enabled": true,
    "terminate_at": "<string>",
    "min_version": "<string>"
  },
  "routes": [
    {
      "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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

ngrok-version
integer
default:2
required

Body

application/json
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
string[]

hostports served by this edge

mutual_tls
object

edge modules

tls_termination
object

n/a

Response

201 - application/json

Create an HTTPS Edge

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 configuration was created, RFC 3339 format

uri
string

URI of the edge API resource

hostports
string[]

hostports served by this edge

mutual_tls
object

edge modules

tls_termination
object

n/a

routes
object[]

routes