Skip to main content
POST
/
v1
/
apps
/
{id}
/
network
/
custom
Attach Custom Domain to Application
curl --request POST \
  --url https://api.vertracloud.app/v1/apps/{id}/network/custom \
  --header 'Content-Type: application/json' \
  --data '
{
  "custom_domain": "<string>"
}
'
import requests

url = "https://api.vertracloud.app/v1/apps/{id}/network/custom"

payload = { "custom_domain": "<string>" }
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({custom_domain: '<string>'})
};

fetch('https://api.vertracloud.app/v1/apps/{id}/network/custom', 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.vertracloud.app/v1/apps/{id}/network/custom",
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([
'custom_domain' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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.vertracloud.app/v1/apps/{id}/network/custom"

payload := strings.NewReader("{\n \"custom_domain\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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.vertracloud.app/v1/apps/{id}/network/custom")
.header("Content-Type", "application/json")
.body("{\n \"custom_domain\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vertracloud.app/v1/apps/{id}/network/custom")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_domain\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{}
id
string
required
The ID of the application to attach the custom domain to.
custom_domain
string
required
The custom domain to attach to the application (e.g., example.com). Use "@" to remove the custom domain.

Response

{}

Error Responses

code
string
The error code indicating the reason for failure. Possible values:
  • UNAUTHORIZED: The user is not authenticated or lacks sufficient permissions.
  • PLAN_RESTRICTED_FEATURE: The user’s plan does not support custom domains.
  • INVALID_CUSTOM_DOMAIN: No custom domain was provided.
  • INVALID_CUSTOM_DOMAIN_FORMAT: The provided domain format is invalid.
  • FORBIDDEN_DOMAIN: The provided domain is restricted.
  • DOMAIN_ALREADY_IN_USE: The provided domain is already in use by another application.
  • APP_NOT_FOUND: The specified application does not exist or does not belong to the user.
  • USER_LIMITS_NOT_FOUND: The user’s plan limits could not be found.
  • NO_CONFIG_FILE: The application’s configuration file is missing.
  • INVALID_CONFIG: The application’s configuration file is invalid.
  • INVALID_MEMORY: The requested memory is invalid or exceeds plan limits.
  • FAILED_TO_REBUILD_APP: The application could not be rebuilt with the new configuration.
message
string
A descriptive message providing additional details about the error.
{
  "code": "UNAUTHORIZED"
}
{
  "code": "INVALID_CUSTOM_DOMAIN_FORMAT"
}
{
  "code": "APP_NOT_FOUND"
}