sync

A command that keeps Postman collections—saved groups of API requests—in step with API code or OpenAPI specifications.

In plain words
What is it for?
Use it to create collections from API specifications, update existing collections after endpoint changes, or push manual endpoint updates through a connected Postman workspace.
Why use it?
It reduces drift between the endpoints developers build and the requests used for testing or sharing them in Postman.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/postman-devrel/postman-claude-code-plugin/sync
Clone the repo
git clone --depth 1 https://github.com/Postman-Devrel/postman-claude-code-plugin
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,155 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.01155
Opus 5 $0.00011 $0.00577
Sonnet 5 $0.00004 $0.00231
Haiku 4.5 $0.00002 $0.00115

Measured yesterday against content hash 05d1cb8acaf7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/sync.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sync Collections

Keep Postman collections in sync with your API code. Create new collections from OpenAPI specs, update existing ones when specs change, or push manual endpoint changes.

Prerequisites

The Postman MCP Server must be connected. If MCP tools aren't available, tell the user: "Run /postman:setup to configure the Postman MCP Server."

Workflow

Step 1: Understand What Changed

Detect or ask:

  • Is there a local OpenAPI spec? Search for **/openapi.{json,yaml,yml}, **/swagger.{json,yaml,yml}
  • Did the user add/remove/modify endpoints?
  • Is there an existing Postman collection to update, or do they need a new one?

Step 2: Resolve Workspace

Call getWorkspaces to get the user's workspace ID. If multiple workspaces exist, ask which to use.

Step 3: Find or Create the Collection

If updating an existing collection:

  1. Call getCollections with the workspace parameter to list collections
  2. Match by name or ask the user which collection
  3. Call getCollection to get current state

If creating a new collection from a spec:

  1. Read the local OpenAPI spec
  2. Call createSpec with:
    • workspaceId: the workspace ID
    • name: from the spec's info.title
    • type: one of OPENAPI:2.0, OPENAPI:3.0, OPENAPI:3.1, ASYNCAPI:2.0
    • files: array of {path, content} objects
  3. Call generateCollection from the spec. This is async (HTTP 202). Poll getAsyncSpecTaskStatus or getGeneratedCollectionSpecs until complete, with increasing waits between polls (2s, 4s, 8s). Don't narrate intermediate poll results — report only the final outcome.
  4. Call createEnvironment with variables extracted from the spec:
    • base_url from servers[0].url
    • Auth variables from securitySchemes (mark as secret)
    • Common path parameters

Step 4: Sync

Spec to Collection (most common):

  1. Call createSpec or updateSpecFile with local spec content
  2. Call syncCollectionWithSpec to update the collection. Async (HTTP 202). Poll getCollectionUpdatesTasks for completion with increasing waits between polls.
  3. Note: syncCollectionWithSpec only supports OpenAPI 3.0. For Swagger 2.0 or OpenAPI 3.1, use updateSpecFile and regenerate the collection.
  4. Report what changed

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 86 lines · 22 tokens per session scan A 05d1cb8acaf7

Subscribe to this mod's changes

sync is a command published in the GitHub repository Postman-Devrel/postman-claude-code-plugin (38 stars, last pushed 26d ago), licensed Apache-2.0. It adds 22 tokens to every session and 1,155 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories