curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/parts/urls \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"part_numbers": [43, 44, 45]
}'
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}/parts/urls",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"part_numbers": [43, 44, 45]},
)
for part in response.json()["parts"]:
print(f"part {part['part_number']}: expires {part['expires_at']}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/parts/urls`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ part_numbers: [43, 44, 45] }),
}
);
const { parts } = await response.json();
for (const p of parts) {
console.log(`part ${p.part_number}: expires ${p.expires_at}`);
}
{
"parts": [
{
"part_number": 43,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/43?X-Amz-Signature=...",
"offset": 352321536,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 44,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/44?X-Amz-Signature=...",
"offset": 360710144,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 45,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/45?X-Amz-Signature=...",
"offset": 369098752,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
}
]
}
{
"errors": [
{
"code": "invalid_upload_parts",
"message": "Part numbers must be non-empty and within [1, num_parts].",
"suggestion": "Check the parts/part_numbers array in your request",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"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 been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed; no further URLs can be generated.",
"suggestion": "Use the file_id returned by /complete to operate on the file.",
"error_uid": "err-xxxxxxxx"
}
]
}
Files API
Generate Upload Part URLs
Request fresh presigned URLs for specific parts of an in-progress upload
POST
/
files
/
uploads
/
{upload_id}
/
parts
/
urls
curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/parts/urls \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"part_numbers": [43, 44, 45]
}'
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}/parts/urls",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"part_numbers": [43, 44, 45]},
)
for part in response.json()["parts"]:
print(f"part {part['part_number']}: expires {part['expires_at']}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/parts/urls`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ part_numbers: [43, 44, 45] }),
}
);
const { parts } = await response.json();
for (const p of parts) {
console.log(`part ${p.part_number}: expires ${p.expires_at}`);
}
{
"parts": [
{
"part_number": 43,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/43?X-Amz-Signature=...",
"offset": 352321536,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 44,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/44?X-Amz-Signature=...",
"offset": 360710144,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 45,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/45?X-Amz-Signature=...",
"offset": 369098752,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
}
]
}
{
"errors": [
{
"code": "invalid_upload_parts",
"message": "Part numbers must be non-empty and within [1, num_parts].",
"suggestion": "Check the parts/part_numbers array in your request",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"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 been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed; no further URLs can be generated.",
"suggestion": "Use the file_id returned by /complete to operate on the file.",
"error_uid": "err-xxxxxxxx"
}
]
}
Overview
Generate presigned URLs for specific parts of an in-progress upload. Use this when a presigned URL returned from Initiate Upload is about to expire and the part has not yet been uploaded. For each requested part, the response may contain either a freshly generated URL or a previously issued one that is not close to expiration;expires_at always reflects the URL actually returned.
The response’s parts array has the same length and order as the request’s part_numbers. Duplicate part numbers in the request produce duplicate entries in the response that share a single presigned URL.
Part numbers are 1-based — the first part of an upload is
1, not 0.Path Parameters
string
required
Upload identifier returned by Initiate Upload
Request Body
array
required
1-based part numbers to generate presigned URLs for. Each entry must be in range for the upload (
1 ≤ part_number ≤ num_parts).Response
array
One descriptor per entry in
part_numbers, in the same ordercurl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/parts/urls \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"part_numbers": [43, 44, 45]
}'
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}/parts/urls",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"part_numbers": [43, 44, 45]},
)
for part in response.json()["parts"]:
print(f"part {part['part_number']}: expires {part['expires_at']}")
const uploadId = "upl_1mehceg8cn80qsekh46143whrx";
const response = await fetch(
`https://api.u1.archetypeai.app/v0.5/files/uploads/${uploadId}/parts/urls`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATAI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ part_numbers: [43, 44, 45] }),
}
);
const { parts } = await response.json();
for (const p of parts) {
console.log(`part ${p.part_number}: expires ${p.expires_at}`);
}
{
"parts": [
{
"part_number": 43,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/43?X-Amz-Signature=...",
"offset": 352321536,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 44,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/44?X-Amz-Signature=...",
"offset": 360710144,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
},
{
"part_number": 45,
"url": "https://storage.example.com/upload/upl_1mehceg8cn80qsekh46143whrx/45?X-Amz-Signature=...",
"offset": 369098752,
"length": 8388608,
"expires_at": "2026-04-28T16:18:42Z"
}
]
}
{
"errors": [
{
"code": "invalid_upload_parts",
"message": "Part numbers must be non-empty and within [1, num_parts].",
"suggestion": "Check the parts/part_numbers array in your request",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"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 been completed or aborted.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "upload_already_completed",
"message": "Upload has already been completed; no further URLs can be generated.",
"suggestion": "Use the file_id returned by /complete to operate on the file.",
"error_uid": "err-xxxxxxxx"
}
]
}
Was this page helpful?
⌘I