Skip to content

postmanlabs/postman-code-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postman-code-examples

This repository contains examples of using Postman Code. Each example was created by connecting the Postman MCP Server, code toolset, to a coding agent.

These examples aim to show how you can accomplish a few fundamental things with Postman Code:

  • Exploring APIs — Search for APIs on Postman and explore them: both internal and public APIs
  • Consuming APIs — Generate high-quality, well-organized client code with types and error handling
  • Syncing API Changes — Consume API updates and regenerate client code

Each example includes its own README with conversation examples showing how the agent explored APIs, answered questions, or generated code. Where applicable, you'll also find setup instructions to run the example yourself.

Watch the example video:

Postman.Code.-.Stripe.Payments.Demo.mp4

Examples by Use Case

Exploring APIs

See how the agent navigates Postman's API network to answer questions about APIs—reading actual request definitions and documentation directly from collections. Key tools: searchPostmanElements, getWorkspaces, getCollectionMap, getCollectionRequest, getCollectionResponse.

Public

  • HubSpot API Explorer — The user asks questions about HubSpot's public API and gets answers sourced directly from their Postman collections. Covers authentication, CRM objects, associations, and search.

Internal

  • Internal API Explorer — The user explores their team's workspaces and collections through conversation, asking the agent to find APIs, read documentation, and inspect request examples.

Consuming APIs

See how the agent generates production-ready client code directly from Postman collections using all the context that is available. Key tools: getCodeGenerationInstructions, plus the exploration tools above.

  • Stripe API Payment Demo — The user builds a working payments demo using Stripe's API. This example also demonstrates what happens when response examples aren't available in the collection—response types are marked as unverified.

Syncing API Changes

See how the agent detects changes in Postman collections and regenerates client code to stay current—no manual diff-reading required.

  • Coming soon!

Questions & Issues

If you run into problems or have comments/suggestions, please open an issue. We'd love to hear from you and respond quickly.

Contributing

If you've used Postman Code to explore APIs or generate code and are willing to share your example, open an issue and let us know. We'll help get it into the example list!

About

Examples of using the Postman MCP Server to explore and consume APIs

Resources

License

Stars

Watchers

Forks