API ReferenceSplitting
Get Upload URL
Get a presigned URL to upload a file for splitting
GET
/api/v1/split/{splitterId}/get-urlReturns 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
| Name | Type | In | Required | Description |
|---|---|---|---|---|
splitterId | string | path | Yes | The splitter ID |
filename | string | query | Yes | Name of the file being uploaded |
contentHash | string | query | No | Hash 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"
}