Skip to main content
GET
/
tls_certificates
/
{id}
Get
curl --request GET \
  --url https://api.ngrok.com/tls_certificates/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'ngrok-version: <ngrok-version>'
import requests

url = "https://api.ngrok.com/tls_certificates/{id}"

headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'ngrok-version': '<ngrok-version>', Authorization: 'Bearer <token>'}
};

fetch('https://api.ngrok.com/tls_certificates/{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/tls_certificates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)

func main() {

url := "https://api.ngrok.com/tls_certificates/{id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.ngrok.com/tls_certificates/{id}")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ngrok.com/tls_certificates/{id}")

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

request = Net::HTTP::Get.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "uri": "<string>",
  "created_at": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "certificate_pem": "<string>",
  "subject_common_name": "<string>",
  "subject_alternative_names": {
    "dns_names": [
      "<string>"
    ],
    "ips": [
      "<string>"
    ]
  },
  "issued_at": "<string>",
  "not_before": "<string>",
  "not_after": "<string>",
  "key_usages": [
    "<string>"
  ],
  "extended_key_usages": [
    "<string>"
  ],
  "private_key_type": "<string>",
  "issuer_common_name": "<string>",
  "serial_number": "<string>",
  "subject_organization": "<string>",
  "subject_organizational_unit": "<string>",
  "subject_locality": "<string>",
  "subject_province": "<string>",
  "subject_country": "<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

Path Parameters

id
string
required

a resource identifier

Response

200 - application/json

Get detailed information about a TLS certificate

id
string

unique identifier for this TLS certificate

uri
string

URI of the TLS certificate API resource

created_at
string

timestamp when the TLS certificate was created, RFC 3339 format

description
string

human-readable description of this TLS certificate. optional, max 255 bytes.

metadata
string

arbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.

certificate_pem
string

chain of PEM-encoded certificates, leaf first. See Certificate Bundles.

subject_common_name
string

subject common name from the leaf of this TLS certificate

subject_alternative_names
object

subject alternative names (SANs) from the leaf of this TLS certificate

issued_at
string

timestamp (in RFC 3339 format) when this TLS certificate was issued automatically, or null if this certificate was user-uploaded

not_before
string

timestamp when this TLS certificate becomes valid, RFC 3339 format

not_after
string

timestamp when this TLS certificate becomes invalid, RFC 3339 format

key_usages
string[]

set of actions the private key of this TLS certificate can be used for

extended_key_usages
string[]

extended set of actions the private key of this TLS certificate can be used for

private_key_type
string

type of the private key of this TLS certificate. One of rsa, ecdsa, or ed25519.

issuer_common_name
string

issuer common name from the leaf of this TLS certificate

serial_number
string

serial number of the leaf of this TLS certificate

subject_organization
string

subject organization from the leaf of this TLS certificate

subject_organizational_unit
string

subject organizational unit from the leaf of this TLS certificate

subject_locality
string

subject locality from the leaf of this TLS certificate

subject_province
string

subject province from the leaf of this TLS certificate

subject_country
string

subject country from the leaf of this TLS certificate