> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parzo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Job

> Retrieve the status and result of an extraction job.

## 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**

| Header      | Required | Description        |
| ----------- | -------- | ------------------ |
| `X-API-Key` | Yes      | Your Parzo API key |

**Path parameters**

| Parameter | Description                                         |
| --------- | --------------------------------------------------- |
| `id`      | The `job_id` returned by `POST /v1/extract/invoice` |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.parzo.dev/v1/jobs/3419ae1e-93c3-48a1-95ac-833c390f9916 \
    -H "X-API-Key: inv_your_key_here"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.parzo.dev/v1/jobs/3419ae1e-93c3-48a1-95ac-833c390f9916",
      headers={"X-API-Key": "inv_your_key_here"}
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.parzo.dev/v1/jobs/3419ae1e-93c3-48a1-95ac-833c390f9916",
    { headers: { "X-API-Key": "inv_your_key_here" } }
  );

  console.log(await response.json());
  ```
</CodeGroup>

### Responses by status

<AccordionGroup>
  <Accordion title="pending / processing">
    ```json theme={null}
        {
          "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
        }
    ```
  </Accordion>

  <Accordion title="completed">
    ```json theme={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": { ... }
        }
    ```
  </Accordion>

  <Accordion title="failed">
    ```json theme={null}
        {
          "job_id": "3419ae1e-93c3-48a1-95ac-833c390f9916",
          "status": "failed",
          "error": "Unable to extract text from document",
          "attempt_count": 3
        }
    ```
  </Accordion>
</AccordionGroup>

### Polling strategy

Poll every 3-5 seconds. Jobs typically complete in 5-30 seconds.

```python Python theme={null}
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`:

| Code                    | Severity | Description                       |
| ----------------------- | -------- | --------------------------------- |
| `ARITHMETIC_MISMATCH`   | error    | subtotal + tax ≠ total            |
| `INVALID_TOTAL`         | error    | Total is zero or negative         |
| `INVALID_IT_VAT_RATE`   | warning  | VAT rate not standard for Italy   |
| `INVALID_PIVA_CHECKSUM` | warning  | Italian VAT number fails checksum |
| `DATE_INCOHERENCE`      | warning  | Issue date is after due date      |

<Note>
  Validation flags do not block the extraction — you always receive the result. Use flags to decide whether to flag the document for manual review.
</Note>
