# Start validating every row of an import

> `POST /imports/{importId}/validate` · Scope: `import` · operationId `validateImport`

Editor and above, or an API key with the `import` scope (ADR-026). A job reads every row with the
mapping, validates it with the editor's validators and finds duplicate serial numbers in the file
and in the database (after removing surrounding spaces and invisible characters). Requires a
serial number column and a model column or `options.battery_model_id`. Follow the import with
`getImport` until its status is `validated` or `failed`.

## Path parameters

- **importId** `string (uuid)` (required)

## Responses

### 202 (`application/json`)

The validation job.

- **created_at** `string (date-time)` (required)
- **created_by** `UserRef`
  - **display_name** `string` (required)
  - **id** `string (uuid)` (required)
- **created_by_api_key** `ApiKeyRef`: An organisation API key (ADR-017) that reported an event (source `api`) or staged an import (ADR-026).
  - **id** `string (uuid)` (required)
  - **name** `string` (required)
- **error_code** `string` (one of: `forbidden`, `not_found`, `conflict`, `invalid`, `internal_error`): Why a job failed (`forbidden`: the member who started it lost the role or left).
- **file** `JobFile`
  - **content_type** `string` (required)
  - **expires_at** `string (date-time)` (required)
  - **filename** `string` (required)
  - **size** `integer (int64)` (required)
- **finished_at** `string (date-time)`
- **id** `string (uuid)` (required)
- **import_id** `string (uuid)`
- **kind** `string` (required, one of: `import_validate`, `import_commit`, `import_approve`, `bulk_publish`, `qr_export`, `registry_reevaluate`, `org_export`)
- **progress** `JobProgress` (required)
  - **done** `integer` (required)
  - **total** `integer` (required)
- **result** `JobResult`: The summary of a finished job; which members are set depends on the kind.
  - **approval** `ImportApprovalSummary`
  - **detail** `string`: Why a failed job failed (English).
  - **export** `ExportSummary`: What a full organisation export contains.
  - **import_summary** `ImportSummary`
  - **outcomes** `JobOutcomeCounts`
  - **reevaluation** `ReevaluationSummary`
  - **units** `integer`
- **started_at** `string (date-time)`
- **status** `string` (required, one of: `queued`, `running`, `succeeded`, `failed`)

### 400 (`application/problem+json`)

The request is malformed or failed validation (`validation_error`), or a token is invalid or expired (`invalid_token`).

### 401 (`application/problem+json`)

The API key is missing, unknown or revoked (`unauthenticated`).

### 403 (`application/problem+json`)

The API key may not perform this action (`forbidden`): it lacks the operation's scope, or the action needs more than a viewer's rights.

### 404 (`application/problem+json`)

The resource does not exist in the organisation of the API key, or the public passport is unknown (`not_found`).

### 409 (`application/problem+json`)

The request conflicts with the current state (`conflict`), e.g. a stale `If-Match` version.

### default (`application/problem+json`)

Any other problem, e.g. `internal_error`.

## Example

```bash title="cURL"
curl -X POST "https://passport.kabin.sh/api/v1/imports/{importId}/validate" \
  -H "Authorization: Bearer $BATTERYPASS_API_KEY"
```
