curl -X DELETE "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Deployment deleted")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Deployment deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
Deployments
Delete Deployment
Delete a stopped or failed deployment that has no sessions left
DELETE
/
api
/
agents
/
deployments
/
{deployment_id}
curl -X DELETE "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Deployment deleted")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Deployment deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
Requires version 2.0.1 or later of the Archetype platform.
Overview
This endpoint deletes a deployment that isstopped or failed and has no sessions left.
To delete a deployment that is still ready, stop it
first. Then delete each of its sessions with Delete
Session; list them with List
Sessions and deployment_id.
With its deployments gone, a package can be deleted, and then its project.
Request
Response
Returns204 No Content with an empty body on success.
curl -X DELETE "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Deployment deleted")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Deployment deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
Important Notes
- A
409means the deployment is notstoppedorfailed, or still has sessions. - A
403means you can see the deployment’s project but cannot modify it. - A
404means the deployment does not exist, belongs to another organization, or is in a project you cannot see. - Success returns
204with no body. Check the status code rather than parsing a response.
Was this page helpful?