What a published page includes
Published docs live at https://swastik.codes/docs/<your-slug> and show, for every folder and request:
- the method and URL, with path variables, query parameters and headers
- request bodies, including form-data and urlencoded fields
- your Markdown descriptions on the collection, folders and requests
- saved examples with their responses
- code samples in the language the reader picks (cURL, JavaScript, Python, Go, Java and more, from the same code generator as the app)
Readers can search requests, link straight to any folder or request, and download the collection as a Postman v2.1 file. A Run in Swastik Codes button opens the collection in the app; you can hide it if you prefer.
Custom pages
Add up to 30 custom pages written in Markdown, such as Getting started, Authentication, Rate limits or a changelog, and order them as you like. They appear alongside the generated reference.
## Authentication
Every request needs a bearer token in the `Authorization` header:
Authorization: Bearer <your token>
Tokens expire after one hour. Request a new one with `POST /oauth/token`.Credentials stay private
Publishing is designed not to leak secrets. Current values of variables are never published, secret variables are blanked, and credential fields in auth settings and headers such as Authorization, Cookie and X-Api-Key are blanked unless they are a single {{variable}} reference. Before publishing, the dialog runs a secret scan over the collection and tells you how many possible secrets it found, so you can move them into variables or the vault first.
Pick the environment readers see
Attach an environment to the publication, for example a public sandbox, so URLs in the docs show https://sandbox.example.com instead of {{baseUrl}}. Choose a title, a theme (light, dark, or following the reader's system setting) and the default code sample language in the publish settings.
Docs that flag drift
Docs go stale when the API changes and nobody updates the examples. Swastik Codes checks for you: every response you get in the app is compared with the request's saved examples, which are what the published docs and mock servers show. When they no longer agree, the response bar shows Docs drift and lists what changed:
- a status code that no example documents, such as a
500on a request whose examples show200and404; - a different
Content-Type; - JSON fields that are missing, new, or of another type, with their path, such as
user.email is missingoritems[].price is a string, documented as a number.
The response is compared with the closest example that has the same status, so a request can document several shapes. Values are not compared, only the structure, and null or a {{variable}} in an example matches any value. Update example replaces the example with the live response in one click; re-publish and the docs are current again.
The collection runner runs the same check on every request, counts the requests that drifted and lets you filter to them. Turn the check off in Settings under Check responses against the docs.
Always up to date
Re-publish whenever the collection changes, or unpublish with one click. Because documentation, tests, mock servers and monitors all come from the same collection, there is one source of truth instead of a wiki page that drifts out of date, and the drift check tells you when the examples need a refresh.
Offline documentation in one file
Right-click a collection and choose Download offline docs (HTML) for a single self-contained page: a sidebar of every request, each with its description, authorization, parameters, headers, body, a cURL example and saved examples. It has no scripts and loads nothing from the internet, follows light and dark mode, prints cleanly and leaves secrets out exactly like the published page. See Publish and export API documentation.
How it works
- Write descriptions and save examples on your requests in the app.
- Open the collection's publish dialog, choose a slug (3 to 64 lowercase letters, digits and dashes), an environment, a theme and any custom pages.
- Publish and share the link. Publishing needs a free account and a cloud workspace.
Frequently asked questions
Can I use my own domain?
Published docs are served at swastik.codes/docs/<slug> today.
Are my API keys safe if they are in the collection?
Credential fields and sensitive headers are blanked unless they are a variable reference, and secret variables are emptied. Still, the safest approach is to keep real secrets in the vault or in current values, which are never published.
Can readers try requests?
Readers can copy code samples or open the collection in Swastik Codes with the Run button and send requests there.
What does the drift check compare?
The status code, the media type of Content-Type, and for JSON bodies the shape: which fields exist and whether each is an object, array, string, number or boolean. Field values and their order are ignored. Requests with no saved examples are not checked, since nothing is documented for them.
Can I generate docs from an OpenAPI file?
Yes. Generate or import a collection from your OpenAPI definition in API design, add descriptions and examples, then publish it.