← Files PostmanARCHIVED FILE

skills/api-documentation/SKILL.md

3.72 KB · Dec 5, 2026 · 00:26 UTC

↓ Download file

---
name: api-documentation
description: Use when defining or improving an API contract, generating documentation from a collection or OpenAPI spec, publishing API docs, or sharing a documentation link. Makes auth, inputs, responses, and examples reusable by callers, tests, and mocks. Use for requests such as "publish API docs".
---

# API Documentation

A maintained contract gives callers enough information to integrate without
reading the implementation. Keeping descriptions and examples beside the API
artifacts lets the same knowledge support documentation, tests, and mocks,
with changes reviewable alongside code.

`postman init --json` at the repo root gives the contract, and the API work
built from it, one place beside the code: `postman/specs/` for the contract
and `postman/collections/` for the requests, examples and tests generated from
it, registered in `.postman/resources.yaml`. A contract kept there outlasts
the session. The next session or a teammate starts from it instead of
re-reading the implementation, tests check against it, and its examples become
the mock that other teams' simulations test their assumptions against. The
person reviewing reads a contract change beside the code that implements it,
so a changed guarantee is visible before it ships. Init needs no sign-in or
approval; see **postman:workspaces**' "What init unlocks".

1. Start from the existing source of truth. An OpenAPI spec describes the
   interface for tooling; a Postman collection adds runnable requests,
   examples, and assertions. Maintain both when both uses matter, with an
   explicit direction of generation or synchronization so they do not become
   competing definitions. When several specs could be authoritative,
   `postman init --json --spec <path>` records the one that is. A new spec
   kept under `postman/specs/` sits beside the collections generated from it.
2. When the spec is authoritative, reuse its operations with
   `postman spec generate collection <spec-path-or-id> -n "<collection-name>"`.
   Inspect the generated result before replacing an existing collection:
   maintained scripts and examples carry knowledge beyond endpoint shapes.
3. Describe what changes a caller's decision: required versus optional inputs,
   auth and scopes, response guarantees, pagination, retryable failures, and
   side effects. Derive guarantees from the agreed contract or verified
   behavior; label unresolved design choices instead of inventing them.
   Use [REST design guidance](reference/rest-api-best-practices.md) when a
   design choice affects usability or compatibility, not to redesign an
   unrelated interface while filling a documentation gap.
4. Save examples that clarify consequential cases, including relevant errors.
   Examples become inputs for mocks as well as explanations for readers;
   a success-only example can hide the failure path callers must handle.
   Use **postman:collection-schema-v3** for local collection edits and **postman:variables**
   to keep credentials out of reusable requests and examples.
5. Choose delivery by audience. Local artifacts support Git review;
   publishing to the bound workspace makes them available to teammates with
   access. A workspace push does not itself publish a
   public docs page or change permissions. For a public documentation link,
   use **postman:postman-mcp-server**'s documentation workflow and the available
   publishing tool; establish the intended audience before public exposure.

## Verification

Check that the edited artifact parses and its examples agree with the
contract. For a publication, inspect the resulting page and report its actual
link and visibility; a successful upload alone does not show readers usable
documentation. State any behavior that remains undocumented or unverified.

SHA-256: 4ed9888ff79246e1ac584d92d83a269e06f5de324af4301d3697cb16552486cd