Skip to main content

GET /v1/jobs/:id

Poll the status of an extraction job. Once status is completed, the full extracted data is included in the response.

Request

Headers
HeaderRequiredDescription
X-API-KeyYesYour Parzo API key
Path parameters
ParameterDescription
idThe job_id returned by POST /v1/extract/invoice

Example request

curl https://api.parzo.dev/v1/jobs/3419ae1e-93c3-48a1-95ac-833c390f9916 \
  -H "X-API-Key: inv_your_key_here"

Responses by status

    {
      "job_id": "3419ae1e-93c3-48a1-95ac-833c390f9916",
      "status": "pending",
      "queued_at": "2026-04-01T10:00:00.000Z",
      "started_at": null,
      "completed_at": null,
      "processing_ms": null
    }
    {
      "job_id": "3419ae1e-93c3-48a1-95ac-833c390f9916",
      "status": "completed",
      "queued_at": "2026-04-01T10:00:00.000Z",
      "started_at": "2026-04-01T10:00:01.000Z",
      "completed_at": "2026-04-01T10:00:02.000Z",
      "processing_ms": 942,
      "confidence": 0.95,
      "model": "claude-haiku-4-5",
      "cache_hit": false,
      "validation_flags": [],
      "result": { ... }
    }
    {
      "job_id": "3419ae1e-93c3-48a1-95ac-833c390f9916",
      "status": "failed",
      "error": "Unable to extract text from document",
      "attempt_count": 3
    }

Polling strategy

Poll every 3-5 seconds. Jobs typically complete in 5-30 seconds.
Python
import requests
import time

def wait_for_result(job_id, api_key, timeout=120):
    url = f"https://api.parzo.dev/v1/jobs/{job_id}"
    headers = {"X-API-Key": api_key}

    for _ in range(timeout // 5):
        response = requests.get(url, headers=headers).json()

        if response["status"] == "completed":
            return response["result"]
        if response["status"] == "failed":
            raise Exception(response["error"])

        time.sleep(5)

    raise TimeoutError("Job did not complete in time")

Validation flags

When Parzo detects potential issues in the extracted data, it adds flags to validation_flags:
CodeSeverityDescription
ARITHMETIC_MISMATCHerrorsubtotal + tax ≠ total
INVALID_TOTALerrorTotal is zero or negative
INVALID_IT_VAT_RATEwarningVAT rate not standard for Italy
INVALID_PIVA_CHECKSUMwarningItalian VAT number fails checksum
DATE_INCOHERENCEwarningIssue date is after due date
Validation flags do not block the extraction — you always receive the result. Use flags to decide whether to flag the document for manual review.