# Versioning and deprecation

> Path versions, 12 months of overlap for breaking changes, Deprecation and Sunset headers, and a changelog built from the spec.

Source: https://docs.wpwaterfall.com/developers/versioning

The version is in the path: `https://api.wpwaterfall.com/v1`. `v1` is the current version.

## What changes without a new version?

Additive changes land in the current version and appear in the [changelog](https://docs.wpwaterfall.com/developers/changelog):

- New routes, new optional parameters, and new fields on a response.
- New values in an enum that the docs mark as open, such as job types.
- New relations for `?expand=`.

Write clients that ignore fields they do not know.

## What needs a new version?

A breaking change ships in a new path version:

- Removing or renaming a route, a parameter, or a response field.
- Making an optional parameter required.
- Changing the type or meaning of a field, or the scope a route needs.

When that happens the old version keeps answering for **12 months**. During the overlap every answer from a deprecated route carries three headers:

| Header | Format | Example |
|---|---|---|
| `Deprecation` | RFC 9745, the date the route was deprecated as `@` plus Unix seconds | `Deprecation: @1791158400` |
| `Sunset` | RFC 8594, the HTTP date after which the route stops answering, at least 12 months after `Deprecation` | `Sunset: Tue, 05 Oct 2027 00:00:00 GMT` |
| `Link` | `rel="deprecation"` points at this page; `rel="successor-version"` names the replacement route | `Link: <https://docs.wpwaterfall.com/developers/versioning>; rel="deprecation", </v2/sites>; rel="successor-version"` |

Watch for `Deprecation` in your client and log it, so a deprecated call never goes unnoticed for a year.

After the Sunset date the route is removed and answers the standard `404` problem. The changelog entry for the removal names the replacement.

## Where is the changelog?

The [changelog](https://docs.wpwaterfall.com/developers/changelog) is generated from diffs of the OpenAPI document, so it lists every added, changed, and removed operation and schema, with breaking changes called out first. It is not written by hand. Each entry is keyed by the `info.version` of the spec.

## How does the document version move?

The `info.version` of the OpenAPI document is its release number. Every change to the contract raises it, so a client can tell which document it was built from.

| Change | Version step |
|---|---|
| Additive: a new route, optional parameter, response field, or schema | patch, for example `0.3.0` to `0.3.1` |
| Breaking, before `1.0.0` | minor, for example `0.3.1` to `0.4.0` |
| Breaking, from `1.0.0` | major, and the old path version stays up for 12 months as above |

## Where do I see incidents?

The API and webhook delivery are components on [status.wpwaterfall.com](https://status.wpwaterfall.com). Incidents and scheduled maintenance are posted there.
