import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones"
payload = {
"credential_name": "smartoptics-dns",
"zone": "launch.smartoptics.dev"
}
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({credential_name: 'smartoptics-dns', zone: 'launch.smartoptics.dev'})
};
fetch('https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_name": "smartoptics-dns",
"zone": "launch.smartoptics.dev"
}
'{
"success": true,
"zone": "<string>",
"credential_name": "<string>",
"provider": "<string>",
"policy": "<string>",
"cloudflare_zone": "<string>",
"dns_edit_access": "granted"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Declare a custom DNS zone on the cluster
The DNS zones this cluster serves with the organisation’s own external-dns webhook credential, alongside the delegated zone Ankra serves itself. Ankra’s own Avura token is pinned to Ankra’s account, so ingress hosts on a zone the customer holds in their own provider account are dropped server-side and publish nothing. Declaring the zone here has Ankra render and own an external-dns deployment for it, pinned to that zone with its own txt owner id. A zone that overlaps the delegated zone Ankra already serves for this cluster is refused with 400: two sync-policy controllers on one zone delete each other’s records.
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones"
payload = {
"credential_name": "smartoptics-dns",
"zone": "launch.smartoptics.dev"
}
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({credential_name: 'smartoptics-dns', zone: 'launch.smartoptics.dev'})
};
fetch('https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/{cluster_id}/custom-dns-zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_name": "smartoptics-dns",
"zone": "launch.smartoptics.dev"
}
'{
"success": true,
"zone": "<string>",
"credential_name": "<string>",
"provider": "<string>",
"policy": "<string>",
"cloudflare_zone": "<string>",
"dns_edit_access": "granted"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
Body
Optional. Which kind of credential credential_name must be: 'cloudflare', 'webhook' or 'avura'. A mismatch is refused (400). With 'cloudflare', or whenever the name resolves to a Cloudflare credential, Ankra first checks with Cloudflare that the token reaches the zone with DNS edit.
cloudflare, webhook, avura Response
The stored, normalised binding
Declare only: how the zone is published ('cloudflare', 'webhook' or 'avura').
Declare only: the external-dns policy the zone's controller runs ('upsert-only' for Cloudflare, 'sync' otherwise).
Declare of a Cloudflare-bound zone only: the Cloudflare zone the records land in (the declared zone or the nearest ancestor zone).
Declare of a Cloudflare-bound zone only: 'granted' when Cloudflare listed DNS edit for the token on the zone, 'unknown' when Cloudflare did not report the token's permissions.
granted, unknown