Skip to main content

Overview

Every Aifano endpoint has an async variant (/parse_async, /extract_async, /split_async, /edit_async, /pipeline_async). Async endpoints return a job_id immediately, and you poll for results or receive them via webhook. Use async processing when:
  • Documents are large (50+ pages)
  • You’re processing batches of documents
  • You don’t need results immediately
  • You want to avoid request timeouts

Submitting an Async Job

Add _async to any endpoint:

Response

Polling for Results

Use GET /job/{job_id} to check the status:

Job Statuses

Completed Job Response

Cancelling a Job

Cancel a running or pending job:

Async Endpoints

Best Practices

Poll every 2–5 seconds. Avoid polling more frequently than once per second.
Set a maximum number of polling attempts (e.g., 150 attempts × 2s = 5 minutes) to avoid infinite loops.
Always check for FAILED status and inspect the error field. Implement retry logic for transient errors.
Submit all jobs first, then poll for results. This maximizes throughput and avoids sequential bottlenecks.