import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id} \
--header 'Authorization: Bearer <token>'{
"success": true,
"stack_name": "<string>",
"already_discarded": true,
"reason": "<string>"
}Discard a stack draft
Discards one stack draft on the cluster without deploying it; the deployed stack, if any, is left untouched. A draft an Ankra AI chat is still bound to, or one the AI wrote moments ago, is protected: the answer is 200 with already_discarded true and reason protected, and nothing is written, unless force is true. Discarding a draft that is already gone answers 200 with already_discarded true and the original reason. Answers 404 with code DRAFT_UNKNOWN for a draft that never existed on the cluster, and 409 for the installation draft of a managed service, which is removed by retiring the service.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/drafts/stacks/{draft_id} \
--header 'Authorization: Bearer <token>'{
"success": true,
"stack_name": "<string>",
"already_discarded": true,
"reason": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Discard even a draft an AI chat is bound to or has just written.
Response
Draft discarded, already discarded, or protected
True when this call discarded nothing: the draft was already gone, or it is protected.
USER_DISCARD for a discard by a person, protected for a draft the guard kept, or the reason recorded when the draft ended earlier.