# Versioning

An Application pins one version of the Aryeo API, and that version keeps the contract it was tested against. The version sits in the path of every request, so the base URL chooses it:

```
https://api.aryeo.com/v2beta1
```

The version is the first segment of every path, as in `/v2beta1/jobs`. The API selects no version from a header, and a version has no minor number, such as `v2.1`. One version line covers the whole API, so `v2beta1` names one release of every endpoint.

## Beta versions

A version such as `v2beta1` is a beta. A beta lets an Application try a contract before it settles:

- Once Aryeo publishes a beta, its contract does not change.
- The next beta, such as `v2beta2`, can break the contract of the one before it.
- Aryeo serves each beta for at least 30 days after it publishes the next beta or the stable version. After those 30 days, Aryeo can stop serving the beta with no deprecation window.
- The stable version, `v2`, releases with the contract of the last beta.


Read the changelog when a new beta appears, and move to it within those 30 days.

## Stable versions

A stable version, such as `v2`, makes no breaking change. Aryeo ships each breaking change in a later stable version.

A stable version can still change in ways that break no client that reads the contract. Write the client to accept these changes:

| Change | Example |
|  --- | --- |
| A new endpoint | `GET /jobs/{id}/notes` |
| A new optional input | An optional property on a create |
| A new property in a response | `completed_at` on a Job |
| A new value in a response enum | `on_hold` in a Job's `lifecycle_status` |
| Looser validation of an input | A `name` that accepts more characters |


Each of these is a breaking change, and none of them happens within a stable version:

- An endpoint, property, query key, enum value, scope, or error code is removed or renamed.
- A property, query key, or header changes its type, format, meaning, or default.
- An optional input becomes required, or a required input or header appears.
- An input's validation tightens.
- A case that an endpoint handles returns a different status.
- An operation requires a broader scope.
- A resource changes its `resource_type`.


## Deprecation

Aryeo deprecates a stable version before it stops serving it. From the first response that carries a `Deprecation` header, Aryeo serves that version for at least 12 more months.

Every response of a deprecated version carries three headers:

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Deprecation: @1790812800
Sunset: Fri, 01 Oct 2027 00:00:00 GMT
Link: <CHANGELOG_ENTRY_URL>; rel="deprecation"
```

- `Deprecation` gives the time the deprecation took effect, in seconds since the epoch.
- `Sunset` gives the date after which Aryeo stops serving the version.
- `Link` with `rel="deprecation"` points to the changelog entry that explains the change.


A deprecated endpoint carries `Deprecation` and `Link` too. It carries `Sunset` once its version has a sunset date, and that date is never earlier than the version's.

Watch for the `Deprecation` header in the client, and log or alert on it. It gives the date to plan the upgrade.

## The changelog

The [changelog](/apis/vendor-platform/changelog) dates each change to the contract, and marks each one as breaking or non-breaking.