Skip to main content
The reprocess method (same name as the API endpoint) re-runs the ingestion pipeline on an existing source using a different partition method. Processing is asynchronous: the method returns a build_id immediately; poll Get build status until the job completes.

Method overview

Sync

client.sources.reprocess()

Async

await client.sources.reprocess()

Method signature

Returns SourceReprocessResponse with .build_id.

Parameters

Partition method values (v2)

Method comparison

Return value

The method returns a build_id (string). Use it with Get build status to poll until processing completes (Completed or failure). The file_id does not change.

Code examples

Basic usage

Reprocess and poll until complete

With partition method

Reprocessing runs in the background and can take several minutes. Use Get build status to poll until completion.

Error handling

Batch reprocess

Reprocess multiple sources by file_id; each call returns a build_id. Poll Get build status for each until complete.

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).
  • 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.

Error Reference

Troubleshooting

Causes: Large files, complex documents, or heavy server loadSolutions:
  • Increase request timeout (5+ minutes recommended)
  • Try a simpler processing method first
  • Process during off-peak hours
Causes: Invalid file_id, source deleted, or wrong projectSolutions:
  • Use client.sources.list() to get valid file_ids
  • Ensure you’re using the correct API key for the project
Causes: Corrupted file, unsupported content, or method incompatibilitySolutions:
  • Try a different method (e.g. balanced, agentic)
  • Check file integrity; re-ingest if necessary using client.sources.ingest_file()
Solutions:
  • Use balanced or accurate for complex layouts
  • Use agentic for complex layouts with tables and diagrams

Next steps

After reprocessing, poll Get build status until complete, then:

Get build status

Poll status and get parsed elements for a build

List sources

View all sources and their status

Upload

Ingest new files, URLs, GitHub repos, or YouTube videos

Get elements

Retrieve parsed elements from a source

Delete source

Remove a source by file_id