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

client = Retab()

file = client.files.get("file_a1b2c3d4e5f6")

print(f"Filename: {file.filename}")
print(f"Pages: {file.page_count}")
print(f"Created: {file.created_at}")
{
  "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"
}
Retrieve metadata for a single file by ID.
from retab import Retab

client = Retab()

file = client.files.get("file_a1b2c3d4e5f6")

print(f"Filename: {file.filename}")
print(f"Pages: {file.page_count}")
print(f"Created: {file.created_at}")
{
  "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"
}

Path Parameters

file_id
string
required
The ID of the file to retrieve.

Response Fields

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

Path Parameters

file_id
string
required

Query Parameters

access_token
string | null

Response

Successful Response

id
string
required

ID of the file

filename
string
required

Filename of the file

mime_type
string
required

MIME type of the file

organization_id
string
required

The ID of the organization that owns the file

created_at
string<date-time>
updated_at
string<date-time>
page_count
integer | null

The number of pages in the file

ocr_result
OCR · object

The OCR result of the file, if available

ocr_file_gcs
string | null

GCS path to the OCR file if available

ocr_file_page_count
integer | null

Number of pages in the OCR file if available

ocr_is_chromadb_collection_initialized
boolean
default:false

Whether the ChromaDB collection has been initialized for this file