API ReferenceSplitting
Split
Split a document synchronously and return the results
POST
/api/v1/split/{splitterId}SYNCSplits a previously uploaded file synchronously. The request blocks until splitting completes and returns the segment results. For large files, consider using the async endpoint instead.
If the file has already been split, the existing results are returned.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
splitterId | string | path | Yes | The splitter ID |
fileId | string | body | Yes | ID of the uploaded file (from get-url) |
Request
const res = await fetch(
"https://app.limai.io/api/v1/split/spl_abc123",
{
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({ fileId: "cuid_file_123" }),
}
);
const result = await res.json();Response
Response200
{
"splitId": "split_abc123",
"status": "COMPLETED",
"sourceFileName": "document.pdf",
"segmentCount": 3,
"segments": [
{
"segmentIndex": 0,
"pageStart": 1,
"pageEnd": 2,
"detectedType": "invoice",
"confidence": 0.95,
"outputFileId": "file_001",
"outputType": "FILE",
"discarded": false
},
{
"segmentIndex": 1,
"pageStart": 3,
"pageEnd": 5,
"detectedType": "receipt",
"confidence": 0.88,
"outputFileId": "file_002",
"outputType": "FILE",
"discarded": false
}
]
}