Limai Docs
API ReferenceSplitting

Get Upload URL

Get a presigned URL to upload a file for splitting

GET/api/v1/split/{splitterId}/get-url

Returns a presigned S3 URL to upload a file for splitting. The file record is created with UPLOADING status. Use the returned URL to upload the file via a PUT request, then call the split or split-async endpoint with the returned fileId. A splitter whose output deployment is paused refuses the upload with 409, as described in Split.

Parameters

NameTypeInRequiredDescription
splitterIdstringpathYesThe splitter ID
filenamestringqueryYesName of the file being uploaded
contentHashstringqueryNoHash of the file's contents. When it matches a file already uploaded to this splitter, the existing file is returned instead of a new upload URL.

Request

const res = await fetch(
"https://app.limai.io/api/v1/split/spl_abc123/get-url?filename=document.pdf",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const { url, fileId } = await res.json();

await fetch(url, {
method: "PUT",
body: fileBuffer,
});

Response

Response200
{
  "url": "https://s3.amazonaws.com/...presigned-url...",
  "fileId": "cuid_file_123"
}

When contentHash matches a file already uploaded to this splitter, the response points at that file instead and carries an empty url — there is nothing to upload, so skip the PUT and split fileId directly.

Response200
{
  "url": "",
  "fileId": "cuid_file_123",
  "isDuplicate": true,
  "existingFileId": "cuid_file_123"
}

On this page