# The units as a spreadsheet with the import's columns

> `GET /batteries/export` · Scope: `read` · operationId `exportUnits`

Any member. The units matching the filters (at most 10 000) with the columns of an import:
model, version, the unit's fields and every unit-level field with a value, so the file can be
edited and imported again (`docs/architecture.md` §7). XLSX by default.

## Query-Parameter

- **battery_model_id** `string (uuid)`
- **model_version_id** `string (uuid)`
- **passport_status** `string` (einer von: `draft`, `qr_locked`, `published`, `update_needed`, `suspended`, `withdrawn`, `deleted_recycled`): Status of a unit's passport (`docs/domain-model.md` §7).
- **serial_prefix** `string`
- **import_id** `string (uuid)`
- **format** `string` (einer von: `xlsx`, `csv`): The file format of a spreadsheet download.

## Antworten

### 200 (`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`, `text/csv`)

The spreadsheet.

`any`

### 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.

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

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

## Beispiel

```bash title="cURL"
curl -X GET "https://passport.kabin.sh/api/v1/batteries/export" \
  -H "Authorization: Bearer $BATTERYPASS_API_KEY"
```
