Skip to main content
POST
/
ssh_certificate_authorities
Create
curl --request POST \
  --url https://api.ngrok.com/ssh_certificate_authorities \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '
{
  "description": "<string>",
  "metadata": "<string>",
  "private_key_type": "<string>",
  "elliptic_curve": "<string>",
  "key_size": 123
}
'
import requests

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

payload = {
"description": "<string>",
"metadata": "<string>",
"private_key_type": "<string>",
"elliptic_curve": "<string>",
"key_size": 123
}
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>',
private_key_type: '<string>',
elliptic_curve: '<string>',
key_size: 123
})
};

fetch('https://api.ngrok.com/ssh_certificate_authorities', 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/ssh_certificate_authorities",
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>',
'private_key_type' => '<string>',
'elliptic_curve' => '<string>',
'key_size' => 123
]),
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/ssh_certificate_authorities"

payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"private_key_type\": \"<string>\",\n \"elliptic_curve\": \"<string>\",\n \"key_size\": 123\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/ssh_certificate_authorities")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"metadata\": \"<string>\",\n \"private_key_type\": \"<string>\",\n \"elliptic_curve\": \"<string>\",\n \"key_size\": 123\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"private_key_type\": \"<string>\",\n \"elliptic_curve\": \"<string>\",\n \"key_size\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "uri": "<string>",
  "created_at": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "public_key": "<string>",
  "key_type": "<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 this SSH Certificate Authority. optional, max 255 bytes.

metadata
string

arbitrary user-defined machine-readable data of this SSH Certificate Authority. optional, max 4096 bytes.

private_key_type
string

the type of private key to generate. one of rsa, ecdsa, ed25519

elliptic_curve
string

the type of elliptic curve to use when creating an ECDSA key

key_size
integer

the key size to use when creating an RSA key. one of 2048 or 4096

Response

201 - application/json

Create a new SSH Certificate Authority

id
string

unique identifier for this SSH Certificate Authority

uri
string

URI of the SSH Certificate Authority API resource

created_at
string

timestamp when the SSH Certificate Authority API resource was created, RFC 3339 format

description
string

human-readable description of this SSH Certificate Authority. optional, max 255 bytes.

metadata
string

arbitrary user-defined machine-readable data of this SSH Certificate Authority. optional, max 4096 bytes.

public_key
string

raw public key for this SSH Certificate Authority

key_type
string

the type of private key for this SSH Certificate Authority