# Changelog

## V4.2 (Late May 2026)

* **Enum value lookup endpoints:** New generic endpoints for discovering which enum attributes a vehicle type supports and retrieving their valid values. See [Vehicle field values](client-documentation#vehicle-field-values) in the client documentation.
* **VIN length validation removed:** The 17–19 character length constraint on the `vin` field (added in V4.1) has been removed. Any length is now accepted again.
* **Client documentation rewritten:** Endpoints section updated to use V4 paths, expanded error responses, improved field descriptions, and added missing list filters.
* **Physics weight field renames:** Weight fields in `physics` have been renamed across categories to use a consistent naming convention: `weight_cargo` → `cargo_weight` and `weight_main` → `gross_weight` for Bus and Truck; `weight` → `gross_weight` for Agriculture and Construction.
* **Fixed: Updates accepted on externally deleted ads.** When an ad was deleted outside of import-api (e.g. via Blocket Admin), subsequent update requests incorrectly returned 200 OK instead of an error. The API now correctly responds with an error message explaining that the ad has been deleted.

## V4.1 (Mid-May 2026)

New `category_fields` support for additional categories:

| Category | category_id | Fields |
|----------|-------------|--------|
| Boat | `1060` | brand, model, powertrain, physics, equipment |
| Agriculture Tractor | `1228` | brand, model, powertrain, condition, physics, tyres, equipment |
| Agriculture Thresher | `1227` | brand, model, powertrain, condition, physics, equipment |
| Agriculture Tools | `1229` | brand, model, weight, tools_category |
| Bus | `1321` | brand, body_type, model, model_year, registration_number, vin, condition, powertrain, physics, equipments |
| Truck | `1322` | brand, body_type, model, model_year, registration_number, vin, condition, powertrain, physics, equipments |
| Construction | `1323` | brand, body_type, model_year, vin, service_contract, condition, powertrain, physics |

See the [Category Reference](category-reference) for full field specifications and examples.

Typed ad endpoints:

* Each category now has its own endpoint (e.g. `/v4/car`, `/v4/boat`, `/v4/bus`) that automatically infers the `category_id`. The `category_id` field is no longer required when using typed endpoints.
* The generic `/v4/ad` endpoint continues to work with explicit `category_id` but is now discouraged in favor of typed endpoints.

Breaking changes:

* **Generic migrate endpoint removed:** `POST /v4/ad/{source_id}/migrate` no longer exists. Use the typed migrate endpoints instead (e.g. `POST /v4/boat/{source_id}/migrate`, `POST /v4/truck/{source_id}/migrate`). The typed endpoints infer the target category from the URL — do not include `category_id` in the request body.

Other changes:

* **Timestamp format change:** `created` and `updated` fields now include a UTC timezone suffix (`Z`) and always include microsecond precision, as required by RFC 3339. Example: `2026-05-08T12:00:00.000000Z` (previously `2026-05-08T12:00:00`). Standard datetime parsers handle both formats — clients using string comparison against timestamps may need to update.
* **source_id format validation:** `source_id` now only accepts letters, digits, hyphens, underscores, and dots. Characters like `/`, `?`, and `#` are rejected with a 400 error.
* Bumping ads with an active Pole Position is now allowed
* Validated enum values now visible in Swagger schema
* Improved error handling for database outages (returns 503 instead of 500)

## V4.0 (February 2026)

Full registered vehicle support for four categories previously limited to simple ads:

| Category | category_id |
|----------|-------------|
| Moped | `1121` |
| Camper / Motorhome | `1102` |
| Caravan | `1101` |
| Trailer | `1045` |

These categories now support detailed vehicle data (brand, model, mileage, powertrain, physics, equipment, etc.) — the same level of detail as Cars and Motorcycles.

* New migration endpoint: `POST /v4/{type}/{source_id}/migrate` — converts V3 ads to V4 in-place (the generic `/v4/ad/{source_id}/migrate` variant was removed in V4.1 — use typed endpoints)
* V4 endpoints are backward compatible: GET and DELETE work for both V3 and V4 ads
* V3 endpoints remain fully supported

## V3.1

* Support for registered vehicle categories previously only managed via Blocket Admin
* Improved state on Ad and improved action and state on LogMessages
* New fields: `warranty`, `return_policy`, `service_history`, `product_declaration`, `home_delivery`

## V3.0

* API now represents Ads instead of "APIMessages"
* All dates/times stored and returned in UTC
* Renamed and restructured fields for creating ads
* New hosting location and database — separate history from earlier versions
* New authentication system — new tokens required
