Skip to main content
The /extract_async endpoint is deprecated and will be removed in a future version. Please migrate to /extract with async: true as described below.

Overview

The /extract_async endpoint has been replaced by a single, unified /extract endpoint that supports both synchronous and asynchronous processing via an async flag. This simplifies the API surface — you no longer need to choose between two different endpoints.
Before (Deprecated)After (Recommended)
EndpointPOST /extract_asyncPOST /extract
Async behaviorAlways asyncSet async: true
Sync behaviorNot availableDefault (async: false)
Response (async){ job_id, status }{ job_id, status, message }

Migration Steps

1
Step 1: Change the endpoint URL
2
Replace /extract_async with /extract in your API calls.
3
Step 2: Add the async flag
4
Add "async": true to your request body (JSON) or form data (multipart).
5
Step 3: Update response handling (if needed)
6
The async response now includes an additional message field. Your existing job_id and status handling will continue to work unchanged.
7
Step 4: Remove any /extract_async-specific client code
8
If you were using separate SDK methods for async extraction, switch to the unified method with the async parameter.

Code Examples

Python SDK

from pulse import Pulse

client = Pulse(api_key="YOUR_API_KEY")

# Old way — separate async method
response = client.extract_async(
    file_url="https://example.com/document.pdf",
    extract_figure=True
)

job_id = response.job_id

TypeScript SDK

import { PulseClient } from "pulse-ts-sdk";

const client = new PulseClient({
    apiKey: "YOUR_API_KEY"
});

// Old way — separate async method
const response = await client.extractAsync({
    fileUrl: "https://example.com/document.pdf",
    extractFigure: true
});

const jobId = response.job_id;

curl

curl -X POST https://api.runpulse.com/extract_async \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "extract_figure=true"

Polling for Results

Polling works exactly the same way — use GET /job/{job_id} to check status and retrieve results. No changes are needed to your polling logic.
import time

# Submit async extraction
response = client.extract(
    file_url="https://example.com/document.pdf",
    async_=True
)

# Poll for completion (unchanged)
job_id = response.job_id
delay = 1
while True:
    status = client.jobs.get_job(job_id=job_id)
    
    if status.status == "completed":
        print(f"Markdown: {status.result.markdown[:200]}...")
        print(f"Extraction ID: {status.result.extraction_id}")
        break
    elif status.status in ["failed", "canceled"]:
        print(f"Job failed: {status.status}")
        break
    
    time.sleep(delay)
    delay = min(delay * 1.5, 10)

FAQ

No. The endpoint will continue to work for backward compatibility but will be removed in a future version. We recommend migrating as soon as possible.
The unified /extract with async: true behaves identically to /extract_async. The only addition is a message field in the async response. Your existing polling and webhook integrations will continue to work unchanged.
No. Webhook notifications work the same way regardless of which endpoint initiated the job. The job.completed event payload is unchanged.
Yes! With the unified /extract endpoint, you get both modes in one place. Omit the async flag (or set async: false) for synchronous extraction, or set async: true for asynchronous processing.

Extract Endpoint

Full reference for the unified /extract endpoint

Async Processing

Guide to async processing and job polling