Publish Documentation

Share docs with your team

Optic makes it easy to share your OpenAPI documentation with other people on your team, and consumers across your organization.


Just login:

optic login

And add your OpenAPI specs:

optic api add service-a/openapi.yml

If you want to add all the OpenAPI specs in a repo, you can run:

optic api add --all

You can add --history-depth=0 to these commands which will sync all previous spec versions to Optic Cloud, where you can then see history and see changes between different versions!



You'll notice one line was added to each file: x-optic-url. Optic uses this pointer to uniquely identify this OpenAPI in CI and on other developer's machines. Commit this change to your version control system.

Open the link in your terminal output to review your API's documentation in Optic Cloud.

Add Optic to CI

Great! You've now added your documentation to Optic Cloud, the next step is set this up in CI so that your documentation is never out of sync. Follow our guide for GitHub or GitLab. Setting Optic up in CI also gets you:

  • Automatic breaking change detection and consistent naming conventions standards
  • API statistics such as changes over time and breaking changes introduced in the last 6 months