Skip to main content

POST v1/Upload-Session/Start

POST
https://api.subworkflow.ai/v1/upload-session/start

Starts a Multipart Upload Session for uploading files larger than 100mb

Summary

  • Please ensure you've read this upload sessions readme.md before continuing.
  • Initiates the upload session and returns a key. This key is required for all subsequent calls.
  • If you lose the key, you won't be able to complete the upload session. In which case, just start a new upload session.

Parameters

nametypelocationrequireddescription
content-typestringheaderrequiredYou must set the request content type to multipart/form-data
fileNamestringbodyrequiredThe name of the file to use after all parts are combined at our end
fileExtstringbodyrequiredThe file extension of the original file. Used to identify correct post-processing steps.
fileTypestringbodyrequiredThe file mimeType of the original file. Used to identify correct post-processing steps.
jobTypestringbodyrequiredThe job to execute after upload is successful. Can only be one of extract or vectorize.
expiryInDaysnumberbodyoptionalSets the data rentention limit in days for the file. Max depends on your subscription. Set to -1 to never expire.

Responses

{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"data": {
"type": "object",
"properties": {
"key": {
"type": "string"
}
}
}
}
}

Example

curl -X POST https://api.subworkfow.ai/v1/upload-session/start \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'Content-Type: multipart/form-data' \
--form "fileName=myReport" \
--form "fileExt=pdf" \
--form "fileType=application/pdf" \
--form "jobType=extract"
--form "expiryInDays=30"
{
"success": true,
"data": {
"key": "tmp_xMX0GRh5Ifa3VrY7"
}
}