New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@postman/onboarding-bootstrap

Package Overview
Dependencies
Maintainers
528
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@postman/onboarding-bootstrap

Bootstrap Postman workspaces, specs, and collections from OpenAPI.

latest
Source
npmnpm
Version
2.19.1
Version published
Weekly downloads
0
Maintainers
528
Weekly downloads
 
Created
Source

Postman Onboarding: Workspace Bootstrap

CI Release npm License: MIT

Provisions a Postman workspace from an OpenAPI spec, generating baseline, smoke, and contract collections in one step.

Every generated collection ships with executable contract tests compiled from your spec: OpenAPI request, response, schema, and security checks grounded in the governing RFCs, plus dedicated gRPC, SOAP, GraphQL, AsyncAPI, and MCP lanes. The full test inventory and the standard behind each check: Generated assertions and Multi-Protocol Contract Assertions.

Part of the Postman API Onboarding suite; the composite action's README has the full action-picker table.

Usage

name: Bootstrap Postman workspace
on:
  push:
    branches: [main]

jobs:
  bootstrap:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - id: postman_token
        uses: postman-cs/postman-resolve-service-token-action@v2
        with:
          postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
          postman-region: us
      - uses: postman-cs/postman-bootstrap-action@v2
        with:
          project-name: core-payments
          spec-url: https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml
          postman-region: us
          postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
          postman-access-token: ${{ steps.postman_token.outputs.token }}
          credential-preflight: enforce

Provide either spec-url (public HTTPS) or spec-path (a file in the checked-out repo) for the Spec Hub import path.

Mint the postman-access-token with the service-token action: it is the primary credential and carries every Postman asset operation. A service account PMAK for postman-api-key is optional; it mints and re-mints that access token and logs the Postman CLI in for spec lint. See Obtaining Credentials for the credential matrix and legacy fallback.

[!NOTE] The action defaults to the US production region (postman-region: us). EU data residency teams should set postman-region: eu on this action and on the service-token step that feeds it.

Common scenarios

Git-first spec from the repository

Read the OpenAPI document directly from the checked-out workspace instead of hosting it over HTTPS:

- uses: actions/checkout@v5
- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    spec-path: apis/core-payments/openapi.yaml
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}

Safe rerun for an existing service

Pass workspace-id, spec-id, and existing collection IDs to rerun without creating duplicate Postman assets. When .postman/resources.yaml is committed on the checked-out ref, the action reuses its workspace, spec, and collection mappings automatically.

- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    workspace-id: ws-123
    spec-id: spec-123
    baseline-collection-id: col-baseline
    smoke-collection-id: col-smoke
    contract-collection-id: col-contract
    spec-url: https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}

Create a versioned release set

Create a release-scoped spec and collection set instead of refreshing the canonical assets in place:

- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    spec-url: https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml
    collection-sync-mode: version
    spec-sync-mode: version
    release-label: v1.1.1
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}

When release-label is omitted, the action derives one from the git tag or branch. Details in Lifecycle Modes.

Fail the run on OpenAPI breaking changes

Compare the incoming contract before any Postman mutation. pr-native mode diffs the PR target branch version of spec-path against the working tree:

- uses: actions/checkout@v5
  with:
    fetch-depth: 0
- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    spec-path: apis/core-payments/openapi.yaml
    breaking-change-mode: pr-native
    breaking-target-ref: ${{ github.base_ref }}
    breaking-baseline-spec-path: apis/core-payments/openapi.baseline.yaml
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}

Modes off, previous-spec, pr-native, and baseline-only are described in OpenAPI Spec Handling.

Assign the workspace to a governance group

Set the repository custom property postman-governance-group, then provide tokens so the action can perform workspace enrichment:

- id: postman-token
  uses: postman-cs/postman-resolve-service-token-action@v2
  with:
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
    postman-region: us

- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    spec-url: https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml
    postman-region: us
    github-token: ${{ github.token }}
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
    postman-access-token: ${{ steps.postman-token.outputs.token }}

For one-off runs, governance-group can be passed directly and overrides the repository custom property. governance-mapping-json remains supported as a domain-map fallback for older workflows. If the governance group configuration is missing, the group is not found, or the access token is expired, bootstrap logs a warning and continues with the created workspace, spec, and collections.

Create the workspace under an org-mode sub-team

Postman organizations with multiple sub-teams require an explicit workspace-team-id for workspace creation:

- uses: postman-cs/postman-bootstrap-action@v2
  with:
    project-name: core-payments
    spec-url: https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml
    workspace-team-id: ${{ vars.POSTMAN_WORKSPACE_TEAM_ID }}
    postman-api-key: ${{ secrets.POSTMAN_API_KEY }}

See Team Identity for sub-team discovery and team-ID derivation.

Inputs

NameDescriptionRequiredDefault
workspace-idExisting Postman workspace IDno
spec-idExisting Postman spec IDno
baseline-collection-idExisting baseline collection IDno
smoke-collection-idExisting smoke collection IDno
contract-collection-idExisting contract collection IDno
additional-collections-dirWorkspace-relative directory containing curated Postman v2.1 JSON/YAML files or canonical HTTP collection v3 Local View directories to create or update.no
onboarding-scopeOnboarding scope. Use full for the complete pipeline or spec-only for OpenAPI workspace and specification onboarding without generated assets.nofull
sync-examplesWhether linked spec/collection relations should enable example syncingnotrue
collection-sync-modeCollection lifecycle policy (refresh or version)norefresh
spec-sync-modeSpec lifecycle policy (update or version)noupdate
release-labelOptional release label used for versioned specs and collectionsno
project-nameService project nameyes
domainBusiness domain for the serviceno
domain-codeWorkspace naming prefixno
governance-groupPostman governance workspace group name. Overrides the postman-governance-group repository custom property and domain mapping.no
requester-emailRequester email for audit contextno
workspace-admin-user-idsComma-separated workspace admin user idsno
workspace-team-idNumeric SUB-TEAM (squad) id that should own the created org-mode workspace. Required when your Postman team is an org with multiple sub-teams. This is a squad id, NOT the parent/org team id from the resolver's team-id output; that value is never valid here. On an org account whose squad list is unreadable or unusable, bootstrap now fails before any workspace is created unless this input is set. Run once on a healthy account without it to see available sub-teams listed in the error output.no
spec-urlHTTPS URL to the OpenAPI document to bootstrap. Provide either spec-url or spec-path.no
spec-pathLocal filesystem path to the OpenAPI document (relative to the workspace). Provide either spec-url or spec-path.no
spec-files-jsonOptional content-free JSON inventory of multi-file definition members from discovery (schemaVersion 1). Empty by default. When set, inventory root must equal spec-path. Cannot be combined with spec-url. Not a directory mode — companions are listed explicitly; file content is never embedded.no
protocolAPI spec protocol. auto (default) detects from content/extension. openapi uploads the canonical spec to Spec Hub and builds baseline/smoke/contract collections locally (import/deep-update); graphql (SDL/introspection), grpc (.proto), and soap (WSDL) build and instrument a Postman collection directly.noauto
protocol-endpoint-urlEndpoint URL/authority used by generated non-OpenAPI requests (e.g. {{baseUrl}}/graphql, grpc://host:port). Supports Postman variable interpolation. Ignored for openapi.no
openapi-versionOpenAPI specification version override (3.0 or 3.1). When not set, the version is auto-detected from the spec content.no
preserve-oas30-type-nullOpt-in compatibility mode for OpenAPI 3.0 oneOf schemas that pair one normal schema with a null-only member. The action uploads the original source bytes unchanged and uses an internal nullable true view for validation and generated artifacts. All unrelated validation and lint errors remain enforced.nofalse
breaking-change-modeOpenAPI breaking-change comparison mode (off, pr-native, baseline-only, or previous-spec)nooff
breaking-baseline-spec-pathWorkspace-relative baseline OpenAPI spec path used by baseline-only mode and pr-native fallbackno
breaking-rules-pathWorkspace-relative openapi-changes rules file. Missing files are ignored.nochanges-rules.yaml
breaking-target-refOptional target branch or git ref override for pr-native breaking-change comparisonsno
breaking-summary-pathOptional markdown report output path. Defaults to a runner-temp file.no
breaking-log-pathOptional raw command log output path. Defaults to a runner-temp file.no
governance-mapping-jsonLegacy JSON map of business domain to governance group name. Prefer governance-group or the postman-governance-group repository custom property.no{}
github-tokenGitHub token used to read the postman-governance-group repository custom propertyno
gh-fallback-tokenFallback GitHub token used to read repository custom properties when github-token cannotno
postman-api-keyPostman service-account API key used only to preflight the mint credential with GET /me and mint or re-mint the short-lived postman-access-token. It is never used for asset or Postman CLI operations. Optional when postman-access-token is supplied.no
postman-access-tokenPostman service-account access token (x-access-token). Every identity and asset operation runs through the access-token gateway. Optional when postman-api-key is supplied for token minting. CLI/binary usage may instead set POSTMAN_ACCESS_TOKEN.no
credential-preflightAccess-token session preflight policy. warn (default) continues with reactive diagnostics when session identity is unavailable; enforce fails before any workspace is created.nowarn
branch-strategyBranch-aware sync strategy. legacy (default) keeps branch-blind behavior; publish-gate restricts canonical writes to the canonical branch and runs credential-free static validation on other branches; preview additionally maintains suffixed per-branch preview asset sets.nolegacy
canonical-branchExplicit canonical branch (the sole writer of canonical assets). Defaults to the provider-resolved default branch; required on providers without a default-branch variable (Bitbucket, Azure DevOps) when branch-strategy is not legacy.no
channelsComma-separated channel map for long-lived promotion branches, e.g. "develop=DEV, staging=STAGE, release/*=RC". Channel branches maintain prefix-named parallel asset sets and never mutate canonical assets.no
folder-strategyFolder organization strategy for generated collections (Paths or Tags)noPaths
nested-folder-hierarchyWhen folder-strategy is Tags, enables nested folder hierarchynofalse
request-name-sourceDetermines how requests are named in generated collections (Fallback or URL)noFallback
secrets-resolverCloud secret store backing the optional "00 - Resolve Secrets" helper request placed at the start of generated Smoke and Contract collections. One of none, aws, azure, or gcp. Defaults to none, which injects no helper request. The helper is a local-run convenience only; it is skipped when CI=true.nonone
postman-regionPostman data residency region for access-token minting and gateway calls.nous

Outputs

NameDescriptionRequiredDefault
workspace-idPostman workspace IDn/an/a
workspace-urlPostman workspace URLn/an/a
workspace-namePostman workspace namen/an/a
spec-idUploaded Postman spec IDn/an/a
baseline-collection-idBaseline collection IDn/an/a
smoke-collection-idSmoke collection IDn/an/a
contract-collection-idContract collection IDn/an/a
collections-jsonJSON summary of generated collectionsn/an/a
prebuilt-collections-jsonDigest-bound JSON manifest of locally materialized Collection v3 trees (schemaVersion 1) for repo-sync reusen/an/a
openapi-operation-ledger-jsonSanitized local OpenAPI orchestration operation ledger (schemaVersion 1) with counts and timingsn/an/a
lint-summary-jsonJSON summary of validation findings. Bootstrap does not invoke an API-key-authenticated Postman CLI lint.n/an/a
breaking-change-statusOpenAPI breaking-change check statusn/an/a
breaking-change-summary-jsonJSON summary of the OpenAPI breaking-change checkn/an/a
sync-statusBranch-aware sync status: synced, skipped-branch-gate, or empty under branch-strategy legacy.n/an/a
branch-decisionSerialized BranchDecision JSON for downstream actions (also exported as POSTMAN_BRANCH_DECISION).n/an/a
spec-version-tagNative Spec Hub version tag applied on this canonical publish (tag-per-publish), empty when tagging was skipped (no-op sync, non-canonical run, or legacy client).n/an/a
spec-version-urlReserved for the repo-sync finalizer; bootstrap does not tag before complete onboarding.n/an/a
spec-content-changedWhether bootstrap changed canonical spec content; repo-sync uses this to skip native version tags on no-op syncs.n/an/a

Regenerate both tables from action.yml with npm run docs:tables.

CLI usage (non-GitHub CI)

The same bootstrap is available as a CLI for GitLab CI, Bitbucket Pipelines, Azure DevOps, and other CI systems. GitHub Actions users should continue using the action.yml interface.

npm install -g @postman/onboarding-bootstrap

postman-bootstrap \
  --project-name core-payments \
  --spec-url https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml \
  --postman-api-key "$POSTMAN_API_KEY" \
  --postman-access-token "$POSTMAN_ACCESS_TOKEN" \
  --result-json bootstrap-result.json \
  --dotenv-path bootstrap.env

The CLI package supports Node.js 24+ to match the GitHub Action runtime. It auto-detects the CI provider from environment variables for GitHub, GitLab, Bitbucket, and Azure DevOps, writes JSON to stdout, and sends all logs to stderr. Use --result-json to write the JSON payload to a file and --dotenv-path to emit shell-sourceable KEY=VALUE output with the POSTMAN_BOOTSTRAP_ prefix.

Example GitLab CI job:

bootstrap:
  image: node:24
  script:
    - npm install -g @postman/onboarding-bootstrap
    - postman-bootstrap --project-name core-payments --spec-url "https://raw.githubusercontent.com/postman-cs/postman-bootstrap-action/main/examples/core-payments-openapi.yaml" --postman-api-key "$POSTMAN_API_KEY" --postman-access-token "$POSTMAN_ACCESS_TOKEN" --result-json bootstrap-result.json --dotenv-path bootstrap.env
  artifacts:
    paths:
      - bootstrap-result.json
      - bootstrap.env

The same command works verbatim on any Node 24 runner: Bitbucket Pipelines with a node:24 image, or Azure DevOps after a NodeTool@0 step with versionSpec: '24.x'.

Self-contained binary (no npm / no Node)

For CI that cannot install npm or Node — locked-down Jenkins, bare Bitbucket agents, boxes with no package-registry access — a single self-contained executable is published as a GitHub Release asset. It bakes the Node runtime and the full bundle into one file, so the target needs no npm, no Node install, and no package-registry access. It is not network-isolated: the run still needs outbound access to the Postman API/gateway.

VERSION=2.9.10
curl -fsSL -o postman-bootstrap \
  "https://github.com/postman-cs/postman-bootstrap-action/releases/download/v${VERSION}/postman-bootstrap-${VERSION}-linux-x64"
chmod +x postman-bootstrap

export POSTMAN_ACCESS_TOKEN="<minted-token>"
./postman-bootstrap --project-name core-payments --spec-path ./openapi.yaml --result-json bootstrap-result.json

Credentials resolve from a CLI flag, then the INPUT_* env var, then a plain POSTMAN_ACCESS_TOKEN / POSTMAN_API_KEY — so Jenkins withCredentials works with no flag. Access-token-only runs pull no extra tooling onto the agent as long as the two optional download paths stay off (their defaults): postman-api-key enables lint (installs the Postman CLI via curl), and breaking-change-mode with a comparison source downloads the pb33f/openapi-changes tarball. Current target is linux-x64. Full runbook, credential minting, the Postman host allowlist, and a Jenkins pipeline: Self-contained binary.

How it works

The action handles the bootstrap slice of the Postman onboarding workflow: create or reuse a Postman workspace, assign governance, invite the requester and workspace admins, upload or update the spec in Spec Hub, lint it with the Postman CLI, convert OpenAPI locally into baseline, smoke, and contract collections (whole-collection import or in-place deep-update with scripts already embedded), apply tags, and reuse committed .postman/resources.yaml state when present. Inputs and outputs use kebab-case.

  • Phase independence: bootstrap succeeds on its own even when later pipeline stages fail, and reruns reuse existing assets. See Bootstrap Phase Independence.
  • Team identity: the team ID is resolved from the access-token session identity; org-mode tenants pass workspace-team-id. See Team Identity.
  • Git providers: workspace-to-repository linking supports GitHub and GitLab, cloud and self-hosted. See Git Provider Support.
  • Spec handling: operation summaries are normalized before upload, spec-url fetches are SSRF-hardened HTTPS with pinned DNS, and breaking-change comparison runs before any Postman mutation when enabled. See OpenAPI Spec Handling.
  • Lifecycle modes: collection-sync-mode (refresh/version, legacy reuse), spec-sync-mode (update/version), release-label derivation, ref-native state, local conversion → repo v3 artifacts → classic sync import/deep-update (canonical spec upload remains in Spec Hub; path-only pre-link when spec-path exists), and smoke monitoring. See Lifecycle Modes and Operational Reference.
  • Credentials: postman-access-token authenticates every identity and asset operation; the optional postman-api-key is used only to preflight the mint credential with GET /me and mint or re-mint that token. See Obtaining Credentials.
  • Protocol write path: GraphQL and SOAP transform their v2 models into v3 Extensible Collections; gRPC builds the same format natively. Every protocol writes through the access-token EC API and fails fast with EC_REQUIRES_ACCESS_TOKEN when no access token can be obtained. See Multi-Protocol Contract Assertions.

Dynamic contract tests

Before any durable contract collection is overwritten, the action hardens the generated [Contract] collection against the resolved OpenAPI 3.0/3.1 document: it bundles and validates the spec, requires exactly one generated request per eligible operation, instruments each request with OpenAPI-derived runtime checks (status codes, headers, body presence, Content-Type, JSON schemas, security credential presence, request parameter and body values), and enforces script safety and size gates. Spec updates capture the previous content hash so failed runs can roll back, and refresh mode stages generated collections before touching durable ones.

Full pipeline, validation scope, OpenAPI semantics, limits, and rollback behavior: Dynamic Contract Tests. The user-facing inventory — exact test names per protocol, the RFC each check enforces, and what to do when one fails — is in Generated Assertions.

Enforcement layers and error codes

The action enforces the OpenAPI contract at bootstrap time and inside the CI collection run. The full architecture is in Contract Enforcement Layers.

LayerWhenEffect
Static document lintsBootstrapWarnings only: spec-shape defects and runtime-coverage disclosures, logged and never fatal
Runtime contract testsEvery CI collection runpm.test() pass/fail against the live response
flowchart LR
    SPEC["OpenAPI spec"] --> IDX["buildContractIndex()"]
    IDX --> LINT["static lints -> warnings<br/>in the bootstrap log"]:::warn
    IDX --> OPS["structured contract"]
    OPS --> TESTS["pm.test() scripts injected<br/>into generated collections"]:::inject
    TESTS --> RUN["postman collection run<br/>(repo-sync CI workflow)"]
    RUN --> LIVE["live API or mock<br/>pass/fail per assertion"]:::inject
    classDef warn fill:#7f1d1d,color:#fff,stroke:#ef4444
    classDef inject fill:#14532d,color:#fff,stroke:#4ade80

Static lints catch the spec lying (a HEAD operation declaring a body, a 304 on a POST); runtime tests catch the server lying (a 200 where only 201 is declared, a body that fails its schema). Bootstrap-time failures use CONTRACT_* codes and stop the run before durable collections are overwritten; warnings are logged and never gate the run.

Representative codes:

Error codeLayerEffectMeaning
CONTRACT_SPEC_VALIDATION_FAILEDSpec loadingFails the runThe bundled document failed OpenAPI validation
CONTRACT_OPERATION_COVERAGE_FAILEDInstrumentationFails the runGenerated collection did not cover every eligible operation
CONTRACT_HEAD_RESPONSE_BODYStatic lintWarningA HEAD operation declares response content (RFC 9110)
CONTRACT_SCHEMA_NOT_COMPILEDDisclosureWarningOne schema could not be compiled; its runtime check is skipped and disclosed

The complete catalog of all 142 codes, grouped by layer with per-code remediation, is in Contract Error Codes.

Resources

Local development: npm install, npm test, npm run typecheck, npm run build (produces the committed dist/ bundles used by action.yml).

Telemetry

The action sends one anonymous usage event per run (action name/version, outcome, coarse CI metadata; never secrets, spec content, or repo names). Disable with POSTMAN_ACTIONS_TELEMETRY=off or DO_NOT_TRACK=1; route events to your own collector with POSTMAN_ACTIONS_TELEMETRY_ENDPOINT.

License

MIT

Keywords

github-action

FAQs

Package last updated on 25 Aug 2026

Related posts