# POST /api/v1/inventory/import/analyze

> Analyze spreadsheet (async)

- **Tag:** inventory:import
- **Operation ID:** `analyze_spreadsheet_api_v1_inventory_import_analyze_post`

## Description

Upload an Excel or CSV file. Returns a task_id immediately; the AI analysis runs in the background. Poll GET /analyze/{task_id} for the result.

## Authentication

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

## Responses

### 201 — Successful Response

Schema: `AnalyzeTaskResponse`

- `task_id` (string · required) — Poll GET /analyze/{task_id} for results.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error - Invalid data format

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/inventory/import/analyze' \
  -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/inventory/import/analyze', {
  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/inventory/import/analyze", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/inventory-import/analyze-spreadsheet
- OpenAPI slice: https://www.ondayzero.com/docs/reference/inventory-import/analyze-spreadsheet/openapi.json
- Other endpoints in **inventory:import**: https://www.ondayzero.com/docs/reference/inventory-import
