Skip to main content

POST v1/Upload-Session/End

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

Completes and finalises an existing Multipart Upload Session.

Summary

  • Please ensure you've read this upload sessions readme.md before continuing.
  • You must pass all collected /append responses to this endpoint to complete the multipart upload successfully.
  • Once finalised, the job specified (initiated through /start request), should executed immediately.
  • The response of this endpoint is therefore the job record which you can use to poll the status of the job.

Parameters

nametypelocationrequireddescription
content-typestringheaderrequiredYou must set the request content type to multipart/form-data
keystringbodyrequiredThe identifier for the upload session. This is obtained from the initial /start request.
partsarray<object>bodyrequiredAll /append responses for this session.

Responses

{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"total": { "type": "number" },
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"datasetId": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["datasets/extract","datasets/vectorize"]
},
"status": {
"type": "string",
"enum": ["NOT_STARTED","IN_PROGRESS","SUCCESS","ERROR"]
},
"statusText": {
"type": "string"
},
"startedAt": {
"type": "number"
},
"finishedAt": {
"type": "number"
},
"canceledAt": {
"type": "number"
},
"createdAt": {
"type": "number"
},
"updatedAt": {
"type": "number"
}
}
}
}
}

Example

curl -X POST https://api.subworkfow.ai/v1/upload-session/end \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'Content-Type: multipart/form-data' \
--form "key=tmp_xMX0GRh5Ifa3VrY7" \
--form "parts=[{\"etag\": "33a64df551425fcc55e4d42a148795d9f25f89d4",\"partNumber\":1, ... }]"
// note: you can poll https://api.subworkflow.ai/v1/jobs/<jobId> for updates
{
"success": true,
"total": 1,
"data": {
"id": "dsj_5fwR7qoMXracJQaf",
"datasetId": "ds_VV08ECeQBQgDoVn6",
"type": "datasets/extract",
"status": "IN_PROGRESS",
"statusText": null,
"startedAt": null,
"finishedAt": null,
"canceledAt": null,
"createdAt": 1761910647113,
"updatedAt": 1761910647113
}
}