OpenAPI
Autogenerate an OpenAPI specification from a Payload CMS instance and render it with Swagger UI, Redoc, RapiDoc, or Scalar.
Installation
pnpm add payload-oapi About
The plugin walks your Payload config and emits a complete OpenAPI spec covering collection CRUD, global CRUD, auth operations, preferences, and custom endpoints. It supports both OpenAPI 3.0 and 3.1 output, down-converting from 3.1 when needed. The spec is served from a configurable endpoint, `/api/openapi.json` by default. Auth collections are documented according to their auth config. `disableLocalStrategy` drops the password operations, `loginWithUsername` changes the login body shape, `maxLoginAttempts: 0` removes `/unlock`, and enabling `verify` adds `/verify/{id}`. Custom endpoints declared via `endpoints` on a collection, global, or the config root are picked up when they carry an OpenAPI operation under `custom.openapi`; the generator fills in `tags`, `operationId`, `summary`, and `security` for anything you omit. You can filter which collections and globals appear using `includeCollections`, `excludeCollections`, `includeGlobals`, `excludeGlobals`, and `hideInternalCollections`. An `apiBasePath` option lets you override the path prefix for generated operations, useful when the API sits behind a reverse proxy under a different prefix. For browsing, the package ships separate UI plugins for Scalar, Swagger UI, RapiDoc, and Redoc. Add one alongside the core `openapi` plugin and the docs become available at `/api/docs`. The package targets Payload CMS 3.x and is written in TypeScript.
Package info
- Package name
payload-oapi- Latest version
0.3.0- Unpacked size
- 187 kB
- License
- MIT
- Weekly downloads
- 14.7k
- Last publish
- Sep 18, 2026
Similar plugins
More in DevtoolsPuck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Create Ideal CMS
Interactive CLI that scaffolds a production-ready Payload CMS monorepo preconfigured with FocusReactive plugins.
Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.
Repository
Wrapper around Payload's Local API providing repository operations.
Markdown documentation sync
Syncs Markdown documentation with Payload CMS using Git.