Create a deployment
import requests
url = "https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/deployments"
payload = { "files": [
{
"path": "<string>",
"sha256": "<string>",
"size_bytes": 1
}
] }
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({files: [{path: '<string>', sha256: '<string>', size_bytes: 1}]})
};
fetch('https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/deployments', 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/org/pages/sites/{site_name}/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"sha256": "<string>",
"size_bytes": 1
}
]
}
'{
"deployment": {
"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>"
},
"uploads": [
{
"sha256": "<string>",
"size_bytes": 123,
"method": "PUT",
"url": "<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>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}Pages
Create a deployment
Records a deployment from a manifest of every file’s path, SHA-256 and size. Files the organisation already stores are reused. For every other file the answer carries a presigned upload URL: PUT exactly the declared bytes to it, then finalize the deployment. A manifest whose files are all stored already goes live in this call. Empty files are never uploaded. Needs applications.deploy.
POST
/
api
/
v1
/
org
/
pages
/
sites
/
{site_name}
/
deployments
Create a deployment
import requests
url = "https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/deployments"
payload = { "files": [
{
"path": "<string>",
"sha256": "<string>",
"size_bytes": 1
}
] }
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({files: [{path: '<string>', sha256: '<string>', size_bytes: 1}]})
};
fetch('https://platform.ankra.app/api/v1/org/pages/sites/{site_name}/deployments', 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/org/pages/sites/{site_name}/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"sha256": "<string>",
"size_bytes": 1
}
]
}
'{
"deployment": {
"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>"
},
"uploads": [
{
"sha256": "<string>",
"size_bytes": 123,
"method": "PUT",
"url": "<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>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"missing_sha256": [
"<string>"
]
}Authorizations
Body
application/json
Response
The deployment was recorded; uploads lists the files still to upload, empty when it is already live.