from datetime import datetime
from retab import Retab
client = Retab()
classifications = client.classifications.list(limit=20, order="desc")
for c in classifications.data:
print(f"{c.id}: {c.output.category}")
# Filter by date range
classifications = client.classifications.list(
from_date=datetime(2024, 1, 1),
to_date=datetime(2024, 12, 31),
limit=50,
)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const classifications = await client.classifications.list({
limit: 20,
order: "desc",
});
for (const c of classifications.data) {
console.log(`${c.id}: ${c.output.category}`);
}
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)
}
classifications, err := client.Classifications.List(ctx, &retab.ClassificationsListParams{
PaginationParams: retab.PaginationParams{Limit: ptr(20), Order: ptr("desc")},
})
if err != nil {
log.Fatal(err)
}
for _, c := range classifications.Data {
fmt.Printf("%s: %s\n", c.ID, c.Output.Category)
}
}
require 'retab'
require 'date'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
classifications = client.classifications.list(limit: 20, order: 'desc')
classifications.data.each do |c|
puts "#{c.id}: #{c.output.category}"
end
# Filter by date range
classifications = client.classifications.list(
from_date: DateTime.new(2024, 1, 1),
to_date: DateTime.new(2024, 12, 31),
limit: 50,
)
use retab::enums::ClassificationsOrder;
use retab::resources::classifications::ListParams;
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 classifications = client
.classifications()
.list(ListParams {
limit: Some(20),
order: Some(ClassificationsOrder::Desc),
..Default::default()
})
.await?;
for c in &classifications.data {
println!("{}: {}", c.id, c.output.as_ref().unwrap().category);
}
// Filter by date range
let _ranged = client
.classifications()
.list(ListParams {
from_date: Some("2024-01-01".into()),
to_date: Some("2024-12-31".into()),
limit: Some(50),
..Default::default()
})
.await?;
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->classifications()->list();
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.Classifications.ListAsync(new ClassificationsListOptions());
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.classifications().list(null, null, 10L, null, "invoice.pdf", null, null, null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/classifications?limit=20&order=desc' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"data": [
{
"id": "cls_01G34H8J2K",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "invoice.pdf",
"mime_type": "application/pdf"
},
"model": "retab-small",
"output": {
"category": "invoice",
"reasoning": "Contains line items and a total amount due."
},
"created_at": "2024-03-15T10:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": "cls_01G34H8J2K",
"total_count": 42
}
}
Classifications
List Classifications
List classifications.
Returns a paginated list of classifications, most recent first. Filter by
filename or a from_date/to_date range, and page with before/after.
GET
/
v1
/
classifications
from datetime import datetime
from retab import Retab
client = Retab()
classifications = client.classifications.list(limit=20, order="desc")
for c in classifications.data:
print(f"{c.id}: {c.output.category}")
# Filter by date range
classifications = client.classifications.list(
from_date=datetime(2024, 1, 1),
to_date=datetime(2024, 12, 31),
limit=50,
)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const classifications = await client.classifications.list({
limit: 20,
order: "desc",
});
for (const c of classifications.data) {
console.log(`${c.id}: ${c.output.category}`);
}
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)
}
classifications, err := client.Classifications.List(ctx, &retab.ClassificationsListParams{
PaginationParams: retab.PaginationParams{Limit: ptr(20), Order: ptr("desc")},
})
if err != nil {
log.Fatal(err)
}
for _, c := range classifications.Data {
fmt.Printf("%s: %s\n", c.ID, c.Output.Category)
}
}
require 'retab'
require 'date'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
classifications = client.classifications.list(limit: 20, order: 'desc')
classifications.data.each do |c|
puts "#{c.id}: #{c.output.category}"
end
# Filter by date range
classifications = client.classifications.list(
from_date: DateTime.new(2024, 1, 1),
to_date: DateTime.new(2024, 12, 31),
limit: 50,
)
use retab::enums::ClassificationsOrder;
use retab::resources::classifications::ListParams;
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 classifications = client
.classifications()
.list(ListParams {
limit: Some(20),
order: Some(ClassificationsOrder::Desc),
..Default::default()
})
.await?;
for c in &classifications.data {
println!("{}: {}", c.id, c.output.as_ref().unwrap().category);
}
// Filter by date range
let _ranged = client
.classifications()
.list(ListParams {
from_date: Some("2024-01-01".into()),
to_date: Some("2024-12-31".into()),
limit: Some(50),
..Default::default()
})
.await?;
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->classifications()->list();
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.Classifications.ListAsync(new ClassificationsListOptions());
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.classifications().list(null, null, 10L, null, "invoice.pdf", null, null, null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/classifications?limit=20&order=desc' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"data": [
{
"id": "cls_01G34H8J2K",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "invoice.pdf",
"mime_type": "application/pdf"
},
"model": "retab-small",
"output": {
"category": "invoice",
"reasoning": "Contains line items and a total amount due."
},
"created_at": "2024-03-15T10:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": "cls_01G34H8J2K",
"total_count": 42
}
}
List persisted classifications for your organization, with id-based pagination.
from datetime import datetime
from retab import Retab
client = Retab()
classifications = client.classifications.list(limit=20, order="desc")
for c in classifications.data:
print(f"{c.id}: {c.output.category}")
# Filter by date range
classifications = client.classifications.list(
from_date=datetime(2024, 1, 1),
to_date=datetime(2024, 12, 31),
limit=50,
)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const classifications = await client.classifications.list({
limit: 20,
order: "desc",
});
for (const c of classifications.data) {
console.log(`${c.id}: ${c.output.category}`);
}
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)
}
classifications, err := client.Classifications.List(ctx, &retab.ClassificationsListParams{
PaginationParams: retab.PaginationParams{Limit: ptr(20), Order: ptr("desc")},
})
if err != nil {
log.Fatal(err)
}
for _, c := range classifications.Data {
fmt.Printf("%s: %s\n", c.ID, c.Output.Category)
}
}
require 'retab'
require 'date'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
classifications = client.classifications.list(limit: 20, order: 'desc')
classifications.data.each do |c|
puts "#{c.id}: #{c.output.category}"
end
# Filter by date range
classifications = client.classifications.list(
from_date: DateTime.new(2024, 1, 1),
to_date: DateTime.new(2024, 12, 31),
limit: 50,
)
use retab::enums::ClassificationsOrder;
use retab::resources::classifications::ListParams;
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 classifications = client
.classifications()
.list(ListParams {
limit: Some(20),
order: Some(ClassificationsOrder::Desc),
..Default::default()
})
.await?;
for c in &classifications.data {
println!("{}: {}", c.id, c.output.as_ref().unwrap().category);
}
// Filter by date range
let _ranged = client
.classifications()
.list(ListParams {
from_date: Some("2024-01-01".into()),
to_date: Some("2024-12-31".into()),
limit: Some(50),
..Default::default()
})
.await?;
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->classifications()->list();
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.Classifications.ListAsync(new ClassificationsListOptions());
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.classifications().list(null, null, 10L, null, "invoice.pdf", null, null, null);
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/classifications?limit=20&order=desc' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"data": [
{
"id": "cls_01G34H8J2K",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "invoice.pdf",
"mime_type": "application/pdf"
},
"model": "retab-small",
"output": {
"category": "invoice",
"reasoning": "Contains line items and a total amount due."
},
"created_at": "2024-03-15T10:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": "cls_01G34H8J2K",
"total_count": 42
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Required range:
1 <= x <= 100Available options:
asc, desc Available options:
pending, queued, in_progress, completed, failed, cancelled Response
Successful Response
A page of Classification resources. data holds the items and list_metadata carries the before/after cursors; pass after to fetch the next page.
⌘I