from retab import Retab
client = Retab()
split = client.splits.get("split_01G34H8J2K")
for sub in split.output:
print(f"{sub.name}: pages {sub.pages}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const split = await client.splits.get("split_01G34H8J2K");
console.log(split.output);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
split, err := client.Splits.Get(ctx, "split_01G34H8J2K", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(split.Output)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
split = client.splits.get(split_id: 'split_01G34H8J2K')
split.output.each do |sub|
puts "#{sub.name}: pages #{sub.pages}"
end
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let split = client.splits().get("split_01G34H8J2K", retab::resources::splits::GetParams::default()).await?;
for sub in split.output.as_ref().unwrap() {
println!("{}: pages {:?}", sub.name, sub.pages);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->splits()->get(
splitId: 'split_01G34H8J2K',
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Splits.GetAsync("split_01G34H8J2K");
Console.WriteLine(result);
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var result = client.splits().get("split_abc123", null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/splits/split_01G34H8J2K' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"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"
}
{
"detail": "Split not found"
}
Get Split
Retrieve a split.
Fetches a single split by its split_id within the authenticated environment and
returns the full Split including its output page assignments. Responds with 404
if no split with that id exists.
from retab import Retab
client = Retab()
split = client.splits.get("split_01G34H8J2K")
for sub in split.output:
print(f"{sub.name}: pages {sub.pages}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const split = await client.splits.get("split_01G34H8J2K");
console.log(split.output);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
split, err := client.Splits.Get(ctx, "split_01G34H8J2K", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(split.Output)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
split = client.splits.get(split_id: 'split_01G34H8J2K')
split.output.each do |sub|
puts "#{sub.name}: pages #{sub.pages}"
end
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let split = client.splits().get("split_01G34H8J2K", retab::resources::splits::GetParams::default()).await?;
for sub in split.output.as_ref().unwrap() {
println!("{}: pages {:?}", sub.name, sub.pages);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->splits()->get(
splitId: 'split_01G34H8J2K',
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Splits.GetAsync("split_01G34H8J2K");
Console.WriteLine(result);
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var result = client.splits().get("split_abc123", null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/splits/split_01G34H8J2K' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"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"
}
{
"detail": "Split not found"
}
from retab import Retab
client = Retab()
split = client.splits.get("split_01G34H8J2K")
for sub in split.output:
print(f"{sub.name}: pages {sub.pages}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const split = await client.splits.get("split_01G34H8J2K");
console.log(split.output);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
split, err := client.Splits.Get(ctx, "split_01G34H8J2K", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(split.Output)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
split = client.splits.get(split_id: 'split_01G34H8J2K')
split.output.each do |sub|
puts "#{sub.name}: pages #{sub.pages}"
end
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let split = client.splits().get("split_01G34H8J2K", retab::resources::splits::GetParams::default()).await?;
for sub in split.output.as_ref().unwrap() {
println!("{}: pages {:?}", sub.name, sub.pages);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->splits()->get(
splitId: 'split_01G34H8J2K',
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Splits.GetAsync("split_01G34H8J2K");
Console.WriteLine(result);
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var result = client.splits().get("split_abc123", null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/splits/split_01G34H8J2K' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"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"
}
{
"detail": "Split not found"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
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.
Unique identifier of the split result
Information about the split file
Show child attributes
Show child attributes
Model used for the split operation
Subdocuments used for the split operation
Show child attributes
Show child attributes
Number of consensus votes used
Free-form instructions supplied with the split request.
The list of document splits with their assigned pages. Empty [] until status == 'completed'.
Show child attributes
Show child attributes
Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.
pending, queued, in_progress, completed, failed, cancelled Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.
Show child attributes
Show child attributes
Consensus metadata for multi-vote split runs
Show child attributes
Show child attributes
Usage information for the split operation
Show child attributes
Show child attributes