# Versioning and deprecation

Any breaking changes are released as a new major version of the effected API. A breaking change is
any change that may potentially break an integration.

## Selecting API Versions:

To use a specific version of our API, you can select it using one of the following methods:

* Header: Set the `x-dpp-version` header with the desired version number.
* Query Parameter: Include the `api-version` query parameter with the desired version number
in your request.
* Media Type Parameter: Append a `v` parameter with the version number to the media type in
the Accept header.


### Default Version:

If no version is specified in the request, the the earliest non-deprecated version of the API is
used by default.
If multiple versions are specified in a single request through different methods, the
behavior is undefined, and it may lead to errors. Consistent usage of one method of version
specification is adviced.

API version can be selected by:

* Setting the `x-dpp-version` header to the desired version,
* including the `api-version` query parameter with the desired version,
* or by adding a `v` parameter to the media type with the desired version.


If no version is specified the latest API version is selected. If more than one version is specified the behavior is undefined.

## Deprecation

### 1. Deprecation announcement

Deprecations are announced publicly on <maillist> at least 6 months before an API, or parts of it, is
removed or superceeded. Annouchments will include:

* An end-of-life (EOL) date, the point in time when support will be dropped.
* The Reason for the deprecation
* A migration path, guidance on how to move implementations to use to new or other APIs.
* Impact assessment, a description of what will happen after the EOL date.


### 2. Deprecation period

Responses will have an `api-deprecated-versions` header whose value is a comma seperated list of API
versions that has been deprecated. Responses will also have an `api-supported-versions` header whose
value is a comma seperated list of supported API versions.

### 3. Change of default API version

3 months into the deprecation periodthe default version is changed to the version that
superceeds the deprecated one. The change to the default version is announced on <maillist>.

Note, this means that any API requests that does not specify a version will be handled by the new
version of the API.

### 5. API retirement (End-of-life Date)

On the EOL date or same time after, the deprecated API is retired and all requests using the
deprecated API will either recieve a 404 Not Found response or a 400 Bad Request response where the
response body has `error.code = "UnsupportedApiVersion"`.