Skip to main content
GET
/
v1
/
files
from retab import Retab

client = Retab()

# List recent files
files = client.files.list(limit=20)
for f in files:
    print(f"{f.id}: {f.filename}")

# Filter by filename prefix and MIME type
files = client.files.list(
    filename="invoice",
    mime_type="application/pdf",
    limit=50
)
{
  "data": [
    {
      "id": "file_a1b2c3d4e5f6",
      "object": "file",
      "filename": "invoice.pdf",
      "page_count": 3,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "file_g7h8i9j0k1l2",
      "object": "file",
      "filename": "receipt.png",
      "page_count": 1,
      "created_at": "2024-01-14T08:15:00Z",
      "updated_at": "2024-01-14T08:15:00Z"
    }
  ],
  "list_metadata": {
    "before": null,
    "after": "file_g7h8i9j0k1l2"
  }
}
List uploaded files with pagination and optional filtering by filename or MIME type.
from retab import Retab

client = Retab()

# List recent files
files = client.files.list(limit=20)
for f in files:
    print(f"{f.id}: {f.filename}")

# Filter by filename prefix and MIME type
files = client.files.list(
    filename="invoice",
    mime_type="application/pdf",
    limit=50
)
{
  "data": [
    {
      "id": "file_a1b2c3d4e5f6",
      "object": "file",
      "filename": "invoice.pdf",
      "page_count": 3,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "file_g7h8i9j0k1l2",
      "object": "file",
      "filename": "receipt.png",
      "page_count": 1,
      "created_at": "2024-01-14T08:15:00Z",
      "updated_at": "2024-01-14T08:15:00Z"
    }
  ],
  "list_metadata": {
    "before": null,
    "after": "file_g7h8i9j0k1l2"
  }
}

Authorizations

Api-Key
string
header
required

Query Parameters

before
string | null
after
string | null
limit
integer
default:10

Items per page

Required range: 1 <= x <= 100
order
enum<string>
default:desc
Available options:
asc,
desc
filename
string | null
mime_type
string | null
from_date
string | null
to_date
string | null
include_embeddings
boolean
default:false

Include embeddings in the response

sort_by
string
default:created_at

Response

Successful Response

A page of File resources. data holds the items and list_metadata carries the before/after cursors; pass after to fetch the next page.

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

Boundary resource IDs for page navigation.