curl -X DELETE "$ATAI_API_URL/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_URL"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Project deleted")
elif response.status_code == 409:
print("Project is not empty: delete what it holds first")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_URL}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Project deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
{
"errors": [
{
"code": "<error_code>",
"message": "The caller is read-only.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Project not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "The project is not empty.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Projects API
Delete Project
Delete an empty project by ID
DELETE
/
api
/
projects
/
{project_id}
curl -X DELETE "$ATAI_API_URL/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_URL"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Project deleted")
elif response.status_code == 409:
print("Project is not empty: delete what it holds first")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_URL}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Project deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
{
"errors": [
{
"code": "<error_code>",
"message": "The caller is read-only.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Project not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "The project is not empty.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Requires version 2.0.0 or later of the Archetype platform.
Overview
This endpoint deletes a project by itsprj_ ID.
Only an empty project can be deleted. While the project still holds blueprints, evals,
optimizations, packages, or agent runs, this endpoint returns HTTP status
409. Delete what it
holds first.Request
string
required
Project
prj_ ID.Response
Returns204 No Content with an empty body on success.
curl -X DELETE "$ATAI_API_URL/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_URL"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.delete(
f"{base_url}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 204:
print("Project deleted")
elif response.status_code == 409:
print("Project is not empty: delete what it holds first")
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_URL}/api/projects/prj_01jcd4m8t2vq6xn3r7k5hbzw9e`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
if (response.status === 204) {
console.log('Project deleted');
} else {
const body = await response.json();
console.error('Error:', body.errors);
}
{
"errors": [
{
"code": "<error_code>",
"message": "The caller is read-only.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Project not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "The project is not empty.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Important Notes
- Deleting a project is permanent. There is no way to restore it.
403means the caller has the read-onlyviewerrole.404means the project does not exist or is not visible to you.- Success returns
204with no body. Check the status code rather than parsing a response.
Was this page helpful?