# What changed from an earlier version to this one

> `GET /batteries/{batteryId}/passport/versions/{versionNo}/diff` · Scope: `read` · operationId `getPassportVersionDiff`

Any member. Compares the signed snapshots field by field; `against` defaults to the previous version.

## Path parameters

- **batteryId** `string (uuid)` (required)
- **versionNo** `integer` (required)

## Query parameters

- **against** `integer`

## Responses

### 200 (`application/json`)

The changes.

- **fields** `PassportFieldChange[]` (required)
  - **after** `PassportDiffValue`
  - **before** `PassportDiffValue`
  - **change** `string` (required, one of: `added`, `removed`, `changed`, `provenance`): `provenance`: same value, a newer revision (re-approved, re-measured).
  - **key** `string` (required)
  - **level** `string` (required, one of: `model`, `unit`)
- **from_version_no** `integer`: Absent when there is nothing to compare with (the first publication).
- **metadata** `PassportMetaChange[]` (required)
  - **after** `string`
  - **before** `string`
  - **key** `string` (required, one of: `model_version`, `registry_version`, `category`, `facility`, `operator`, `predecessor`)
- **to** `string` (required, one of: `version`, `preview`)
- **to_version_no** `integer`: Absent in a publish preview.

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

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

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

## Example

```bash title="cURL"
curl -X GET "https://passport.kabin.sh/api/v1/batteries/{batteryId}/passport/versions/{versionNo}/diff" \
  -H "Authorization: Bearer $BATTERYPASS_API_KEY"
```
