# POST /api/v1/reconciliations/upload

> Create reconciliation with upload

- **Tag:** reconciliations
- **Operation ID:** `create_reconciliation_with_upload_api_v1_reconciliations_upload_post`

## Description

Create a new bank reconciliation with direct file upload.

Supports PDF, CSV, and Excel bank statements.
The file is uploaded to S3 and processed automatically.

The workflow will:
1. Upload file to S3
2. Parse the bank statement using AI (handles any format)
3. Fetch ledger transactions for the period
4. Run AI matching to suggest matches
5. Store results for review

**Error 413:** File too large (max 50 MB).

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `ledger_id` (query, string, required) — ID of ledger to reconcile against
- `start_date` (query, string · date-time, required) — Statement period start date
- `end_date` (query, string · date-time, required) — Statement period end date
- `opening_balance` (query, integer, optional) — Opening balance in cents
- `closing_balance` (query, integer, optional) — Closing balance in cents
- `auto_start` (query, boolean, optional) — Auto-start processing workflow

## Responses

### 201 — Successful Response

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/reconciliations/upload' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d ''
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/reconciliations/upload', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {}

response = httpx.post("https://api.ondayzero.com/api/v1/reconciliations/upload", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/reconciliations/create-reconciliation-with-upload
- OpenAPI slice: https://www.ondayzero.com/docs/reference/reconciliations/create-reconciliation-with-upload/openapi.json
- Other endpoints in **reconciliations**: https://www.ondayzero.com/docs/reference/reconciliations
