curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/abort \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
upload_id = "upl_1mehceg8cn80qsekh46143whrx"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/files/uploads/{upload_id}/abort",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.ok:
print(f"Upload aborted: {upload_id}")
else:
print(f"Error: {response.status_code} {response.text}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/abort`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
if (response.ok) {
console.log(`Upload aborted: ${uploadId}`);
} else {
console.error(`Error: ${response.status} ${await response.text()}`);
}
(empty body)
{
"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": "upload_not_found",
"message": "No upload with the given upload_id was found for the organization.",
"suggestion": "Verify the upload_id and that the upload has not already been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed and cannot be aborted.",
"suggestion": "Delete the resulting file via /files/delete/{file_id} if it should not be kept.",
"error_uid": "err-xxxxxxxx"
}
]
}
Files API
Abort Upload
Abort an in-progress direct-to-cloud upload and clean up its resources
POST
/
files
/
uploads
/
{upload_id}
/
abort
curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/abort \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
upload_id = "upl_1mehceg8cn80qsekh46143whrx"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/files/uploads/{upload_id}/abort",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.ok:
print(f"Upload aborted: {upload_id}")
else:
print(f"Error: {response.status_code} {response.text}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/abort`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
if (response.ok) {
console.log(`Upload aborted: ${uploadId}`);
} else {
console.error(`Error: ${response.status} ${await response.text()}`);
}
(empty body)
{
"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": "upload_not_found",
"message": "No upload with the given upload_id was found for the organization.",
"suggestion": "Verify the upload_id and that the upload has not already been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed and cannot be aborted.",
"suggestion": "Delete the resulting file via /files/delete/{file_id} if it should not be kept.",
"error_uid": "err-xxxxxxxx"
}
]
}
Overview
Abort an in-progress direct-to-cloud upload. The server invalidates the upload, releases any reserved storage, and discards any checkpointedpart_tokens.
Aborting an already-completed upload returns 409. Use this endpoint when you can’t or don’t want to finish an upload — for example, when the source file is no longer available or the client crashed mid-upload.
Path Parameters
string
required
Upload identifier returned by Initiate Upload
Response
The response body is empty when the abort succeeds.curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/abort \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
upload_id = "upl_1mehceg8cn80qsekh46143whrx"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/files/uploads/{upload_id}/abort",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.ok:
print(f"Upload aborted: {upload_id}")
else:
print(f"Error: {response.status_code} {response.text}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/abort`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
},
}
);
if (response.ok) {
console.log(`Upload aborted: ${uploadId}`);
} else {
console.error(`Error: ${response.status} ${await response.text()}`);
}
(empty body)
{
"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": "upload_not_found",
"message": "No upload with the given upload_id was found for the organization.",
"suggestion": "Verify the upload_id and that the upload has not already been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed and cannot be aborted.",
"suggestion": "Delete the resulting file via /files/delete/{file_id} if it should not be kept.",
"error_uid": "err-xxxxxxxx"
}
]
}
Was this page helpful?
⌘I