Skip to main content
POST
/
files
/
uploads
/
{upload_id}
/
complete
curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/complete \
  -H "Authorization: Bearer $ATAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      { "part_number": 4, "part_token": "\"f912ab83e0d1...\"" },
      { "part_number": 5, "part_token": "\"203fa182b97c...\"" }
    ]
  }'
{
  "file_uid": "fil_5hx819ysp38n2rt1f5fv0wsxgh",
  "file_name": "training-data.parquet",
  "num_bytes": 1073741824,
  "file_status": "Registered",
  "file_attributes": {
    "metadata_status": "not_extracted"
  }
}

Overview

Finalize a direct-to-cloud upload after the client has PUT every part to its presigned URL. The server validates the supplied part_tokens, assembles the final file, and registers it with the organization. Parts already submitted via Checkpoint Upload Parts do not need to be repeated here — only supply tokens for parts not yet checkpointed.
Direct-to-cloud file uploads support files up to 250GB.

Path Parameters

upload_id
string
required
Upload identifier returned by Initiate Upload

Request Body

parts
array
required
Completed parts that have not already been checkpointed. Pass an empty array when every part of the upload has been checkpointed.
integrity_checksum
string
Optional whole-file checksum, base64-encoded. When provided, the server queries the storage backend for the checksum it computed over the full object and compares; a mismatch marks the file as corrupt and returns an error. Omit to skip verification entirely.The encoding and byte length must match the algorithm returned by Initiate Upload (e.g. crc32c → 4 raw bytes → 8 base64 characters with = padding). Sending a checksum when integrity_algorithm: none is returned is an error.

Response

file_uid
string
Internal unique identifier of the completed file
file_name
string
Name of the completed file
num_bytes
integer
Total size of the completed file in bytes
file_status
string
Lifecycle status of the file. After a successful upload, the status is Registered. Other values are: Unknown, Uploading, Ingested, Deleting, Deleted, and Corrupt.
The format of the status string returned for direct-to-cloud uploads is different from the file_status string returned by the Get File Metadata endpoint.
file_attributes
object
Type-specific attributes for the file. Shape depends on the file type — see Get File Metadata for the variants.
curl -X POST https://api.u1.archetypeai.app/v0.5/files/uploads/upl_1mehceg8cn80qsekh46143whrx/complete \
  -H "Authorization: Bearer $ATAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      { "part_number": 4, "part_token": "\"f912ab83e0d1...\"" },
      { "part_number": 5, "part_token": "\"203fa182b97c...\"" }
    ]
  }'
{
  "file_uid": "fil_5hx819ysp38n2rt1f5fv0wsxgh",
  "file_name": "training-data.parquet",
  "num_bytes": 1073741824,
  "file_status": "Registered",
  "file_attributes": {
    "metadata_status": "not_extracted"
  }
}