curl -X PUT 'https://your-hatch-server/api/sites/{id}/domain' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"domain": "string"
}'
const res = await fetch("https://your-hatch-server/api/sites/{id}/domain", {
method: "PUT",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"domain": "string"
}),
})
const data = await res.json()
import requests
res = requests.request("PUT", "https://your-hatch-server/api/sites/{id}/domain", headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"}, json={
"domain": "string",
})
data = res.json()
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"domain": "string"
}`)
req, err := http.NewRequest("PUT", "https://your-hatch-server/api/sites/{id}/domain", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}
require "net/http"
require "json"
uri = URI('https://your-hatch-server/api/sites/{id}/domain')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'Bearer <token>'
req['Content-Type'] = 'application/json'
req.body = JSON.generate({
'domain' => 'string'
})
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(req)
end
puts res.body
<?php
$ch = curl_init('https://your-hatch-server/api/sites/{id}/domain');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"domain": "string"
}',
]);
$response = curl_exec($ch);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://your-hatch-server/api/sites/{id}/domain"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\"domain\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"domain": {
"domain": "string",
"verified": true,
"proof": true,
"pointing": true,
"checkedAt": 0,
"records": [
{
"type": "CNAME",
"name": "string",
"value": "string"
}
],
"addresses": [
"string"
]
},
"target": "string"
}
{
"message": "string",
"code": "string",
"retryable": true,
"requestId": "string"
}