curl --request POST \
--url https://api.gcore.com/cdn/aliases \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cname": "shop.customer.com",
"resource_id": 4567,
"ssl_id": 890,
"automated": true,
"active": true
}
'import requests
url = "https://api.gcore.com/cdn/aliases"
payload = {
"cname": "shop.customer.com",
"resource_id": 4567,
"ssl_id": 890,
"automated": True,
"active": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cname: 'shop.customer.com',
resource_id: 4567,
ssl_id: 890,
automated: true,
active: true
})
};
fetch('https://api.gcore.com/cdn/aliases', 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.gcore.com/cdn/aliases",
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([
'cname' => 'shop.customer.com',
'resource_id' => 4567,
'ssl_id' => 890,
'automated' => true,
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/cdn/aliases"
payload := strings.NewReader("{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.gcore.com/cdn/aliases")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"cname": "shop.customer.com",
"resource_id": 4567,
"automated": true,
"ssl_id": 890,
"active": true,
"enabled": true,
"status": "active",
"created": "2026-09-01T10:00:00Z",
"updated": "2026-09-01T10:05:00Z"
}{
"errors": {
"field_name": [
"Error description."
]
}
}Create alias
Create an alias: a hostname you own that is served with the settings of one of your CDN resources and with its own SSL certificate.
By default, a Let’s Encrypt certificate is issued for the alias automatically. Until the certificate
is issued the alias stays in the pending status.
To use your own certificate instead, pass its ID in ssl_id. The certificate must cover the alias
hostname; a Let’s Encrypt certificate issued for one of your CDN resources cannot be used. Such an alias
becomes active immediately.
The hostname must be unique across all CDN resources, additional CNAMEs and aliases.
curl --request POST \
--url https://api.gcore.com/cdn/aliases \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cname": "shop.customer.com",
"resource_id": 4567,
"ssl_id": 890,
"automated": true,
"active": true
}
'import requests
url = "https://api.gcore.com/cdn/aliases"
payload = {
"cname": "shop.customer.com",
"resource_id": 4567,
"ssl_id": 890,
"automated": True,
"active": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cname: 'shop.customer.com',
resource_id: 4567,
ssl_id: 890,
automated: true,
active: true
})
};
fetch('https://api.gcore.com/cdn/aliases', 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.gcore.com/cdn/aliases",
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([
'cname' => 'shop.customer.com',
'resource_id' => 4567,
'ssl_id' => 890,
'automated' => true,
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/cdn/aliases"
payload := strings.NewReader("{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.gcore.com/cdn/aliases")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cname\": \"shop.customer.com\",\n \"resource_id\": 4567,\n \"ssl_id\": 890,\n \"automated\": true,\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"cname": "shop.customer.com",
"resource_id": 4567,
"automated": true,
"ssl_id": 890,
"active": true,
"enabled": true,
"status": "active",
"created": "2026-09-01T10:00:00Z",
"updated": "2026-09-01T10:05:00Z"
}{
"errors": {
"field_name": [
"Error description."
]
}
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Body
Alias hostname. Wildcard hostnames are not supported.
"shop.customer.com"
ID of the CDN resource whose settings the alias is served with.
4567
ID of your own SSL certificate to serve for the alias. The certificate must cover the alias hostname. A Let's Encrypt certificate issued for one of your CDN resources cannot be used.
Omit it to have a Let's Encrypt certificate issued automatically.
890
How the alias certificate is managed. Defaults to true when ssl_id is omitted and to false
when ssl_id is passed.
Possible values:
- true – A Let's Encrypt certificate is issued and renewed automatically.
ssl_idmust be omitted. - false – Your own certificate is served.
ssl_idis required.
true
Whether the alias is enabled. Defaults to true. The alias is served once its certificate is ready.
true
Response
Successful.
Alias ID.
123
Alias hostname. Cannot be changed after creation.
"shop.customer.com"
ID of the CDN resource whose settings the alias is served with. Cannot be changed after creation.
4567
How the alias certificate is managed.
Possible values:
- true – A Let's Encrypt certificate is issued and renewed automatically.
- false – The certificate referenced by
ssl_idwas added by you.
true
ID of the SSL certificate served for the alias.
890
Whether you have enabled the alias. Enabling it does not by itself make it live: the alias is served only
while status is active, ssl_issuing or ssl_error.
Possible values:
- true – The alias is enabled and is served once its certificate is ready.
- false – The alias is paused and is not served.
true
Whether the alias is enabled by the system. Follows the state of the CDN resource.
Possible values:
- true – The alias can be served.
- false – The alias is not served because its CDN resource is not active.
true
Alias status.
Possible values:
- pending – The certificate has not been issued yet; the alias is not served.
- active – The alias is served with its certificate.
ssl_issuing– A new certificate is being issued; the current one keeps being served.ssl_error– Certificate issuance failed; a previously issued certificate keeps being served.- inactive – The alias or its CDN resource is disabled; the alias is not served.
pending, active, ssl_issuing, ssl_error, inactive "active"
Date and time when the alias was created (ISO 8601/RFC 3339 format, UTC.)
"2026-09-01T10:00:00Z"
Date and time when the alias was last changed (ISO 8601/RFC 3339 format, UTC.)
"2026-09-01T10:05:00Z"
Was this page helpful?