Skip to content
Back to skills

Postman

ASecurity

Build, test, and automate APIs with Postman collections, environments, and Newman CLI.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
securityjavascriptjavabashgitapici/cdsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill postman --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Postman?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Postman
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-postman/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-postman)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Postman
slug: postman
version: 1.0.0
homepage: https://clawic.com/skills/postman
description: Build, test, and automate APIs with Postman collections, environments, and Newman CLI.
metadata: {"clawdbot":{"emoji":"๐Ÿ“ฎ","requires":{"bins":["newman"]},"os":["linux","darwin","win32"],"install":[{"id":"npm","kind":"npm","package":"newman","bins":["newman"],"label":"Install Newman (npm)"}]}}
changelog: Initial release with collections, environments, and Newman automation.
---

## Setup

If `~/postman/` doesn't exist, read `setup.md` silently and start naturally.

## When to Use

User needs to test APIs, create Postman collections, manage environments, or run automated API tests with Newman.

## Architecture

Data lives in `~/postman/`. See `memory-template.md` for structure.

```
~/postman/
โ”œโ”€โ”€ memory.md           # Projects, preferences, common patterns
โ”œโ”€โ”€ collections/        # Postman collection JSON files
โ””โ”€โ”€ environments/       # Environment JSON files
```

## Quick Reference

| Topic | File |
|-------|------|
| Setup | `setup.md` |
| Memory template | `memory-template.md` |
| Collection format | `collections.md` |
| Newman automation | `newman.md` |

## Core Rules

### 1. Collection Structure First
Before creating requests, define the collection structure:
- Folder hierarchy reflects API organization
- Use descriptive names: `Users > Create User`, not `POST 1`
- Group related endpoints logically

### 2. Environment Variables Always
Never hardcode values that change between environments:
```json
{
  "key": "base_url",
  "value": "https://api.example.com",
  "enabled": true
}
```
Use `{{base_url}}` in requests. Environments: `dev`, `staging`, `prod`.

### 3. Pre-request Scripts for Auth
Handle authentication in pre-request scripts, not manually:
```javascript
// Get token and set for collection
pm.sendRequest({
    url: pm.environment.get("auth_url"),
    method: 'POST',
    body: { mode: 'raw', raw: JSON.stringify({...}) }
}, (err, res) => {
    pm.environment.set("token", res.json().access_token);
});
```

### 4. Test Assertions Required
Every request needs at least basic assertions:
```javascript
pm.test("Status 200", () => pm.response.to.have.status(200));
pm.test("Has data", () => pm.expect(pm.response.json()).to.have.property("data"));
```

### 5. Newman for CI/CD
Run collections headlessly with Newman:
```bash
newman run collection.json -e environment.json --reporters cli,json
```
Exit code 0 = all tests passed. Integrate into CI pipelines.

## Collection Format

### Minimal Collection
```json
{
  "info": {
    "name": "My API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Get Users",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/users",
        "header": [
          { "key": "Authorization", "value": "Bearer {{token}}" }
        ]
      }
    }
  ]
}
```

### With Tests
```json
{
  "name": "Create User",
  "request": {
    "method": "POST",
    "url": "{{base_url}}/users",
    "body": {
      "mode": "raw",
      "raw": "{\"name\": \"{{$randomFullName}}\", \"email\": \"{{$randomEmail}}\"}",
      "options": { "raw": { "language": "json" } }
    }
  },
  "event": [
    {
      "listen": "test",
      "script": {
        "exec": [
          "pm.test('Created', () => pm.response.to.have.status(201));",
          "pm.test('Has ID', () => pm.expect(pm.response.json().id).to.exist);"
        ]
      }
    }
  ]
}
```

## Environment Format

```json
{
  "name": "Development",
  "values": [
    { "key": "base_url", "value": "http://localhost:3000", "enabled": true },
    { "key": "token", "value": "", "enabled": true }
  ]
}
```

## Newman Commands

| Task | Command |
|------|---------|
| Basic run | `newman run collection.json` |
| With environment | `newman run collection.json -e dev.json` |
| Specific folder | `newman run collection.json --folder "Users"` |
| Iterations | `newman run collection.json -n 10` |
| Data file | `newman run collection.json -d data.csv` |
| HTML report | `newman run collection.json -r htmlextra` |
| Bail on fail | `newman run collection.json --bail` |

## Common Traps

- **Hardcoded URLs** โ†’ Tests break between environments. Always use `{{base_url}}`.
- **No assertions** โ†’ Tests "pass" but don't validate anything. Add status + body checks.
- **Secrets in collection** โ†’ Credentials leak. Use environment variables, gitignore env files.
- **Sequential dependencies** โ†’ Tests fail randomly. Use `setNextRequest()` explicitly or make tests independent.
- **Missing Content-Type** โ†’ POST/PUT fails silently. Always set `Content-Type: application/json`.

## Dynamic Variables

Postman built-in variables for test data:

| Variable | Example Output |
|----------|----------------|
| `{{$randomFullName}}` | "Jane Doe" |
| `{{$randomEmail}}` | "jane@example.com" |
| `{{$randomUUID}}` | "550e8400-e29b-..." |
| `{{$timestamp}}` | 1234567890 |
| `{{$randomInt}}` | 42 |

## OpenAPI to Postman

Import OpenAPI/Swagger specs:
1. Export OpenAPI JSON/YAML
2. In Postman: Import > File > Select spec
3. Collection auto-generated with all endpoints

Or via CLI:
```bash
npx openapi-to-postmanv2 -s openapi.yaml -o collection.json
```

## Security & Privacy

**Data that stays local:**
- Collections and environments in `~/postman/`
- Newman runs locally

**This skill does NOT:**
- Send collections to external services
- Store API credentials in memory.md

## Related Skills
Install with `clawhub install <slug>` if user confirms:
- `api` โ€” REST API consumption patterns
- `json` โ€” JSON manipulation and validation
- `ci-cd` โ€” Pipeline automation

## Feedback

- If useful: `clawhub star postman`
- Stay updated: `clawhub sync`

Files in this skill

  • SKILL.md5.6 KB
  • _meta.json271 B
  • collections.md2.9 KB
  • memory-template.md1 KB
  • newman.md2.8 KB
  • setup.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security โ†’

Comments

Loading commentsโ€ฆ

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.