View API history

View API History

Optic stores the history of your API so you can see how it has changed over time. Once you set up Optic in CI, Optic will start tracking every API change. You can also backfill your history if you have an existing OpenAPI spec in Optic, or if you are adding new OpenAPI specs to Optic.


Optic pulls the git history of your API and finds everytime it has changed (even if your OpenAPI spec uses $refs over different files).

If you haven't already, install the Optic CLI and log in

npm install -g @useoptic/optic
optic login

Next, backfill your history into Optic by running

optic api add openapi.yml --history-depth=0
# or
optic api add ./specs --history-depth=0
# or
optic api add --all --history-depth=0

Backfilling history can take some time - you can cancel at any time, and you can rerun the same command to continue backfilling.

Once backfilling is complete, you should be able to see the stats and changes that has happened through your API. You can also compare different versions of your API by using the Specify Versions selector on the API page.


You will also be able to:

  • See a changelog with the list of endpoints that have changed over time
  • Stats for breaking changes, endpoint changes and accuracy over time
  • Diff different OpenAPI versions at different points of time