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

# Async Method

> Uploads files for asynchronous OCR processing. Returns task IDs that can be used to check processing status.

### Request Formats

**Option 1: Multipart Form Data**

```http
POST /api/upload_ocr
Content-Type: multipart/form-data
X-API-Key: <api_key>

files: [file1.pdf, file2.jpg, ...]
template: "invoice"
batchProcess: "true"
splitPdf: "false"

```

### Parameters

| Name         | Type    | Required | Description                                         |
| ------------ | ------- | -------- | --------------------------------------------------- |
| files        | File\[] | Yes\*    | Array of files to process (multipart only)          |
| template     | String  | Yes      | Template ID or name for processing (e.g. "Invoice") |
| batchProcess | Boolean | No       | Enable batch processing (default: false)            |
| splitPdf     | Boolean | No       | Split PDF pages individually (default: false)       |

<RequestExample>
  ```bash cURL
  curl -X POST "https://api.clevrscan.com/api/upload_ocr" \
    -H "X-API-Key: <api_key>" \
    -F "files=@/path/to/file1.pdf" \
    -F "files=@/path/to/file2.jpg" \
    -F "template=Invoice" \
    -F "batchProcess=true" \
    -F "splitPdf=false"
  ```
</RequestExample>

<ResponseExample>
  ```json Sample Response
  {
    "individual_files": 0,
    "message": "Batch processing started with PDF grouping",
    "pdf_groups": 1,
    "task_ids": [
      "b3aef434-a75c-4015-aa81-550dfd9d8689"
    ]
  }
  ```
</ResponseExample>
