Skip to content

Open source by Apideck

Portman: Contract testing
for OpenAPI

Turn your spec into a tested Postman collection. Run it in CI. Catch API drift before launch.

GitHub
685
stars
20.7K
weekly installs
27
contributors
$ npx @apideck/portman -l openapi.yaml -c portman-config.json \    --runNewman -b http://localhost:3000 → List leads  GET http://localhost:3000/crm/leads [200 OK, 1.2kB, 84ms]  ✓  [GET]::/crm/leads - Status code is 2xx  ✓  [GET]::/crm/leads - Content-Type is application/json  ✗  [GET]::/crm/leads - Schema is valid       data[0].email: must be string (got null)  ✓  [GET]::/crm/leads - Response time is less than 300ms   Collection run encountered failures.  Failed assertions: 1; Failures: 1  # exit code 1 → the CI job fails

Running in CI at

Built for APIs that keep their promises

Everything between your OpenAPI spec and a green build.

contract.feature
GET /crm/leads4/4
Status code is 2xx
Content-Type is JSON
Schema is valid
Response < 300ms

Contract tests, generated

Status, content type, JSON body, schema validation and response time for every operation — derived from your spec.

variations.feature
missing required "email"400
"status": "unknown" (enum)422
"limit": -1 (minimum)400
no Authorization header401

Variations & fuzzing

Send invalid, missing and out-of-range inputs on purpose and assert your API rejects them correctly.

ci.feature
pull_request #482
checkout
api up
portman
merge
exit code0 → ready to merge

Gate every pull request

Runs with Newman in any pipeline. A failed assertion exits with code 1, so drift never reaches main.

sync.feature
Postman workspacesynced
collection
CRM API · contract tests
--syncPostman

Postman sync

Push the generated collection straight to your Postman workspace with one flag. Optional, never required.

+ Overwrites+ Assign variables+ Content tests+ Pre-request scripts+ Operation filtering+ Postman globals

Watch it in action

From spec to failing build in four steps.

openapi.yaml
openapi: 3.0.3info:  title: CRM API  version: 1.0.0paths:  /crm/leads:    get:      operationId: leadsAll      summary: List leads      responses:        '200':          description: Leads          content:            application/json:              schema:                $ref: '#/components/schemas/GetLeadsResponse'    post:      operationId: leadsAdd      summary: Create lead

In orbit

Public projects running Portman in CI. Every row links to the workflow or config that proves it.

adoption.live
Public repositories · snapshot Oct 2026
ProjectRuns Portman forRepo starsLast pushSource
Tyk
TykTechnologies/tyk
API gateway spec tests★ 10.9KOct 31, 2026source
PostgresAI
postgres-ai/database-lab-engine
DBLab API Postman collection★ 2.8KNov 11, 2026source
jsDelivr
jsdelivr/globalping
Contract tests in CI★ 623Oct 30, 2026source
VTEX
vtex/openapi-schemas
Public OpenAPI schemas★ 118Oct 30, 2026source
Terminal
terminal-api/postman
Public Postman collection—Oct 30, 2026source
Ed-Fi
Ed-Fi-Alliance-OSS/Ed-Fi-API-Specifications
Auto-generated API tests★ 4Oct 29, 2026source
Radix DLT
radixdlt/babylon-gateway
Gateway API CI★ 16Sep 7, 2026source
Twikey
twikey/development-kit
Release pipeline★ 10Apr 1, 2026source
Fraunhofer-Chalmers Centre
FraunhoferChalmersCentre/real-estate-api
Real-estate API contract tests—Sep 1, 2025source

Ready for your coding agent

Let agents write configs and run contract tests — then hold their code to your spec.

portman.skill

Agent skill

Teach Claude Code, Cursor and other agents how to configure and run Portman.

$ npx skills add apideck/api-skills --skill apideck-portman
portman.mcpsoon

MCP server

Agents generate collections, maintain your Portman config and explain failing contract tests — over MCP.

MCP server Agent workflows

The crew

Portman is built in the open by 25 contributors. Thank you for every issue, fix and feature.

  • @thim81
  • @nicklloyd
  • @Gdewilde
  • @George-lewis
  • @jpjpjp
  • @tillig
  • @janbrasna
  • @jackdclark
  • @AliKhalili
  • @schelv
  • @gvych
  • @clement-hvt
  • @vinh0604
  • @yndo97
  • @nflcosta
  • @miriamgreis
  • @Matt2212
  • @mwalczyk81
  • @margaritluch
  • @Marcus-Karl
  • @jbrinkman
  • @Ibmurai
  • @danielkocot
  • @cguy
  • @bvigerzi

Questions

Everything you need before liftoff.

What is Portman?

Portman is an open-source CLI by Apideck that converts an OpenAPI document into a Postman collection and injects contract tests, variation tests and fuzzing tests. It can run the collection with Newman, so you can validate a live API against its spec from your terminal or CI pipeline.

Is Portman free?

Yes. Portman is open source under the Apache 2.0 license and free for commercial use.

Do I need a Postman account?

No. Portman generates a standard Postman collection file and runs it locally with Newman. Uploading to a Postman workspace with --syncPostman is optional and only needs a Postman API key if you choose to use it.

What does a contract test check?

Out of the box: success status codes, Content-Type, the presence of a JSON body, JSON Schema validation of the response against your spec, required headers and response time. You enable each check per operation or with wildcards in portman-config.json.

How do I run Portman in CI?

Run npx @apideck/portman -l openapi.yaml --runNewman -b <base-url> as a step in GitHub Actions, GitLab CI or any pipeline after your API starts. When any assertion fails, Portman exits with code 1, so contract drift fails the job and blocks the merge.

Can I go beyond schema checks?

Yes. Content tests assert on specific response values, overwrites change request bodies, headers and query params, assignVariables chains requests together, and variation and fuzzing tests exercise error handling with invalid inputs.

How is Portman different from Postman’s own OpenAPI import?

Postman’s import gives you requests. Portman gives you requests plus generated, maintainable tests, driven by a config file you keep in version control and regenerate every time the spec changes.

Launch your first contract test

One command. No account. Apache 2.0.

Read the docs
quickstart.sh
# 1. Generate a collection with contract testsnpx @apideck/portman -l ./openapi.yaml -o ./collection.json # 2. Or generate and run against your API in one gonpx @apideck/portman -l ./openapi.yaml --runNewman -b http://localhost:3000 # 3. Set up CLI options interactivelynpx @apideck/portman --init