# v1 Migration Guide (/api/v1-migration-guide)

If migrating from version 0.2b to v1, please note the following changes.

## General

1. Only `api.spoke.com` should be used for the `v1` API.
2. Webhooks requests will now only contain the `spoke-signature` header.

## Stops

Removals:

| Operation  | 0.2b Property                   | v1 Property                      | Notes                                                                        |
| ---------- | ------------------------------- | -------------------------------- | ---------------------------------------------------------------------------- |
| WRITE      | `stop.driver`                   | `stop.allowedDrivers`            | Drivers should now be provided as an array of `DriverIds`.                   |
| READ       | `stop.driverIdentifier`         | `stop.allowedDrivers`            | Drivers will now be returned as an array of `DriverIds`.                     |
| READ       | `stop.allowedDriverIdentifiers` | `stop.allowedDrivers`            | Drivers will now be returned as an array of `DriverIds`.                     |
| READ       | `stop.etaNullReason`            | `stop.eta.status`                | `eta` now has a status property with the same information.                   |
| READ       | `stop.timeAtStopInfoNullReason` | `stop.timeAtStopInfo.status`     | `timeAtStopInfo` now has a status property with the same information.        |
| READ/WRITE | `stop.circuitClientId`          | `stop.clientId`                  | When creating or reading stops, `circuitClientId` will now be `clientId`     |
| READ       | `stop.deliveryInfo.arrivedAt`   | `timeAtStopInfo.value.arrivedAt` | This property is only available when `timeAtStopInfo.status === 'available'` |

Changes:

1. READ: `stop.eta` is now an object containing both the eta value, and additional metadata about the value.
2. READ: `stop.timeAtStopInfo` structure has changed so that the original properties are now under `timeAtStopInfo.value.*`,
   and an additional field `timeAtStopInfo.status` has been added to indicate why the info is not set.

## Plans

Changes:

1. Previously we would allow `Drivers` to be added even if their `Depot` did not match the plan's `Depot`.
   This is no longer allowed. Non-matching `Drivers` must now have their `Depot` changed to match the target `Plan`,
   or vice versa.
2. `Driver` objects are no longer returned as part of `Plan` endpoint responses. Instead, `DriverIds` are returned and
   the associated drivers must be fetched separately (if needed).