Skip to main content
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,
)
{
  "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
  }
}

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.

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,
)
{
  "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

Api-Key
string
header
required

Query Parameters

before
string | null
after
string | null
limit
integer
default:10
Required range: 1 <= x <= 100
order
enum<string>
default:desc
Available options:
asc,
desc
filename
string | null
status
enum<string> | null
Available options:
pending,
queued,
in_progress,
completed,
failed,
cancelled
from_date
string | null
to_date
string | null

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.

data
Classification · object[]
required
list_metadata
ListMetadata · object
required

Boundary resource IDs for page navigation.