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

# Jobs

> Understanding extraction jobs and their lifecycle

A **Job** represents an extraction task. When you upload a document, a job is created to process it asynchronously.

## Job Lifecycle

```mermaid theme={null}
stateDiagram-v2
    [*] --> pending: Document uploaded
    pending --> processing: Worker picks up job
    processing --> completed: Extraction successful
    processing --> failed: Error occurred
    completed --> [*]
    failed --> [*]
```

## Job States

| State        | Description                           | Typical Duration |
| ------------ | ------------------------------------- | ---------------- |
| `pending`    | Queued, waiting for a worker          | \~seconds        |
| `processing` | AI extraction in progress             | 5-90 seconds     |
| `completed`  | Extraction successful, ready to query | —                |
| `failed`     | Error occurred during extraction      | —                |

## Tracking Jobs

### Polling

```bash theme={null}
curl -X GET https://api.docintell.com/v1/jobs/{job_id} \
  -H "Authorization: Bearer dk_live_YOUR_API_KEY"
```

**Response:**

```json theme={null}
{
  "job_id": "019370ab-c456-7def-8901-234567890def",
  "status": "completed",
  "processing_time_seconds": 45.2
}
```

### Webhooks (Recommended)

For production, use webhooks instead of polling:

```bash theme={null}
curl -X POST https://api.docintell.com/v1/documents \
  -H "Authorization: Bearer dk_live_YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "webhook_url=https://yourapp.com/webhooks"
```

DocIntell will POST to your URL when complete.

## Processing Time

| Document Type            | Typical Time  |
| ------------------------ | ------------- |
| Simple invoice           | 5-10 seconds  |
| Financial statement      | 20-40 seconds |
| Large report (50+ pages) | 45-90 seconds |

<Info>
  SLA target: **\< 60 seconds** for a 50-page PDF.
</Info>
