Work as a team · Lesson 18 of 20

Publish and export API documentation

Turn a collection into documentation others can read, online with a link or as a single HTML file.

Beginner · 2 min · Updated

Good documentation answers three questions for each endpoint: what does it do, what do I send, and what comes back. A collection with descriptions and saved examples already holds all of that, so publishing it takes a minute.

Get the content ready

  • Write a short description for the collection and for each request in its Docs tab (Markdown works: headings, lists, code, links).
  • Save an example of a real response for each request, ideally a success and an error.
  • Use variables such as {{baseUrl}} in URLs, and pick the environment whose values readers should see.

Publish online

  1. Right-click the collection and choose Publish documentation.
  2. Choose the URL slug (the page becomes swastik.codes/docs/shop-api), an environment to show values from, a page title, the theme and the code sample language.
  3. Click Publish and share the link.

The page lists every folder and request with its description, parameters, headers, body, examples and code snippets in many languages, and updates when you change the collection. Swastik Codes warns you before publishing if the collection still contains secrets, and it strips credentials, secret variables and your own current values from what is published.

When an endpoint starts answering differently from its saved examples, the request shows a Docs drift badge in the app, with one click to update the example, so the documentation does not quietly go out of date.

Download offline documentation

Sometimes you need documentation without a website: to attach to an email, hand to a client, or commit next to the code. Right-click the collection and choose Download offline docs (HTML).

You get one .html file with a sidebar of all requests and, for each, the method, URL, description, authorization, parameters, headers, body, a cURL example and the saved examples. It has no scripts and loads nothing from the internet, so it opens anywhere, follows the reader's light or dark setting, and prints cleanly. Secrets are removed exactly as on the published site.

What you learned

  • Publish documentation gives a collection a public, always up-to-date documentation page.
  • Download offline docs (HTML) produces a single self-contained file for email, clients or your repository.

Next: bring your existing Postman collections across.

Try it on your own API

Swastik Codes runs in the browser and is free to use. Create an account to send requests, sync your workspaces and invite your team.