Skip to main content
The Reprocess endpoint lets you re-run the ingestion pipeline on an existing source using a different partition method. Processing runs asynchronously: the API returns a build_id immediately; you then poll Get build status until the job completes.

Endpoint overview

HTTP Method

POST

Authentication

This endpoint requires authentication using an API token. Include your API token as a Bearer token in the Authorization header.
Learn how to create and manage API tokens in the API Tokens guide.

Async flow

  1. POST /reprocess with file_id and optional partition_method. The response returns immediately with a build_id.
  2. Poll Get build status: GET https://sources.graphorlm.com/builds/{build_id} until status is Completed or indicates failure.
  3. Use the file_id from the build status response (unchanged) for subsequent API calls.

Request format

Headers

Request body

Send a JSON body with the following fields:

Partition method values (v2)

Use these values for the partition_method field:

Available processing methods

Best for: Mixed-content PDFs (covers + body + tables + scans in one document)
  • Per-page routing: classifies each page and picks the cheapest parser that fits
  • Body pages run on Fast, table pages on Accurate, scanned/image pages on Agentic — automatically
  • You pay per page on the effective method, not a flat per-document price
  • Note: PDF-only today. Non-PDF sources fall back to Fast.
Best for: Simple text documents, quick processing
  • Fast processing with heuristic classification
  • No OCR processing
  • Suitable for plain text files and well-structured documents
  • Recommended for testing and development
Best for: Complex documents with varied layouts
  • OCR-based text extraction
  • AI-powered document structure classification
  • Better recognition of tables, figures, and document elements
  • Enhanced accuracy for complex layouts
Best for: Premium accuracy, specialized documents
  • OCR-based text extraction
  • Fine-tuned AI model for document classification
  • Highest accuracy for document structure recognition
  • Note: Premium feature
Best for: Complex layouts, multi-page tables, diagrams, and images
  • Highest parsing setting for complex layouts
  • Rich annotations for images and complex elements
  • Agentic processing for enhanced understanding

Method comparison

Request example

With default method (optional field omitted):
Re-processing runs in the background and can take several minutes depending on document size and the selected method. Use the returned build_id to poll Get build status until completion.

Response format

Success response (200 OK)

The endpoint returns immediately with a build identifier. It does not wait for processing to finish.

Response fields

To get the final source metadata (file_id, file_name, status, etc.) and optional parsed elements, call GET /builds/{build_id} (see Upload sources – Get build status).

Code examples

JavaScript/Node.js

Python

cURL

Reprocess and poll until complete

Error responses

Common error codes

Error response format

Error examples

Cause: The given file_id does not exist in your project.
Solution: Verify the file_id (e.g. from List sources or a previous upload/build status).
Cause: Internal error during re-processing.
Solution: Retry later or try a different partition_method; check file integrity.

When to reprocess

Symptoms: Missing text, garbled characters, incomplete content
Recommended: balanced or accurate for complex layouts.
Symptoms: Tables not recognized, merged cells, structure lost
Recommended: balanced, accurate, or agentic for multi-page tables.
Symptoms: Missing captions, poor figure recognition
Recommended: balanced, accurate, or agentic for rich image annotations.
Symptoms: Headers/footers mixed with content, poor section detection
Recommended: balanced, accurate, or agentic for better structure and semantics.

Best practices

  • Use file_id: Always use the source’s file_id (from list sources or build status); do not rely on file name.
  • Poll build status: After calling reprocess, poll Get build status with a reasonable interval (e.g. 2–5 seconds) and timeout.
  • Choose method by need: Start with fast for testing; use balanced or accurate for better quality; use agentic for complex layouts and tables; use auto on mixed PDFs (covers + body + tables + scans in one document) to let the classifier route each page to the cheapest parser that fits.
  • Timeout: Allow sufficient time for large documents and heavier methods when polling.

Next steps

After re-processing completes (build status Completed):

Get build status

Poll status and optionally retrieve parsed elements for a build

List sources

View all sources and their status in your project

Upload sources

Upload new files, URLs, GitHub repos, or YouTube videos (async)

Delete source

Remove a source from your project