Skip to main content
GET
/
v1
/
splits
/
{split_id}
from retab import Retab

client = Retab()
split = client.splits.get("split_01G34H8J2K")
for sub in split.output:
    print(f"{sub.name}: pages {sub.pages}")
{
  "id": "split_01G34H8J2K",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice_batch.pdf",
    "mime_type": "application/pdf"
  },
  "model": "retab-small",
  "subdocuments": [
    {
      "name": "invoice",
      "description": "Invoice documents",
      "allow_multiple_instances": true
    },
    {
      "name": "receipt",
      "description": "Receipt documents",
      "allow_multiple_instances": false
    }
  ],
  "n_consensus": 1,
  "instructions": null,
  "output": [
    { "name": "invoice", "pages": [1, 2, 3] },
    { "name": "receipt", "pages": [4, 5] }
  ],
  "consensus": null,
  "usage": {
    "credits": 1.0
  },
  "created_at": "2024-03-15T10:30:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.retab.com/llms.txt

Use this file to discover all available pages before exploring further.

from retab import Retab

client = Retab()
split = client.splits.get("split_01G34H8J2K")
for sub in split.output:
    print(f"{sub.name}: pages {sub.pages}")
{
  "id": "split_01G34H8J2K",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice_batch.pdf",
    "mime_type": "application/pdf"
  },
  "model": "retab-small",
  "subdocuments": [
    {
      "name": "invoice",
      "description": "Invoice documents",
      "allow_multiple_instances": true
    },
    {
      "name": "receipt",
      "description": "Receipt documents",
      "allow_multiple_instances": false
    }
  ],
  "n_consensus": 1,
  "instructions": null,
  "output": [
    { "name": "invoice", "pages": [1, 2, 3] },
    { "name": "receipt", "pages": [4, 5] }
  ],
  "consensus": null,
  "usage": {
    "credits": 1.0
  },
  "created_at": "2024-03-15T10:30:00Z"
}

Authorizations

Api-Key
string
header
required

Path Parameters

split_id
string
required

Query Parameters

include_output
boolean
default:true

When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.

Response

Successful Response

A split result: a document divided into its constituent subdocuments.

id
string
required

Unique identifier of the split result

file
FileRef · object
required

Information about the split file

model
string
required

Model used for the split operation

subdocuments
Subdocument · object[]
required

Subdocuments used for the split operation

n_consensus
integer
default:1

Number of consensus votes used

instructions
string | null

Free-form instructions supplied with the split request.

output
SplitResult · object[]

The list of document splits with their assigned pages. Empty [] until status == 'completed'.

status
enum<string>
default:pending

Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.

Available options:
pending,
queued,
in_progress,
completed,
failed,
cancelled
error
PrimitiveError · object

Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.

consensus
SplitConsensus · object

Consensus metadata for multi-vote split runs

usage
RetabUsage · object

Usage information for the split operation

created_at
string<date-time> | null