POST
/
prod
/
v1
/
files
/
upload
Upload a file
curl --request POST \
  --url https://api.orion.file.ai/prod/v1/files/upload \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "fileName": "file.pdf",
  "fileType": "application/pdf",
  "isSplit": false,
  "callbackURL": "https://example.com/callback",
  "ocrModel": "Beethoven_ENG_O5.1",
  "schemaLocking": false,
  "directoryId": "649e2d2d2d2d2d2d2d2d2d2d"
}'
{
  "s3Path": "s3://bucket/upload/file.txt",
  "presignedUploadURL": "https://s3.amazonaws.com/bucket/upload/file.txt?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=1%2F6%2BN7Z6h%2F7oV7Z6i%2F9oV7Z4%3D&Expires=3600",
  "uploadId": "f2538513-f0b9-4aa8-9c57-bc0a85c77de6",
  "callbackURL": "https://example.com/callback",
  "ocrModel": "Beethoven_ENG_G5.0",
  "schemaLocking": true,
  "directoryId": "649e2d2d2d2d2d2d2d2d2d2d"
}
The presignedUploadURL is valid for 3600 seconds (1 hour) and can be used multiple times. The input should contain the following information:
  • fileName: the name of the file to be uploaded
  • fileType: the type of the file to be uploaded
  • isSplit: whether the file is a split file or not
  • callbackURL: the url that will be called after the file is uploaded
  • ocrModel: the ocr model to be used for the file processing
  • schemaLocking: whether the schema should be locked after the file is uploaded, must be one of true or false

How It Works

  1. Request Upload URL: Submit file metadata to this endpoint
  2. Receive Presigned URL: Get a secure upload URL valid for 1 hour
  3. Upload File: Use the presigned URL to upload your file directly to storage
  4. Processing: File is automatically processed with specified OCR model and schema
  5. Callback (optional): Receive notification when processing is complete

Request Parameters

Request Body

The request body must contain a JSON object with the following properties:
PropertyTypeRequiredDescription
fileNamestringYesOriginal name of the file including extension (e.g., “document.pdf”)
fileTypestringYesMIME type of the file (e.g., “application/pdf”, “image/jpeg”)
isSplitbooleanYesWhether the file should be processed as separate pages/sections
callbackURLstringNoHTTP endpoint to receive processing completion notifications
ocrModelstringNoOCR engine to use for text extraction. Available models vary by plan
schemaLockingbooleanYesWhether to lock the schema after processing. Must be true or false

Responses

{
  "s3Path": "s3://bucket/upload/file.txt",
  "presignedUploadURL": "https://s3.amazonaws.com/bucket/upload/file.txt?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=1%2F6%2BN7Z6h%2F7oV7Z6i%2F9oV7Z4%3D&Expires=3600",
  "uploadId": "f2538513-f0b9-4aa8-9c57-bc0a85c77de6",
  "callbackURL": "https://example.com/callback",
  "ocrModel": "Beethoven_ENG_G5.0",
  "schemaLocking": true
}

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json

Response

201
application/json

Get a presigned upload url for upload file, after getting the result use the presignedUploadURL with a PUT method to send the request with the binary file, the presignedUploadURL is valid for 3600 seconds (1 hour) and can be used multiple times

The response is of type object.