Point an alias at a deployment
import requests
url = "https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name}"
payload = { "deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({deployment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "uploading",
"alias": "<string>",
"source": "api",
"file_count": 123,
"total_bytes": 123,
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z",
"upload_expires_at": "2023-11-07T05:31:56Z",
"error_message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}Pages
Point an alias at a deployment
Points an alias of the site at one of its live-ready deployments: roll production back to an earlier deployment, or promote a preview. Needs applications.deploy.
PUT
/
api
/
v1
/
org
/
pages
/
sites
/
{site_name}
/
aliases
/
{alias_name}
Point an alias at a deployment
import requests
url = "https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name}"
payload = { "deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({deployment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/aliases/{alias_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "uploading",
"alias": "<string>",
"source": "api",
"file_count": 123,
"total_bytes": 123,
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z",
"upload_expires_at": "2023-11-07T05:31:56Z",
"error_message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}Authorizations
Path Parameters
Response
The alias now serves the deployment.
An immutable deployment of a site. A deployment still uploading when its upload window closes is expired: it can no longer be finalized.