curl -X DELETE https://api.u1.archetypeai.app/v0.5/files/delete/file-abc123 \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
file_id = "file-abc123"
response = requests.delete(
f"https://api.u1.archetypeai.app/v0.5/files/delete/{file_id}",
headers={"Authorization": f"Bearer {api_key}"},
)
result = response.json()
if result.get("is_valid"):
print(f"Deleted: {result['file_id']}")
else:
print(f"Errors: {result.get('errors')}")
const fileId = "file-abc123";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/delete/${fileId}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
const result = await response.json();
if (result.is_valid) {
console.log(`Deleted: ${result.file_id}`);
} else {
console.error("Errors:", result.errors);
}
{
"is_valid": true,
"file_id": "file-abc123",
"file_uid": "8f2c1e5a-7b3d-4d9e-9c1a-2f5b7d8e4a6c"
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "file_not_found",
"message": "No file with the given file_id was found for the organization.",
"suggestion": "Verify the file_id and that the file has not already been deleted.",
"error_uid": "err-xxxxxxxx"
}
]
}
Files API
Delete File
Delete a file from the authenticated organization
DELETE
/
files
/
delete
/
{file_id}
curl -X DELETE https://api.u1.archetypeai.app/v0.5/files/delete/file-abc123 \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
file_id = "file-abc123"
response = requests.delete(
f"https://api.u1.archetypeai.app/v0.5/files/delete/{file_id}",
headers={"Authorization": f"Bearer {api_key}"},
)
result = response.json()
if result.get("is_valid"):
print(f"Deleted: {result['file_id']}")
else:
print(f"Errors: {result.get('errors')}")
const fileId = "file-abc123";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/delete/${fileId}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
const result = await response.json();
if (result.is_valid) {
console.log(`Deleted: ${result.file_id}`);
} else {
console.error("Errors:", result.errors);
}
{
"is_valid": true,
"file_id": "file-abc123",
"file_uid": "8f2c1e5a-7b3d-4d9e-9c1a-2f5b7d8e4a6c"
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "file_not_found",
"message": "No file with the given file_id was found for the organization.",
"suggestion": "Verify the file_id and that the file has not already been deleted.",
"error_uid": "err-xxxxxxxx"
}
]
}
Overview
This endpoint deletes a file from the authenticated organization. The file is removed from the available files list and its contents are scheduled for deletion from storage.Path Parameters
string
required
Identifier of the file to delete (returned by Upload File or Complete Upload)
Response
boolean
Whether the deletion was successful. Check this field to detect errors.
string
Identifier of the file that was deleted
string
Internal unique identifier of the deleted file
curl -X DELETE https://api.u1.archetypeai.app/v0.5/files/delete/file-abc123 \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
file_id = "file-abc123"
response = requests.delete(
f"https://api.u1.archetypeai.app/v0.5/files/delete/{file_id}",
headers={"Authorization": f"Bearer {api_key}"},
)
result = response.json()
if result.get("is_valid"):
print(f"Deleted: {result['file_id']}")
else:
print(f"Errors: {result.get('errors')}")
const fileId = "file-abc123";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/delete/${fileId}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
const result = await response.json();
if (result.is_valid) {
console.log(`Deleted: ${result.file_id}`);
} else {
console.error("Errors:", result.errors);
}
{
"is_valid": true,
"file_id": "file-abc123",
"file_uid": "8f2c1e5a-7b3d-4d9e-9c1a-2f5b7d8e4a6c"
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "file_not_found",
"message": "No file with the given file_id was found for the organization.",
"suggestion": "Verify the file_id and that the file has not already been deleted.",
"error_uid": "err-xxxxxxxx"
}
]
}
Was this page helpful?
⌘I