import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
alias_detail = client.cdn.aliases.update(
alias_id=0,
)
print(alias_detail)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
aliasDetail, err := client.CDN.Aliases.Update(
context.TODO(),
0,
cdn.AliasUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", aliasDetail)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/aliases/{alias_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"active": false,
"automated": true,
"challenge_type": "http_01",
"ssl_id": 891
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: false, automated: true, challenge_type: 'http_01', ssl_id: 891})
};
fetch('https://api.gcore.com/cdn/aliases/{alias_id}', 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/{alias_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => false,
'automated' => true,
'challenge_type' => 'http_01',
'ssl_id' => 891
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cdn/aliases/{alias_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": false,\n \"automated\": true,\n \"challenge_type\": \"http_01\",\n \"ssl_id\": 891\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases/{alias_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"automated\": true,\n \"challenge_type\": \"http_01\",\n \"ssl_id\": 891\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"cname": "shop.example.com",
"resource_id": 4567,
"automated": true,
"challenge_type": "http_01",
"ssl_id": 890,
"active": true,
"enabled": true,
"status": "active",
"ssl_status": "issued",
"ssl_validity_not_after": "2027-01-01T10:00:00Z",
"created": "2026-09-01T10:00:00Z",
"updated": "2026-09-01T10:05:00Z",
"ssl_provisioning": {
"acme_delegation": {
"cname_name": "_acme-challenge.shop.example.com",
"cname_target": "0a1b2c3d4e5f6789.le-challenges.example.net"
},
"http_validation": {
"cname_name": "shop.example.com",
"cname_target": "cl-1a2b3c.cdn.example.net"
}
}
}{
"errors": {
"field_name": [
"Error description."
]
}
}Change alias
Change an alias. The hostname and the CDN resource of an alias cannot be changed; delete the alias and create a new one instead.
Set active to false to stop serving the alias; certificate issuance stops, though an attempt already being processed completes. Set it back to true to resume. Resuming an alias without a valid Let’s Encrypt certificate starts a new issuance attempt, which is rate-limited, so it cannot be combined with automated in one request. A renewal stopped by the pause is started again by the scheduled renewal after the alias is resumed.
For an alias with your own certificate, pass a new certificate ID in ssl_id to replace it. The new certificate must cover the alias hostname.
Pass automated to switch how the certificate is managed. Switching to your own certificate takes effect at once and the Let’s Encrypt certificate issued for the alias is removed. Switching to a Let’s Encrypt certificate starts an issuance attempt while your certificate keeps being served, and the alias starts serving the new certificate once it is issued; if the attempt fails, ssl_status becomes failed and your certificate keeps being served. The certificate mode cannot be changed while the alias is paused — resume it first.
Pass challenge_type to change how the Let’s Encrypt certificate’s domain is validated. It cannot be changed while the alias is paused, or together with active. While no valid certificate is served, the change cancels the running issuance attempt and starts a new one; this is rate-limited like resuming, and is refused while that attempt is being processed. Otherwise the new method is used from the next attempt.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
alias_detail = client.cdn.aliases.update(
alias_id=0,
)
print(alias_detail)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
aliasDetail, err := client.CDN.Aliases.Update(
context.TODO(),
0,
cdn.AliasUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", aliasDetail)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/aliases/{alias_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"active": false,
"automated": true,
"challenge_type": "http_01",
"ssl_id": 891
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: false, automated: true, challenge_type: 'http_01', ssl_id: 891})
};
fetch('https://api.gcore.com/cdn/aliases/{alias_id}', 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/{alias_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => false,
'automated' => true,
'challenge_type' => 'http_01',
'ssl_id' => 891
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cdn/aliases/{alias_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": false,\n \"automated\": true,\n \"challenge_type\": \"http_01\",\n \"ssl_id\": 891\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases/{alias_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"automated\": true,\n \"challenge_type\": \"http_01\",\n \"ssl_id\": 891\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"cname": "shop.example.com",
"resource_id": 4567,
"automated": true,
"challenge_type": "http_01",
"ssl_id": 890,
"active": true,
"enabled": true,
"status": "active",
"ssl_status": "issued",
"ssl_validity_not_after": "2027-01-01T10:00:00Z",
"created": "2026-09-01T10:00:00Z",
"updated": "2026-09-01T10:05:00Z",
"ssl_provisioning": {
"acme_delegation": {
"cname_name": "_acme-challenge.shop.example.com",
"cname_target": "0a1b2c3d4e5f6789.le-challenges.example.net"
},
"http_validation": {
"cname_name": "shop.example.com",
"cname_target": "cl-1a2b3c.cdn.example.net"
}
}
}{
"errors": {
"field_name": [
"Error description."
]
}
}Authorizations
Body
How the alias certificate is managed. Change it to switch the alias between a Let's Encrypt certificate and your own. Cannot be changed while the alias is paused.
Possible values:
true– Switch to a Let's Encrypt certificate.ssl_idmust be omitted. The current certificate keeps being served until the new one is issued.false– Switch to your own certificate.ssl_idis required and is served immediately.
true
Domain validation method used to issue the Let's Encrypt certificate. Available for an alias with automated set to true, and together with automated set to true to switch to a Let's Encrypt certificate. Cannot be changed while the alias is paused, or together with active.
While no valid certificate is served, the running issuance attempt is cancelled and a new one is started with the new method. Otherwise the new method is used from the next attempt.
dns_01, http_01 "http_01"
ID of your own SSL certificate to serve for the alias instead of the current one. The certificate must cover the alias hostname; a Let's Encrypt certificate issued for one of your CDN resources cannot be used. Available for an alias with automated set to false, and together with automated set to false to switch to your own certificate.
891
Response
Successful.
Alias status.
Possible values:
inactive– The alias or its CDN resource is disabled; the alias is not served.pending– The alias configuration has not reached the CDN yet.http_only– The alias is served over HTTP only.active– The alias is served over HTTP and HTTPS.
inactive, pending, http_only, active "active"
Outcome of the certificate we manage for the alias.
Possible values:
pending– A certificate attempt is in progress, or was stopped by pausing the alias and starts again after it is resumed.issued– The latest attempt succeeded.failed– The latest attempt ended without a certificate.null– No certificate is managed for the alias: the alias uses a certificate you provided, or is automated and has never opened an attempt.
pending, issued, failed "issued"
Was this page helpful?