@postman/postman-plugin 0.3.0 → 0.4.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -9
- package/dist/hosts/antigravity.js +47 -0
- package/dist/hosts/codex-hooks.js +68 -0
- package/dist/hosts/codex.js +87 -8
- package/dist/hosts/copilot.js +60 -0
- package/dist/hosts/index.js +3 -1
- package/dist/json-rpc.js +113 -0
- package/dist/system.js +40 -3
- package/mcp.pi.json +2 -2
- package/package.json +1 -1
- package/skills/ai-readiness/SKILL.md +40 -44
- package/skills/api-discovery/SKILL.md +64 -145
- package/skills/api-discovery/reference/orbit.md +17 -5
- package/skills/api-documentation/SKILL.md +41 -46
- package/skills/api-engineer/SKILL.md +78 -23
- package/skills/api-mocking/SKILL.md +117 -163
- package/skills/api-monitoring/SKILL.md +52 -129
- package/skills/api-simulation/SKILL.md +130 -178
- package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
- package/skills/api-testing/SKILL.md +48 -95
- package/skills/bootstrap/SKILL.md +123 -224
- package/skills/ci-integration/SKILL.md +53 -113
- package/skills/collection-schema-v3/SKILL.md +43 -204
- package/skills/collection-schema-v3/reference/http.md +150 -0
- package/skills/datasets/SKILL.md +89 -315
- package/skills/datasets/reference/spreadsheets.md +25 -0
- package/skills/flows/SKILL.md +57 -206
- package/skills/flows/reference/flow_cli_flags.md +3 -2
- package/skills/performance-testing/SKILL.md +46 -62
- package/skills/performance-testing/references/jmeter-import/README.md +82 -0
- package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
- package/skills/performance-testing/references/jmeter-import/mapping-table.md +95 -0
- package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
- package/skills/performance-testing/references/jmeter-import/script-translation.md +97 -0
- package/skills/postman-mcp-server/SKILL.md +53 -59
- package/skills/postman-mcp-server/references/docs.md +0 -1
- package/skills/postman-mcp-server/references/learn.md +10 -9
- package/skills/postman-mcp-server/references/mock.md +0 -1
- package/skills/postman-mcp-server/references/search.md +0 -1
- package/skills/postman-mcp-server/references/security.md +0 -1
- package/skills/postman-mcp-server/references/setup.md +0 -1
- package/skills/postman-mcp-server/references/sync.md +0 -1
- package/skills/postman-mcp-server/references/test.md +0 -1
- package/skills/variables/SKILL.md +44 -87
- package/skills/webhook-testing/SKILL.md +103 -0
- package/skills/webhook-testing/reference/forwarding.md +10 -0
- package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
- package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
|
@@ -1,169 +1,123 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-mocking
|
|
3
|
-
description:
|
|
3
|
+
description: Finds, builds, runs and publishes a stand-in for one API — the owning team's published mock when there is one, otherwise one built from its spec or collection that behaves like the real API, stateful when callers write then read. 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. To run and test your own code against the services it calls, use api-simulation. Covers `postman mock` and `postman dependency add mock`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API Mocking
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
needs `interceptRequests: true`; a deployed server reads it only when the
|
|
125
|
-
mock has sessions enabled.
|
|
126
|
-
|
|
127
|
-
## The two ids that matter
|
|
128
|
-
|
|
129
|
-
- **Code-mock id** — the `id` in `config.yaml`, and the id that `push` and
|
|
130
|
-
`generate -w` print (often the same value). Use it for `get`, `deploy`,
|
|
131
|
-
`delete`, and `run` by workspace mock id.
|
|
132
|
-
- **`mockServerId`** — a different value from `mock get WORKSPACE_MOCK_ID` (table or
|
|
133
|
-
`--json`). Use it for `mock log`, and nothing else.
|
|
134
|
-
|
|
135
|
-
## Critical Rules
|
|
136
|
-
|
|
137
|
-
1. **When you're not signed in, every gated workspace command fails closed:**
|
|
138
|
-
`Authentication required. Run postman login or provide --api-key`, exit 1,
|
|
139
|
-
nothing half-done. (Signed in but lacking access fails differently — a
|
|
140
|
-
permission or missing-workspace error.) Whether a command is gated is decided
|
|
141
|
-
by what you pass it, not the verb — `mock get`/`mock run` take either a local
|
|
142
|
-
path (ungated) or a workspace mock ID (gated); `mock list` is gated only when called
|
|
143
|
-
with no path.
|
|
144
|
-
2. **`push` is what moves an existing local mock to the workspace — `-w` at
|
|
145
|
-
`generate` time is optional, not a fork you must choose up front.** A mock
|
|
146
|
-
built as a guest can be pushed and deployed later with no rework. Do not
|
|
147
|
-
assume `generate -w` left a `postman/mocks/NAME/` folder to `run`.
|
|
148
|
-
3. **`--public` on `deploy` is the one action here with real exposure** — it
|
|
149
|
-
stands up a server anyone with the URL can hit, with no API key. The default
|
|
150
|
-
(private) is the safe one; confirm intent before adding it.
|
|
151
|
-
4. **To change a mock:** refresh it from a source with
|
|
152
|
-
`postman mock generate SOURCE --update PATH`, or edit `default.js` by hand
|
|
153
|
-
and restart `mock run`. Never pass a code-mock id to `mock log` — that
|
|
154
|
-
command takes a `mockServerId`.
|
|
155
|
-
5. **`-w`/`--workspace` only exists on `generate`, `list`, `push`, and
|
|
156
|
-
`deploy`.** `get`, `run`, `log`, and `delete` already take a path or an id
|
|
157
|
-
that says where the mock is — there's nothing left for `-w` to resolve on
|
|
158
|
-
those.
|
|
159
|
-
|
|
160
|
-
## Verification
|
|
161
|
-
|
|
162
|
-
A mock isn't done because `generate` or `run` exited 0 — hit it with
|
|
163
|
-
`postman request` and check the actual status/body, or `mock get WORKSPACE_MOCK_ID
|
|
164
|
-
--json` for a pushed one, then state whether it ended up local, pushed, or deployed, and
|
|
165
|
-
(if deployed) private or public. For a scenario check, confirm a *valid* name
|
|
166
|
-
from `config.yaml` actually changed the response — a typo'd name falls back to
|
|
167
|
-
the default, so a 200 alone proves nothing. For a status-code check, use an
|
|
168
|
-
endpoint that has an example for that code (not the sample mock). A passing
|
|
169
|
-
exit code from `request` is not enough.
|
|
8
|
+
A mock is a folder, `config.yaml` plus a handler such as `default.js`, that
|
|
9
|
+
answers like an API. The handler is a Node HTTP server that calls
|
|
10
|
+
`listen(process.env.PORT)`. It loads as CommonJS even in an ESM project, so
|
|
11
|
+
`import` fails: use `require`. The same mock lives in your repo
|
|
12
|
+
(`postman/mocks/<name>/`, run with `postman mock run`, no sign-in needed),
|
|
13
|
+
in a Postman workspace after `postman mock push`, where other teams pull it
|
|
14
|
+
from, and on a mock server after `postman mock deploy`, for callers that
|
|
15
|
+
can't run it themselves.
|
|
16
|
+
|
|
17
|
+
Several APIs at once, for a service, a frontend or a test suite? Use
|
|
18
|
+
`api-simulation`, which gets each member's mock here.
|
|
19
|
+
|
|
20
|
+
## Use the owner's mock first
|
|
21
|
+
|
|
22
|
+
When the API belongs to another team, look for their published mock before
|
|
23
|
+
writing one: theirs encodes their contract and their service's state; yours
|
|
24
|
+
encodes a guess. It needs `postman login`; signed out, build one and say the
|
|
25
|
+
owner search was skipped.
|
|
26
|
+
|
|
27
|
+
1. Find the owner's workspace with `postman search workspaces "<service>" -o json`.
|
|
28
|
+
Name the service plainly, as your code does, not by what it returns: a
|
|
29
|
+
description matches lookalike services. Prefer a Git-connected workspace
|
|
30
|
+
(`isGitConnected`) named for that service.
|
|
31
|
+
2. List its mocks with `postman mock list -w <workspaceId> --json`.
|
|
32
|
+
`postman search mocks` misses some, and its `classicMock` results only
|
|
33
|
+
replay a collection's saved examples: `postman mock` can't pull or run
|
|
34
|
+
them, so call one at `https://<mockId>.mock.pstmn.io` with
|
|
35
|
+
`postman request`, or generate a code mock from its collection. A
|
|
36
|
+
same-named mock in another workspace isn't the owner's.
|
|
37
|
+
3. Pull it with `postman dependency add mock <mockId>` and use it as it is.
|
|
38
|
+
Never edit `postman/.dependencies/`: `dependency update` overwrites it,
|
|
39
|
+
so copy a mock to `postman/mocks/` to change it. A pulled copy loses
|
|
40
|
+
`interceptRequests`, so fork one whose handler reads `req.body` or relies
|
|
41
|
+
on sessions. A mock is code that runs as you; pull only from workspaces
|
|
42
|
+
you trust.
|
|
43
|
+
|
|
44
|
+
## Or build one that behaves like the real API
|
|
45
|
+
|
|
46
|
+
Callers shouldn't be able to tell the difference on the paths they use. A
|
|
47
|
+
mock that returns invented JSON passes your tests and fails against the
|
|
48
|
+
real service.
|
|
49
|
+
|
|
50
|
+
- **Start from the contract.** `postman mock generate <spec or collection>`
|
|
51
|
+
writes each documented response. It's a replay: a `POST` and a later
|
|
52
|
+
`GET` share nothing, and it accepts any request, so a call that breaks the
|
|
53
|
+
contract still gets its answer. `x-mock-response-code` picks only a
|
|
54
|
+
documented status; any other code gets the default 200, so put the errors
|
|
55
|
+
callers handle (the unknown-id 404, the conflict 409, the bad-input 400) in
|
|
56
|
+
the contract. From a spec
|
|
57
|
+
it serves the server URL's base path (`/v2/...`); from a collection,
|
|
58
|
+
routes start after the base-URL variable. `--update` regenerates the
|
|
59
|
+
handler and overwrites your edits. With no contract, write it from how
|
|
60
|
+
your code calls the API and say what you assumed.
|
|
61
|
+
- **Set `interceptRequests: true` in `config.yaml`.** Without it `req.body`
|
|
62
|
+
and `req.query` are undefined, `x-mock-session` is ignored, and a throw in
|
|
63
|
+
an async handler kills the mock instead of returning a `500`.
|
|
64
|
+
- **Make it stateful when callers write then read.** Keep records in
|
|
65
|
+
`pm.state`, seed them on first use, add a reset route so a test can start
|
|
66
|
+
clean, and answer an unknown id with the real 404. Every `mock run` starts
|
|
67
|
+
empty.
|
|
68
|
+
- **Know who shares state.** Locally, all callers share one state unless
|
|
69
|
+
each sends `x-mock-session: <id>`. A mock server deployed from the CLI
|
|
70
|
+
isolates each caller: one that keeps neither the same `x-mock-session` nor
|
|
71
|
+
the `pm_mock_session` cookie starts from the seed on every request, so its
|
|
72
|
+
`POST` and later `GET` never meet.
|
|
73
|
+
- **Scenarios** are named handlers in `config.yaml`'s `scenarios` list, picked
|
|
74
|
+
per request with `x-mock-scenario: <name>`. An unknown name falls back to
|
|
75
|
+
the default locally but is a `404` on a mock server.
|
|
76
|
+
|
|
77
|
+
## Check it against the contract
|
|
78
|
+
|
|
79
|
+
`postman mock run` prints the URL it bound; a busy configured port moves
|
|
80
|
+
unless you pass `--port`, so take the URL from that line. Nothing reloads:
|
|
81
|
+
restart it after an edit.
|
|
82
|
+
|
|
83
|
+
A mock checked against the handler you just wrote proves nothing, so call
|
|
84
|
+
it with requests from the contract: `postman request`, or the API's
|
|
85
|
+
collection with
|
|
86
|
+
`postman collection run <collection> --use-mock "{{baseUrl}} mock:postman/mocks/<name>"`
|
|
87
|
+
(`--mock` alone only starts it). That form replaces the variable's whole
|
|
88
|
+
value, base path included, so a mock generated from a spec that serves
|
|
89
|
+
`/v2/...` answers `404`; start that one with `--mock <path> --port <n>` and
|
|
90
|
+
pass `--env-var "baseUrl=http://localhost:<n>/v2"`. To check your own calls
|
|
91
|
+
against a contract, compare each one, from the code or a simulation log,
|
|
92
|
+
with the spec; the mock won't reject a wrong one.
|
|
93
|
+
|
|
94
|
+
## Publish it for other teams
|
|
95
|
+
|
|
96
|
+
- **Push it to the service's own workspace,** the one this repo is linked
|
|
97
|
+
to or the one the user names, never one chosen by name match: other
|
|
98
|
+
teams' simulations look there. Signed out, the push fails but the local
|
|
99
|
+
mock still works; build it, say so and ask the user to sign in. Keep it
|
|
100
|
+
honest: change the mock in the same PR as the API and run the API's
|
|
101
|
+
collection against it.
|
|
102
|
+
- **Deploy only when a caller needs a URL.** The server takes a slug of 3–32
|
|
103
|
+
lowercase letters, digits and single hyphens, starting and ending with a
|
|
104
|
+
letter or digit; the CLI accepts more, and its default can be too long.
|
|
105
|
+
It's private: callers send an API key as `x-api-key`, or, if they can
|
|
106
|
+
view the workspace, an access token as `x-access-token`. Deploying needs a paid plan; a team's first
|
|
107
|
+
server can take minutes to answer, and teams that review deploys hold them
|
|
108
|
+
for approval. Each later `push` changes what every caller of the server
|
|
109
|
+
gets, so treat it as a release, not a backup.
|
|
110
|
+
- **Write it for where it runs.** A mock server runs each scenario as one
|
|
111
|
+
file with Node's built-ins, not `fs` or `child_process`: no local
|
|
112
|
+
`require`s, no `pm.mock` examples, no environment, no console output, and
|
|
113
|
+
no caller `authorization`, `cookie` or `x-api-key` headers. A mock that
|
|
114
|
+
relies on any of these works locally and breaks once deployed.
|
|
115
|
+
- **Ask before `--public`.** It serves the mock and its data to anyone with
|
|
116
|
+
the URL, and a scripted redeploy can't make it private again.
|
|
117
|
+
|
|
118
|
+
## Before you say it's done
|
|
119
|
+
|
|
120
|
+
A mock isn't done because it started. Call it: a documented error comes
|
|
121
|
+
back, a valid scenario changes the response, a `POST` then `GET` shows state
|
|
122
|
+
if it should. Say where it runs and who can call it, where it lives, and
|
|
123
|
+
what you assumed.
|
|
@@ -1,138 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-monitoring
|
|
3
|
-
description:
|
|
3
|
+
description: Use when setting up recurring API checks, running or diagnosing a Postman Monitor, changing its schedule, or reaching private APIs through a self-hosted runner. Reuses collection assertions to detect live regressions and traces failures to individual run evidence. Use for requests such as "check this API every minute".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API Monitoring
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`--
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
ignored, so the CLI rejects it locally rather than returning a page that
|
|
57
|
-
looks right but isn't — use `--cursor` from the previous page's response.
|
|
58
|
-
`--columns` picks which fields show, `-f`/`--filter` matches on name within
|
|
59
|
-
the page already returned (not a server-side search), and `--sort name|active`
|
|
60
|
-
orders it. `monitor get <monitorId>` shows one monitor's full configuration.
|
|
61
|
-
|
|
62
|
-
## Triggering a run
|
|
63
|
-
|
|
64
|
-
`monitor run <monitorId>` runs an existing Monitor synchronously and prints
|
|
65
|
-
the result — useful in CI to get a pass/fail right after a deploy rather
|
|
66
|
-
than waiting for the next scheduled tick. `-t/--timeout` (default 15
|
|
67
|
-
minutes) caps how long the CLI waits for completion; a timeout hit here is
|
|
68
|
-
the CLI giving up on waiting, not the Monitor itself failing. `--async`
|
|
69
|
-
submits the run and returns immediately with its job id and Postman URL
|
|
70
|
-
instead of waiting at all — reach for this over a long `-t` when the caller
|
|
71
|
-
doesn't need the verdict inline. `--json` prints only the verdict as JSON,
|
|
72
|
-
for scripting. `-x/--suppress-exit-code` overrides the default
|
|
73
|
-
fail-on-failed-run exit code, for a caller that wants to see failures
|
|
74
|
-
without breaking a pipeline step.
|
|
75
|
-
|
|
76
|
-
## Diagnosing a run
|
|
77
|
-
|
|
78
|
-
`monitor jobs list <monitorId>` lists a monitor's recent jobs; `monitor jobs
|
|
79
|
-
get <jobId>` reports one job's terminal state and its per-region run
|
|
80
|
-
outcomes — a monitor with runners in multiple regions runs once per region
|
|
81
|
-
per job. `monitor runs get <runId>` goes one level deeper: which test
|
|
82
|
-
assertions ran during one attempt, which failed, and why. Reach for these
|
|
83
|
-
instead of re-running blind after a `-t` timeout, or whenever the task is
|
|
84
|
-
explaining *why* a monitor failed rather than just that it did.
|
|
85
|
-
|
|
86
|
-
## Private (self-hosted) runners
|
|
87
|
-
|
|
88
|
-
A private runner — the CLI's `runner regions` calls the same thing a
|
|
89
|
-
"private-runner" value — is an agent you run inside your own network so
|
|
90
|
-
Monitor traffic originates there instead of from Postman's cloud IPs. Reach
|
|
91
|
-
for one only when the monitored API sits behind a VPN, firewall, or on-prem
|
|
92
|
-
network that Postman's cloud can't reach directly; a public API should just
|
|
93
|
-
use a Postman region (`--runner us-east`, etc.) since that needs no
|
|
94
|
-
infrastructure of your own to run or maintain.
|
|
95
|
-
|
|
96
|
-
`runner start --id <id> --key <key>` (from the Postman app) registers a
|
|
97
|
-
runner that executes monitor runs from your own infrastructure instead of
|
|
98
|
-
Postman's cloud. Extra
|
|
99
|
-
flags cover the runner's own networking: `--region eu` for EU residency,
|
|
100
|
-
`--proxy`/`--egress-proxy`/`--egress-proxy-authz-url` for outbound routing,
|
|
101
|
-
`--ssl-extra-ca-certs` for a private CA, and `--metrics`/`--metrics-port`
|
|
102
|
-
for a health-check endpoint. Runner activity is published to the connected
|
|
103
|
-
workspace by default; `--no-report-events` keeps it local. `runner list`
|
|
104
|
-
shows the team's registered self-hosted runners —
|
|
105
|
-
feed an id from here into `monitor create/update --runner` or `monitor list
|
|
106
|
-
--runner`. `runner regions` lists the Postman-region and private-runner
|
|
107
|
-
values valid for `--runner` on `monitor create`/`update`, including a
|
|
108
|
-
static IP where one is configured — check here before guessing a region
|
|
109
|
-
string.
|
|
110
|
-
|
|
111
|
-
## Critical Rules
|
|
112
|
-
|
|
113
|
-
1. **`update` can't move a monitor to a different collection or environment,
|
|
114
|
-
and doesn't pause/resume it.** Delete and recreate for the former; use
|
|
115
|
-
`pause`/`resume` for the latter.
|
|
116
|
-
2. **A `monitor run -t` timeout is a wait cap, not a monitor failure.**
|
|
117
|
-
Don't report "the monitor failed" from a timeout without checking
|
|
118
|
-
`monitor jobs get`/`monitor runs get` (or the Postman app) for what the
|
|
119
|
-
run actually did after the CLI gave up waiting — or avoid the wait
|
|
120
|
-
entirely with `--async`.
|
|
121
|
-
3. **`--runner` on `monitor create`/`update` takes a region name or a
|
|
122
|
-
self-hosted runner id — check `runner regions`/`runner list` before
|
|
123
|
-
guessing a string,** and don't suggest `runner start` unless the target
|
|
124
|
-
API genuinely isn't reachable from Postman's cloud.
|
|
125
|
-
4. **`monitor list --offset` doesn't work — use `--cursor`,** and
|
|
126
|
-
`--runner` there can't be combined with the other filters.
|
|
127
|
-
5. **`monitor delete` is permanent.** Confirm intent before passing `-y` to
|
|
128
|
-
skip its prompt.
|
|
8
|
+
A monitor turns a saved collection into recurring evidence about a live API.
|
|
9
|
+
It can catch behavior that changes after deployment or between developer
|
|
10
|
+
sessions, but only if its assertions, environment, and execution location
|
|
11
|
+
exercise the guarantees users depend on.
|
|
12
|
+
|
|
13
|
+
1. Reuse the collection's meaningful assertions before scheduling it. A
|
|
14
|
+
request returning 200 is a weak health signal if the response can violate
|
|
15
|
+
the contract. Check auth, target environment, and write side effects; use
|
|
16
|
+
**api-testing** to establish what the collection actually verifies.
|
|
17
|
+
2. Choose cadence, timezone, execution location, and alert recipients from
|
|
18
|
+
the operational need. `postman monitor create -c <collection-id>` uses
|
|
19
|
+
the linked workspace unless one is supplied. Inspect command-specific
|
|
20
|
+
`-h` and available service options for supported schedules and limits.
|
|
21
|
+
Creation starts an immediate run by default; `--no-run-now` avoids that
|
|
22
|
+
when only scheduling was requested. A schedule expressed in the host's
|
|
23
|
+
default timezone can fire at the wrong operational time.
|
|
24
|
+
3. Choose a Postman region for a reachable public API. Use a self-hosted
|
|
25
|
+
runner when the target is reachable only inside the user's network;
|
|
26
|
+
running one adds infrastructure to maintain. `postman runner regions`
|
|
27
|
+
provides valid hosted locations and `runner list` provides registered
|
|
28
|
+
private runner IDs. `monitor create/update --runner` accepts either;
|
|
29
|
+
multiple locations help distinguish API failures from regional reachability.
|
|
30
|
+
4. Preserve monitor identity when updating schedule or run settings.
|
|
31
|
+
`monitor update` cannot change its collection or environment and does not
|
|
32
|
+
pause it; use `pause`/`resume` for that. A different collection/environment
|
|
33
|
+
requires a replacement, so plan the handoff before deleting the old
|
|
34
|
+
monitor and its continuity. Permanent deletion needs explicit intent.
|
|
35
|
+
5. Use `postman monitor run <id>` for an immediate verdict, such as after a
|
|
36
|
+
deploy. `--async` returns a job handle when the caller need not wait.
|
|
37
|
+
The CLI timeout caps waiting, not execution; after a timeout, inspect
|
|
38
|
+
the submitted job instead of sending duplicate traffic or reporting failure.
|
|
39
|
+
6. Diagnose at the level of the evidence. `monitor jobs list <monitor-id>`
|
|
40
|
+
finds jobs, `monitor jobs get <job-id>` shows terminal state and regional
|
|
41
|
+
outcomes, and `monitor runs get <run-id>` shows assertions within an
|
|
42
|
+
attempt. A failing region, a connection error, and a failed assertion
|
|
43
|
+
imply different fixes. Preserve normal exit-code failures for CI gates.
|
|
44
|
+
|
|
45
|
+
For discovery, `monitor list` supports workspace and collection filters;
|
|
46
|
+
use its returned cursor for pagination rather than offset. Its runner filter
|
|
47
|
+
is for a self-hosted ID and cannot be combined with other filters; a page-local
|
|
48
|
+
name filter does not establish absence across all pages.
|
|
49
|
+
|
|
50
|
+
For a private runner, use `runner start` with the registered ID and key and
|
|
51
|
+
verify that it connects before assigning runs. Inspect its help for proxy,
|
|
52
|
+
private CA, residency, and health-metric options only when the network requires
|
|
53
|
+
them. Runner activity is reported by default; `--no-report-events` disables
|
|
54
|
+
that reporting when the task requires it. Use **bootstrap** for unresolved
|
|
55
|
+
authentication rather than placing runner keys in repository files.
|
|
129
56
|
|
|
130
57
|
## Verification
|
|
131
58
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
not yet a verdict — resolve it with `monitor jobs get` before reporting a
|
|
136
|
-
result). If a self-hosted runner was started, confirm it registered (the
|
|
137
|
-
Postman app, or `runner list`, shows it as connected) before assuming
|
|
138
|
-
monitor runs will route through it.
|
|
59
|
+
Report the actual monitor configuration or terminal job/run outcome, including
|
|
60
|
+
where it executed and which checks failed. A created monitor, accepted job,
|
|
61
|
+
or connected runner alone does not prove the API passed its health checks.
|