JSON ⇄ Postman Converter
Convert JSON request objects to Postman Collection v2.1 format and extract requests from collections back to JSON.
Back to all tools on ToolForge
JSON Request Object
Postman Collection
About JSON ⇄ Postman Converter
This converter transforms simple request JSON (URL, method, headers, body) into Postman Collection v2.1 format and extracts request data from Postman collections back to JSON.
It is useful when creating Postman collections from API documentation, converting cURL or JSON requests to Postman format, or extracting request configurations from existing collections for programmatic use.
Postman Collection v2.1 Structure
{
"info": {
"name": "My API Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Users",
"request": {
"method": "GET",
"header": [
{"key": "Accept", "value": "application/json", "type": "text"}
],
"url": "https://api.example.com/users"
}
},
{
"name": "Create User",
"request": {
"method": "POST",
"header": [
{"key": "Content-Type", "value": "application/json", "type": "text"}
],
"body": {
"mode": "raw",
"raw": "{\"name\": \"John\"}"
},
"url": "https://api.example.com/users"
}
}
]
}
Input JSON Format
{
"name": "Request Name (optional)",
"method": "GET|POST|PUT|DELETE|PATCH|...",
"url": "https://api.example.com/endpoint",
"headers": {
"Accept": "application/json",
"Authorization": "Bearer token123"
},
"body": {
"key": "value"
}
}
Example with body:
{
"method": "POST",
"url": "https://api.example.com/users",
"headers": {"Content-Type": "application/json"},
"body": {"name": "John", "email": "[email protected]"}
}
Common HTTP Methods
| Method | Description | Typical Use |
|---|---|---|
GET | Retrieve resources | Fetch data, no body |
POST | Create resources | Submit data, JSON body |
PUT | Replace resources | Full update, JSON body |
PATCH | Partial update | Field updates, JSON body |
DELETE | Remove resources | Delete by ID, no body |
HEAD | Get headers only | Check resource exists |
OPTIONS | Get allowed methods | CORS preflight |
Common Headers Reference
| Header | Value Example | Purpose |
|---|---|---|
Accept | application/json | Expected response format |
Content-Type | application/json | Request body format |
Authorization | Bearer token123 | Authentication token |
X-API-Key | your-api-key | API key authentication |
User-Agent | MyApp/1.0 | Client identification |
Origin | https://example.com | CORS request origin |
Frequently Asked Questions
- What is Postman Collection format?
- Postman Collection format (v2.1) is a JSON schema for organizing API requests. Collections contain items (requests or folders), with each request having method, URL, headers, and body. Schema URL: https://schema.getpostman.com/json/collection/v2.1.0/collection.json. Collections can be exported/imported for sharing and version control.
- How do I convert JSON to Postman format?
- Map request properties: method (GET/POST/etc), url (full URL string), headers (array of key/value objects), body (object with mode and raw string). Wrap in collection structure with info (name, schema) and item array. This tool handles the conversion automatically.
- What is the structure of a Postman request?
- A Postman request contains: method (HTTP verb), url (string or object with host/path/query), header (array of {key, value, type}), body (optional, with mode: raw/formdata/urlencoded and content). Example: {"method": "GET", "url": "https://api.example.com/users", "header": [{"key": "Accept", "value": "application/json"}]}
- How do I extract requests from a Postman collection?
- Iterate through the item array, checking for request property. For nested folders (items with item array), recurse. Extract method, url, headers (convert array to object), and body.raw. This tool extracts all requests and outputs as JSON array or single object.
- Can Postman collections have nested folders?
- Yes, Postman collections support nested folders. An item can have an item array containing sub-items (requests or more folders). When converting, nested structures are flattened to extract all requests. When creating collections, requests are wrapped in a single top-level item array.
- What body modes does Postman support?
- Postman supports: raw (plain text, JSON, XML), formdata (multipart/form-data with key/value pairs), urlencoded (application/x-www-form-urlencoded), binary (file upload), graphql (GraphQL queries). Raw mode is most common for JSON APIs. Body mode determines Content-Type header.