Overview
Introduction
Building a Postman collection by hand in the Postman app works fine for a handful of requests, but becomes tedious once you're regenerating the same set of requests repeatedly, say from a route list that keeps changing during development.
This tool generates a valid Postman Collection v2.1 JSON file directly from a plain list of requests, ready to import.
What Is Postman Collection Generator?
A Postman Collection v2.1 generator that builds the info/item/variable/auth structure Postman expects from a repeatable list of requests, optional folder grouping, collection variables, and an auth block.
It's part of this site's API Tools collection, and complements the existing Postman Collection Analyzer (which inspects a collection you already have) and the Postman/OpenAPI converters (which convert between existing documents) rather than replacing either.
How Postman Collection Generator Works
Each request row's headers are parsed line by line on their first colon into Postman's header array format, and a non-empty body becomes a raw-mode body block; requests sharing the same folder name are grouped into a single folder item, while requests with no folder name are placed directly in the collection's top-level item array.
Collection-level variables and the chosen auth scheme (none/apiKey/bearer) are attached at the collection root, in the exact field shapes (variable, auth.bearer, auth.apikey) the Postman Collection Format v2.1 schema defines.
When To Use Postman Collection Generator
Use it when you have a list of API requests (perhaps sketched from a route list or an OpenAPI document) and want a ready-to-import Postman collection without manually adding each request in the Postman app.
It's also useful for regenerating a collection from source whenever your API's request list changes, keeping the collection reproducible rather than hand-maintained.
Often used alongside OpenAPI Generator, Swagger YAML Generator and REST API Config Generator.
Features
Advantages
- Produces a schema-valid Postman Collection v2.1 JSON document, importable directly into Postman with no manual fixup.
- Supports folder grouping, collection variables, and a collection-level auth block, the three most commonly needed organizational features.
- Parses headers from simple line-based text instead of requiring a separate key/value UI per header.
Limitations
- Doesn't support nested (multi-level) folders; all folders are flat, one level deep.
- Doesn't generate test scripts, pre-request scripts, or example responses, only the request definitions themselves.
- Body is always sent as raw mode; form-data, urlencoded, and binary body modes aren't generated.
Examples
Best Practices & Notes
Best Practices
- Use Postman variables like {{baseUrl}} and {{token}} in your URLs and auth token rather than hardcoding environment-specific values, and define matching collection variables so the collection works across environments.
- Group related requests into the same folder name consistently; a typo in the folder name silently creates a second, separate folder instead of adding to the existing one.
- Keep the auth block at the collection level for the common case, and override per-request auth manually in Postman afterward only for the few endpoints that genuinely need different credentials.
Developer Notes
Folder membership is tracked with an insertion-ordered Map keyed by folder name so folders appear in the output in the order their first request was added, matching how someone reading the input top-to-bottom would expect the generated collection to be organized; header lines are split on the first colon only (not every colon), so a header value that itself contains a colon (like a URL) is preserved intact.
Postman Collection Generator Use Cases
- Generating a ready-to-import Postman collection from a list of API endpoints during initial API design
- Regenerating a collection to stay in sync with a changing route list, instead of manually editing it in the Postman app
- Producing a shareable collection with pre-configured auth and variables for a team to import and start testing immediately
Common Mistakes
- Using inconsistent folder name casing or spacing ("Widgets" vs "widgets ") and ending up with two separate folders instead of one.
- Hardcoding a real token or API key directly into the authToken field for a collection that will be shared or committed; use a Postman variable and set the real value only in a local environment instead.
Tips
- Import the generated JSON into Postman and set up a matching environment with your real baseUrl and token values, rather than editing the collection's variables directly for each environment.