curl --request POST \
--url https://api.ravion.com/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"moduleInstanceId": "<string>",
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<string>"
}
'import requests
url = "https://api.ravion.com/domains"
payload = {
"name": "<string>",
"moduleInstanceId": "<string>",
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<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({
name: '<string>',
moduleInstanceId: '<string>',
parentDomainName: '<string>',
targetDnsName: '<string>',
targetZoneId: '<string>'
})
};
fetch('https://api.ravion.com/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.ravion.com/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([
'name' => '<string>',
'moduleInstanceId' => '<string>',
'parentDomainName' => '<string>',
'targetDnsName' => '<string>',
'targetZoneId' => '<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.ravion.com/domains"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<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.ravion.com/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/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 \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"domainName": "<string>",
"id": "<string>",
"managedByRavion": true,
"moduleInstanceId": "<string>",
"records": [
{
"expected": "<string>",
"name": "<string>",
"ownership": "<string>",
"role": "<string>",
"type": "<string>"
}
],
"url": "<string>",
"verified": true,
"certificate": {
"arn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"issuedAt": "2023-11-07T05:31:56Z",
"status": "<string>"
},
"parent": {
"environmentId": "<string>",
"moduleInstanceId": "<string>",
"name": "<string>",
"projectId": "<string>"
},
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Create Domain
Allocate a domain name and its DNS routing record. Nesting under a parentDomainName is only allowed for an apex you own or reference.
curl --request POST \
--url https://api.ravion.com/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"moduleInstanceId": "<string>",
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<string>"
}
'import requests
url = "https://api.ravion.com/domains"
payload = {
"name": "<string>",
"moduleInstanceId": "<string>",
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<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({
name: '<string>',
moduleInstanceId: '<string>',
parentDomainName: '<string>',
targetDnsName: '<string>',
targetZoneId: '<string>'
})
};
fetch('https://api.ravion.com/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.ravion.com/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([
'name' => '<string>',
'moduleInstanceId' => '<string>',
'parentDomainName' => '<string>',
'targetDnsName' => '<string>',
'targetZoneId' => '<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.ravion.com/domains"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<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.ravion.com/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/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 \"name\": \"<string>\",\n \"moduleInstanceId\": \"<string>\",\n \"parentDomainName\": \"<string>\",\n \"targetDnsName\": \"<string>\",\n \"targetZoneId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"domainName": "<string>",
"id": "<string>",
"managedByRavion": true,
"moduleInstanceId": "<string>",
"records": [
{
"expected": "<string>",
"name": "<string>",
"ownership": "<string>",
"role": "<string>",
"type": "<string>"
}
],
"url": "<string>",
"verified": true,
"certificate": {
"arn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"issuedAt": "2023-11-07T05:31:56Z",
"status": "<string>"
},
"parent": {
"environmentId": "<string>",
"moduleInstanceId": "<string>",
"name": "<string>",
"projectId": "<string>"
},
"parentDomainName": "<string>",
"targetDnsName": "<string>",
"targetZoneId": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Body
Inputs to allocate a domain. Set parentDomainName to nest under a shared wildcard apex (inheriting its certificate); otherwise set the routing target fields to point a custom domain at your load balancer or distribution.
The leaf name when nesting under an apex, or the full domain name for a custom domain.
Id of the module instance this domain belongs to. Optional for a runner call (the instance is derived from the run); required for a service-account API key. Must belong to your organization.
The wildcard apex to nest under. When set, the domain becomes <name>.<parentDomainName> and inherits the apex's certificate.
The DNS name to route traffic to (a load balancer or CloudFront distribution domain).
The hosted zone id of the routing target (your load balancer's zone, or Z2FDTNDATAQYW2 for CloudFront).
Response
The request has succeeded and a new resource has been created as a result.
A domain and its current routing, certificate, and DNS-record state. The create-time name/parentDomainName inputs are not returned — changing either replaces the domain.
Show child attributes
Show child attributes
Was this page helpful?