API Versioning

ADR-0015 establishes URI versioning for the public REST API and buf breaking-change detection for internal gRPC contracts.

Versioning Table

Version Status Notes
/v1 Current — stable Active development; additive changes only
/v2 Not yet created Will be introduced only when a breaking change is required

Public REST API

The major version is encoded in the URI path (/v1/). A major version is a stable, long-lived contract.

Backwards-Compatible Evolution Within a Major Version

The following changes are additive and are allowed without a version bump:

The following changes are breaking and require /v2/:

Deprecation Process

When an endpoint or field is deprecated:

  1. Add Deprecation and Sunset HTTP response headers with the planned removal date.
  2. Mark it in gen/openapi/bitvault.yaml with deprecated: true and an x-sunset extension.
  3. Announce with at least one major version overlap: /v1 remains available until the sunset date after /v2 ships.

Public API Freeze Gate

/v1 declared stable is the gate for the React Native mobile app (P5 / NG4). The mobile client cannot ship against a moving contract. Once the freeze is declared, /v1 field additions are still allowed; removals require a /v2 process with a minimum 6-month sunset window.

Internal gRPC Contracts

Internal gRPC is governed by buf breaking-change detection in CI.

Rules enforced:

The buf check runs as buf breaking --against .git#branch=main in every PR.

:::tip OpenAPI The generated OpenAPI spec (gen/openapi/bitvault.yaml) is the authoritative reference for the public REST API. It is generated from the proto definitions via task gen — never edit it manually. Any manual edit will be overwritten on the next task gen run. :::