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"
}

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.

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>
size_bytes
integer | null

Size of the stored file in bytes

sha256
string | null

Optional caller-supplied SHA-256 checksum

upload_status
enum<string>
default:ready

Direct upload lifecycle status

Available options:
pending,
ready,
failed,
expired
upload_expires_at
string<date-time> | null

When a pending direct upload expires

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

gcs_path_override
string | null

Explicit GCS blob path when the file is not stored at the canonical {organization_id}/file/{id}.{extension} location (e.g. block artifact uploads).