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
)
[
  {
    "id": "file_a1b2c3d4e5f6",
    "object": "file",
    "filename": "invoice.pdf",
    "organization_id": "org_abc123",
    "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",
    "organization_id": "org_abc123",
    "page_count": 1,
    "created_at": "2024-01-14T08:15:00Z",
    "updated_at": "2024-01-14T08:15:00Z"
  }
]
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
)
[
  {
    "id": "file_a1b2c3d4e5f6",
    "object": "file",
    "filename": "invoice.pdf",
    "organization_id": "org_abc123",
    "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",
    "organization_id": "org_abc123",
    "page_count": 1,
    "created_at": "2024-01-14T08:15:00Z",
    "updated_at": "2024-01-14T08:15:00Z"
  }
]

Query Parameters

before
string
Cursor for backward pagination.
after
string
Cursor for forward pagination.
limit
integer
default:"10"
Maximum number of files to return. Range: 1-100.
order
string
default:"desc"
Sort order. Valid values: asc, desc.
filename
string
Filter by filename prefix (case-insensitive).
mime_type
string
Filter by MIME type (e.g., application/pdf, image/png).
sort_by
string
default:"created_at"
Field to sort results by.

Response Fields

Each item in the response array is a File object:
id
string
Unique file identifier, prefixed with file_.
object
string
Always "file".
filename
string
The original filename.
organization_id
string
The organization that owns this file.
page_count
integer | null
Number of pages (if applicable).
created_at
string
ISO 8601 creation timestamp.
updated_at
string
ISO 8601 last update timestamp.

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
include_embeddings
boolean
default:false

Include embeddings in the response

sort_by
string
default:created_at
access_token
string | null

Response

Successful Response

data
any[]
required
list_metadata
ListMetadata · object
required