Skip to main content
POST
/
prod
/
v1
/
files
/
upload
/
multipart
/
complete
Complete a multipart upload
curl --request POST \
  --url https://api.orion.file.ai/prod/v1/files/upload/multipart/complete \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "id": "upload_abc123xyz",
  "key": "org_123/workspace_456/device/file_abc/document.pdf",
  "parts": [
    {
      "partNumber": 1,
      "eTag": "\"etag1\""
    },
    {
      "partNumber": 2,
      "eTag": "\"etag2\""
    }
  ]
}
'
{
"location": "https://s3.amazonaws.com/bucket/org_123/workspace_456/device/file_abc/document.pdf",
"key": "org_123/workspace_456/device/file_abc/document.pdf",
"etag": "\"abc123def456-2\"",
"success": true
}
Complete a multipart upload after all parts have been uploaded to S3. This is the final step in the multipart upload workflow.
After uploading all parts using the presigned URLs from the initiate endpoint, call this endpoint with the ID, key, and all part ETags to finalize the upload.

How It Works

1

1. Upload All Parts

Upload each part to its respective presigned URL using PUT requests
2

2. Collect ETags

Extract the ETag from the response headers of each part upload
3

3. Complete Upload

Call this endpoint with all part ETags to finalize the multipart upload

Request Parameters

Request Body

The request body must contain a JSON object with the following properties:
PropertyTypeRequiredDescription
idstringYesThe ID from the multipart upload initiation (previously called uploadId)
keystringYesThe S3 key from the multipart upload initiation
partsarrayYesArray of objects with partNumber and eTag for each uploaded part

Parts Array Structure

Each object in the parts array should contain:
PropertyTypeRequiredDescription
partNumbernumberYesSequential part number (1, 2, 3, …)
eTagstringYesETag value from the part upload response

Complete Workflow Example

  1. Initiate Upload: Call /prod/v1/files/upload/multipart to get presigned URLs
  2. Upload Parts: Use PUT requests to upload each part to its presigned URL
  3. Complete Upload: Call this endpoint with all part ETags to finalize
After completion, the file will be automatically processed according to the parameters specified during initiation (OCR model, schema locking, etc.).

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
id
string
required

ID from the multipart upload initiation

Example:

"upload_abc123xyz"

key
string
required

S3 key from the multipart upload initiation

Example:

"org_123/workspace_456/device/file_abc/document.pdf"

parts
object[]
required

Array of completed parts with part numbers and ETags

Example:
[
{ "partNumber": 1, "eTag": "\"etag1\"" },
{ "partNumber": 2, "eTag": "\"etag2\"" }
]

Response

Multipart upload completed successfully