# POST /api/v1/dashboards/models/import

> Import a reference workbook as a model plan

- **Tag:** dashboards
- **Operation ID:** `import_model_workbook_api_v1_dashboards_models_import_post`

## Description

Parse an uploaded .xlsx into a draft model and return it for review. **Nothing is persisted** — the importer cannot know which ledgers feed the workbook's data rows, and guessing would produce a model that renders a clean grid of wrong numbers. The response carries a `confidence` score, the sheets skipped as raw data exports, and the formulas that could not be translated, so the caller can resolve them before calling `/models/build`.

## Authentication

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

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_ImportWorkbookResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (ImportWorkbookResponse)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 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/dashboards/models/import' \
  -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/dashboards/models/import', {
  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/dashboards/models/import", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/dashboards/import-model-workbook
- OpenAPI slice: https://www.ondayzero.com/docs/reference/dashboards/import-model-workbook/openapi.json
- Other endpoints in **dashboards**: https://www.ondayzero.com/docs/reference/dashboards
