curl --request POST \
--url https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostname": "<string>",
"environment": "<string>"
}
'import requests
url = "https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains"
payload = {
"hostname": "<string>",
"environment": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostname: '<string>', environment: '<string>'})
};
fetch('https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains', 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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains",
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([
'hostname' => '<string>',
'environment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains"
payload := strings.NewReader("{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hostname": "<string>",
"environment": "<string>",
"status": "pending_dns",
"verificationErrors": "<string>",
"instructions": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}Add
Add a custom domain to a project environment (production by default) and get the CNAME record to create.
curl --request POST \
--url https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostname": "<string>",
"environment": "<string>"
}
'import requests
url = "https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains"
payload = {
"hostname": "<string>",
"environment": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostname: '<string>', environment: '<string>'})
};
fetch('https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains', 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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains",
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([
'hostname' => '<string>',
'environment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains"
payload := strings.NewReader("{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostname\": \"<string>\",\n \"environment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hostname": "<string>",
"environment": "<string>",
"status": "pending_dns",
"verificationErrors": "<string>",
"instructions": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The organization's id (UUID) or slug — either form is accepted.
The project's id (UUID) or slug — either form is accepted.
Body
Hostname you control, e.g. "app.acme.com".
^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$Environment the domain routes to. Defaults to "production". An environment that does not exist on the project answers 404. The preview environment answers 422: preview apps are ephemeral per-pull-request deployments, so a stable hostname can never attach to them.
^[a-z][a-z0-9-]{0,38}$Response
Domain registered. Create the CNAME from the instructions, then check the domain until it goes active.
^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$Slug of the environment this domain routes to.
^[a-z][a-z0-9-]{0,38}$Verification state: pending_dns until the CNAME points at the platform, pending_ssl while the certificate is issued, then active. failed is terminal.
pending_dns, pending_ssl, active, failed Why verification is stuck, when the edge reported a reason.
DNS setup step. Production domains target the project's managed subdomain, e.g. "CNAME app.acme.com → my-app.korve.app"; domains on other environments target that environment's own subdomain, e.g. "CNAME staging.acme.com → my-app-staging.korve.app".