Skip to content
Skill

API mocking

Finds, builds or pulls a stand-in API for frontends, clients and tests

API mocking is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
49
Last commit
License
Apache-2.0
Listing updated

Similar skills

About API mocking

This skill helps an agent produce a stand-in for an API that is not built or reachable yet. It first looks for a published mock from the API's owner or a verified publisher, since a maintained mock reflects the real contract and state. If none exists, it builds a local mock folder with a Node handler, generated from a spec or collection, or written from how the calling code uses the API.

The workflow covers pulling a mock as a dependency, running it locally with the Postman CLI, optionally backing responses with real records from a dataset, and keeping write-then-read behavior in state. It also explains how to test the mock against the contract with requests or a collection run, and how to publish a mock to a workspace or deploy it to a mock server for other teams.

It expects the Postman CLI, and a signed-in account for searching, pushing, deploying and dataset-backed generation. Handlers are written in Node.js using CommonJS.

When your agent uses it

Use when something needs an API that isn't built or reachable yet (a frontend, client or demo), when other teams should build against your API before it ships, or when asked to mock an API or fake a backend. Finds, builds, runs and publishes a stand-in for one API — a published mock when its owner or a verified publisher has one, otherwise one built from its spec or collection, stateful when callers write then read, answering with real records from a sheet or database. To run your own code against the services it calls, use postman:api-simulation. Covers `postman mock` and `postman dependency add mock`.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (11 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the postman plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add postmanlabs/postman-plugin
/plugin install postman@postman

Or copy only this skill to ~/.claude/skills/api-mocking:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/postmanlabs/postman-plugin.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/api-mocking &&
cp -R "$tmp/agent-plugin/skills/api-mocking" ~/.claude/skills/api-mocking &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/api-mocking inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/api-mocking to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/postmanlabs/postman-plugin.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/api-mocking &&
cp -R "$tmp/agent-plugin/skills/api-mocking" ~/.agents/skills/api-mocking &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/api-mocking inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/api-mocking to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/postmanlabs/postman-plugin.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/api-mocking &&
cp -R "$tmp/agent-plugin/skills/api-mocking" ~/.cursor/skills/api-mocking &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/api-mocking inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/postmanlabs/postman-plugin.git --path agent-plugin/skills/api-mocking

Or copy the folder to ~/.gemini/skills/api-mocking yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/api-mocking:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/postmanlabs/postman-plugin.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/api-mocking &&
cp -R "$tmp/agent-plugin/skills/api-mocking" ~/.copilot/skills/api-mocking &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/api-mocking inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/postmanlabs/postman-plugin.git

Then copy postman-plugin/agent-plugin/skills/api-mocking into your agent's skills folder as api-mocking. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Published mock lookup
Searches workspaces and mock listings for an existing maintained mock before writing a new one.
Contract-based generation
Generates a mock handler from an API spec or collection, with documented responses.
Dataset-backed answers
Lets the handler query real records from a dataset instead of hand-written JSON.
Stateful responses
Keeps records in state so writes can be read back, with a reset route for tests.
Contract verification
Runs requests or a collection against the mock to check documented responses and scenarios.
Workspace publishing
Pushes mocks to a Postman workspace and deploys them to a mock server for callers.

Good for

  • Build a mock API so a frontend can develop before the backend ships
  • Find and pull a published mock for a third-party payment or email API
  • Generate a mock handler from an OpenAPI spec
  • Make a demo backend that stores and returns records between requests
  • Publish a mock to the team workspace so other teams can build against it

API mocking FAQ

Do I need a Postman account to use API mocking?

Searching for published mocks, pushing, deploying and dataset-backed generation need a signed-in CLI. Running a local mock from your repo works without signing in, and file-based datasets also work signed out.

Where does the mock live?

A mock is a folder with config.yaml and a handler such as default.js, kept in postman/mocks/<name>/ in your repo. It can also be pushed to a Postman workspace or deployed to a mock server.

Which Node module syntax does the handler use?

The handler loads as CommonJS, so it should use require rather than import, even in an ESM project.

Can I edit a mock pulled from another team?

Do not edit postman/.dependencies/, since dependency update overwrites it. Copy the mock to postman/mocks/ to make changes.

How do I install API mocking in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/api-mocking to use it in all your projects, or to .claude/skills/api-mocking in one project. Or install the postman plugin, which includes it: /plugin marketplace add postmanlabs/postman-plugin, then /plugin install postman@postman.

Does API mocking run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use API mocking?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to API mocking?

The closest alternatives to API mocking are API discovery, API testing, API simulation, API mock helper and API documentation.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from postmanlabs/postman-plugin

  1. Guides an agent through wiring a new vendor plugin route into the Postman plugin repo

    • Open source
    • 49 GitHub stars
    • Developer tools
  2. Walks an agent through cutting and publishing npm releases of the Postman plugin installer

    • Open source
    • 49 GitHub stars
    • Developer tools
  3. Scores how well an API contract lets AI agents discover, call and recover from errors

    • Open source
    • 49 GitHub stars
    • Developer tools
  4. Finds existing API contracts, mocks and consumers so agents reuse them instead of guessing

    • Open source
    • 49 GitHub stars
    • Developer tools
  5. Keeps API contracts, examples and published docs accurate for callers, tests and mocks

    • Open source
    • 49 GitHub stars
    • Developer tools
  6. Guides an agent through multi-step HTTP API work using Postman skills and shared contracts

    • Open source
    • 49 GitHub stars
    • Legal and government