Versioning
The version is in the path. What may be added to it at any time, what never changes within it, and how an endpoint that is going away says so first.
The version of the API is in its path: https://api.won.dev/v1. Code written against /v1 keeps working as /v1 grows, and a change that could break it only ever comes as a new version.
What may be added
These come to /v1 at any time, without notice, so a client should accept them:
- New endpoints, and new tools on the MCP server.
- New optional parameters.
- New fields in a response, anywhere in it.
- New values where a field lists kinds, such as a new
error.code, event type or billing unit. Treat one you do not know like the closest one you do: an unknown error code by its HTTP status. - Other wording of
message,hintandnotice, which are written to be read, not parsed. Branch onerror.code.
What never changes within a version
- An endpoint, a parameter or a field is never removed or renamed, and never changes its type or meaning.
- An optional parameter never becomes required.
- An ID keeps its prefix and keeps working.
Anything that would break these comes only as a new version, such as /v2. The old version goes on next to it, and each of its endpoints is retired as below.
When an endpoint is going away
An endpoint is deprecated at least 6 months before it stops working. From that day on:
- Every answer of it carries the
Deprecationheader (RFC 9745), the time since which it is deprecated, theSunsetheader (RFC 8594), the date it stops working, and aLinkto its page in these docs. - The OpenAPI document marks it
deprecated: true, and its description names what to use instead and the date.
HTTP/2 200
Deprecation: @1798761600
Sunset: Thu, 01 Jul 2027 00:00:00 GMT
Link: <https://won.dev/docs/trade/companies-search>; rel="deprecation"To hear of it in time, log a warning whenever an answer carries Deprecation. No endpoint is deprecated today.
Last updated on