Skip to main content
POST
/
v1
/
files
/
upload
/
{file_id}
/
complete
from retab import Retab
from pathlib import Path

client = Retab()

# Recommended — SDK runs the full upload + complete flow.
mime = client.files.upload(Path("invoice.pdf"))
print(mime.url)  # https://storage.retab.com/...

# Lower-level — only when you've handled the PUT yourself.
# The SDK exposes the request builder so you can dispatch it via the
# transport without rebuilding the URL/body by hand:
request = client.files.prepare_complete_upload(
    file_id="file_a1b2c3d4e5f6",
    sha256=None,  # required only if the upload session was created with sha256
)
response = client._prepared_request(request)
{
  "filename": "invoice.pdf",
  "url": "https://storage.retab.com/file_a1b2c3d4e5f6"
}

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.

Complete a direct-to-storage upload after the file bytes have been written to the signed uploadUrl. Retab verifies that the object exists, matches the expected size from the upload session, and belongs to the authenticated organization. The response is a MIMEData object that can be passed directly to later document requests.
Most callers use the SDK’s high-level client.files.upload(...) instead of calling this endpoint directly. files.upload runs the entire three-step direct-upload flow (request signed URL → PUT bytes to storage → complete session) end-to-end and returns the same MIMEData you’d get back here.Reach for this endpoint when you want to drive the PUT yourself (e.g. browser-side upload that bypasses your backend) and need to call complete from your server once the bytes have landed.
from retab import Retab
from pathlib import Path

client = Retab()

# Recommended — SDK runs the full upload + complete flow.
mime = client.files.upload(Path("invoice.pdf"))
print(mime.url)  # https://storage.retab.com/...

# Lower-level — only when you've handled the PUT yourself.
# The SDK exposes the request builder so you can dispatch it via the
# transport without rebuilding the URL/body by hand:
request = client.files.prepare_complete_upload(
    file_id="file_a1b2c3d4e5f6",
    sha256=None,  # required only if the upload session was created with sha256
)
response = client._prepared_request(request)
{
  "filename": "invoice.pdf",
  "url": "https://storage.retab.com/file_a1b2c3d4e5f6"
}

Path Parameters

file_id
string
required
File ID returned by POST /v1/files/upload.

Request Parameters

sha256
string
Optional SHA-256 checksum. Required only if the upload session was created with sha256.

Response Fields

filename
string
The filename of the uploaded document.
url
string
Durable opaque Retab storage URL for the uploaded file. It is only usable through Retab APIs.

Authorizations

Api-Key
string
header
required

Path Parameters

file_id
string
required

Body

application/json
sha256
string | null

Optional SHA-256 checksum

Pattern: ^[a-fA-F0-9]{64}$

Response

Successful Response

filename
string
required

The filename of the file

Examples:

"file.pdf"

"image.png"

"data.txt"

url
string
required

The URL of the file in base64 format

Example:

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."