# API versioning and deprecation — SolarX Philippines

SolarX exposes a small **public** HTTP API for agent discovery and quote handoff. This page is the human-readable versioning policy referenced from `openapi.json`.

## Current version

- **Stable surface:** URL path prefix `/api/v1/`
- **Discovery:** `GET /api` and `GET /api/v1` list supported endpoints.
- **Contract:** [OpenAPI 3.1](https://solarxphilippines.com/openapi.json)

## Versioning rules

1. **Breaking changes** (removed fields, semantic changes, or incompatible validation) require a **new major path** (e.g. `/api/v2/`). The previous major path remains available during a deprecation window.
2. **Non-breaking changes** (new optional JSON fields, new read-only endpoints, documentation) may ship under the current `/api/v1/` path without a version bump.
3. **Marketing site URLs** (city pages, guides) are not versioned; only JSON API routes under `/api/` follow this policy.

## Deprecation and sunset

When an endpoint or path is deprecated:

| Signal | Meaning |
|--------|---------|
| `Deprecation: true` | The route is legacy; migrate to the successor listed in `Link`. |
| `Sunset: <HTTP-date>` | Earliest date the route may be removed (RFC 8594). |
| `Link: <url>; rel="successor-version"` | Preferred replacement endpoint. |

Deprecated routes are announced **at least 90 days** before removal. Example: `POST /api/quote` is a legacy alias of `POST /api/v1/quote` and returns these headers on success.

## Changelog

- **2026-10-11:** Published this policy; legacy quote path documents `Deprecation` / `Sunset` headers.

Contact: hello@solarxphilippines.com
