curl --request POST \
--url https://management-api.fpjs.io/subdomains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"subdomain": "metrics.yourwebsite.com",
"webhook_url": "https://customer.com/hooks/fp-subdomain"
}
'import requests
url = "https://management-api.fpjs.io/subdomains"
payload = {
"subdomain": "metrics.yourwebsite.com",
"webhook_url": "https://customer.com/hooks/fp-subdomain"
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subdomain: 'metrics.yourwebsite.com',
webhook_url: 'https://customer.com/hooks/fp-subdomain'
})
};
fetch('https://management-api.fpjs.io/subdomains', 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://management-api.fpjs.io/subdomains",
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([
'subdomain' => 'metrics.yourwebsite.com',
'webhook_url' => 'https://customer.com/hooks/fp-subdomain'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-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://management-api.fpjs.io/subdomains"
payload := strings.NewReader("{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Version", "<x-api-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://management-api.fpjs.io/subdomains")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/subdomains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "certv2_a1b2c3d4e5f6",
"subdomain": "metrics.yourwebsite.com",
"status": "pending",
"created_at": "2026-03-05T14:00:00.000Z",
"updated_at": "2026-03-05T14:35:00.000Z",
"dns_records": {
"verification": {
"type": "CNAME",
"host": "_acme-challenge.metrics.yourwebsite.com",
"value": "dcv.fpjs.io",
"status": "pending_validation"
},
"routing": [
{
"type": "CNAME",
"host": "_acme-challenge.metrics.yourwebsite.com",
"value": "dcv.fpjs.io",
"status": "pending_validation"
}
]
},
"webhook_url": "https://customer.com/hooks/fp-subdomain",
"webhook_secret": "whsec_wRNftLajMZNeslQOP6vEPm4iVx5NlZ6z"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Register a subdomain
Register a new custom subdomain and receive its DNS records. Optionally pass webhook_url to get a signed POST callback on every status change instead of polling; the signing secret is returned once in this response as webhook_secret.
curl --request POST \
--url https://management-api.fpjs.io/subdomains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"subdomain": "metrics.yourwebsite.com",
"webhook_url": "https://customer.com/hooks/fp-subdomain"
}
'import requests
url = "https://management-api.fpjs.io/subdomains"
payload = {
"subdomain": "metrics.yourwebsite.com",
"webhook_url": "https://customer.com/hooks/fp-subdomain"
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subdomain: 'metrics.yourwebsite.com',
webhook_url: 'https://customer.com/hooks/fp-subdomain'
})
};
fetch('https://management-api.fpjs.io/subdomains', 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://management-api.fpjs.io/subdomains",
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([
'subdomain' => 'metrics.yourwebsite.com',
'webhook_url' => 'https://customer.com/hooks/fp-subdomain'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-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://management-api.fpjs.io/subdomains"
payload := strings.NewReader("{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Version", "<x-api-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://management-api.fpjs.io/subdomains")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/subdomains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subdomain\": \"metrics.yourwebsite.com\",\n \"webhook_url\": \"https://customer.com/hooks/fp-subdomain\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "certv2_a1b2c3d4e5f6",
"subdomain": "metrics.yourwebsite.com",
"status": "pending",
"created_at": "2026-03-05T14:00:00.000Z",
"updated_at": "2026-03-05T14:35:00.000Z",
"dns_records": {
"verification": {
"type": "CNAME",
"host": "_acme-challenge.metrics.yourwebsite.com",
"value": "dcv.fpjs.io",
"status": "pending_validation"
},
"routing": [
{
"type": "CNAME",
"host": "_acme-challenge.metrics.yourwebsite.com",
"value": "dcv.fpjs.io",
"status": "pending_validation"
}
]
},
"webhook_url": "https://customer.com/hooks/fp-subdomain",
"webhook_secret": "whsec_wRNftLajMZNeslQOP6vEPm4iVx5NlZ6z"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}CNAME record and the two routing A records. You can add them all to your DNS provider in a single pass. The A records start routing traffic only after your certificate is issued, so adding them early is safe.
Optionally pass a webhook_url to receive a signed POST callback each time the subdomain’s status changes, instead of polling Get subdomain. The webhook_secret used to verify those callbacks is returned only in this response, so store it now. It can’t be retrieved later.
Subdomains are immutable. To change a subdomain, delete it and register a new one.
See the Custom subdomain setup guide for the full flow.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Management API version.
Body
The FQDN to register as a custom subdomain.
64"metrics.yourwebsite.com"
HTTPS URL that receives a signed POST callback each time the subdomain status changes, removing the need to poll GET /subdomains/{id}. The URL must be publicly reachable — IP addresses, custom ports and hosts resolving to private networks are rejected. Deliveries are signed; see webhook_secret in the create response for the verification scheme.
2048"https://customer.com/hooks/fp-subdomain"
Response
Subdomain created.
Show child attributes
Show child attributes
Was this page helpful?