curl --request GET \
--url https://closedvpn.io/auth/download-certificate \
--header 'Authorization: Bearer <token>'import requests
url = "https://closedvpn.io/auth/download-certificate"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://closedvpn.io/auth/download-certificate', 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://closedvpn.io/auth/download-certificate",
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>"
],
]);
$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://closedvpn.io/auth/download-certificate"
req, _ := http.NewRequest("GET", url, nil)
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://closedvpn.io/auth/download-certificate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/download-certificate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"# closedvpn-json {\"vpnExitNodes\":[{\"id\":\"60c72b2f5f1b2c001c8e4b2a\",\"name\":\"Frankfurt Node\",\"location\":\"Frankfurt, Germany\",\"coordinates\":[50.1109,8.6821]}]}\n\nclient\ndev tun\nproto udp\nremote vpn-fra.closedvpn.io 1194\n<ca>\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n</ca>\n"{
"message": "Organization ID is required"
}{
"message": "Unauthorized"
}{
"message": "You’ve reached the maximum number of certificates. Please acquire more licenses."
}{
"message": "Organization not found"
}{
"message": "Server error",
"error": "Detailed error message"
}Download Certificate
Returns the caller’s OpenVPN client profile for an organization, issuing one on first use.
If the caller already holds a certificate it is returned as-is and no licence is consumed, so this endpoint is safe to call repeatedly. Otherwise the platform runs the VPN configuration’s create_cert command over SSH, stores the result and increments used_licenses.
Issuing a new certificate requires a VPN assigned to the organization, a create_cert entry in that VPN’s commands map, and at least one free licence.
curl --request GET \
--url https://closedvpn.io/auth/download-certificate \
--header 'Authorization: Bearer <token>'import requests
url = "https://closedvpn.io/auth/download-certificate"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://closedvpn.io/auth/download-certificate', 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://closedvpn.io/auth/download-certificate",
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>"
],
]);
$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://closedvpn.io/auth/download-certificate"
req, _ := http.NewRequest("GET", url, nil)
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://closedvpn.io/auth/download-certificate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/download-certificate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"# closedvpn-json {\"vpnExitNodes\":[{\"id\":\"60c72b2f5f1b2c001c8e4b2a\",\"name\":\"Frankfurt Node\",\"location\":\"Frankfurt, Germany\",\"coordinates\":[50.1109,8.6821]}]}\n\nclient\ndev tun\nproto udp\nremote vpn-fra.closedvpn.io 1194\n<ca>\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n</ca>\n"{
"message": "Organization ID is required"
}{
"message": "Unauthorized"
}{
"message": "You’ve reached the maximum number of certificates. Please acquire more licenses."
}{
"message": "Organization not found"
}{
"message": "Server error",
"error": "Detailed error message"
}res.json(), which throws a
SyntaxError because this endpoint returns an OpenVPN profile
(application/x-openvpn-profile), not JSON. Use res.text() instead, as shown
below. The cURL, Python, PHP, Go, Java and Ruby samples handle this correctly.fetch('https://closedvpn.io/auth/download-certificate?org_id=YOUR_ORG_ID', {
headers: { Authorization: 'Bearer YOUR_PAT' }
})
.then(res => res.text())
.then(profile => console.log(profile))
.catch(err => console.error(err));
# closedvpn-json
metadata line and save the profile as a .ovpn file — see
Creating a VPN Certificate.Authorizations
Personal Access Token (PAT) passed in the Authorization header (e.g., Bearer <pat>) for authenticated API requests. PATs are generated via /auth/generate-pat after authenticating through the magic link flow.
Query Parameters
"60c72b2f5f1b2c001c8e4b1a"
Response
The OpenVPN client profile. The body is not a bare .ovpn file: the first line is a # closedvpn-json comment carrying the organization's exit nodes, followed by a blank line and then the profile itself. Strip or ignore that comment line if your client does not tolerate it.
OpenVPN configuration file
"# closedvpn-json {\"vpnExitNodes\":[{\"id\":\"60c72b2f5f1b2c001c8e4b2a\",\"name\":\"Frankfurt Node\",\"location\":\"Frankfurt, Germany\",\"coordinates\":[50.1109,8.6821]}]}\n\nclient\ndev tun\nproto udp\nremote vpn-fra.closedvpn.io 1194\n<ca>\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n</ca>\n"

