POST v1/Upload-Session/Append
POST
https://api.subworkflow.ai/v1/upload-session/append
Upload parts to an existing Multipart Upload Session.
Summary
- Please ensure you've read this upload sessions readme.md before continuing.
- After splitting up the original file into "parts" (aka "chunks"), use this endpoint repeatedly to upload the parts, ideally in sequential order.
- Parts should be a minimum of 5mb unless it's the last part which can be less than 5mb. Maximum part size is 100mb though this is not recommended.
- Higher part and concurrency settings are only recommended for users with strong internet/network bandwidth.
- Each
appendcall response will contain anetagandpartNumbervalue. You'll need to keep these and submit them together at the end to complete the upload session.
Parameters
| name | type | location | required | description |
|---|---|---|---|---|
| content-type | string | header | required | You must set the request content type to multipart/form-data |
| key | string | body | required | The identifier for the upload session. This is obtained from the initial /start request. |
| partNumber | string | body | required | The part number for the provided data chunk |
| file | Blob | body | required | The provided data chunk. Cannot be less than 5mb unless it's the last part. Each part be any size between 5mb - 100mb. A larger part size may work better for users with good internet connections. |
Responses
- Success
- 400 Error
- 404 Error
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"data": {
"type": "object",
"properties": {
"etag": {
"type": "string"
},
"partNumber": {
"type": "number"
}
}
}
}
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
Example
- Curl
- JS/TS
curl -X POST https://api.subworkfow.ai/v1/upload-session/append \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'Content-Type: multipart/form-data' \
--form "key=tmp_xMX0GRh5Ifa3VrY7" \
--form "partNumber=1" \
--form "@file=chunk"
const formdata = new FormData();
formdata.append("key", "tmp_xMX0GRh5Ifa3VrY7");
formdata.append("partNumber", "1");
formdata.append("file", chunk);
const req = await fetch("https://api.subworkflow.ai/v1/upload-session/append", {
method: "POST",
headers: {
"Content-Type": "multipart/form-data",
"x-api-key": "<YOUR-API-KEY>"
},
body: formdata,
});
{
"success": true,
"data": {
"etag": "33a64df551425fcc55e4d42a148795d9f25f89d4",
"partNumber": 1
}
}