CRMcy Docs

OpenAPI

How to use the openapi.json spec for code generation and CI.

Last updated 2026-05-05

CRMcy publishes a complete OpenAPI 3.1 specification of the public API. In a running api service with ENABLE_SWAGGER=1, the spec is at /api/docs-json (raw JSON) and the interactive UI at /api/docs. The docs site checks in a static snapshot at apps/docs/public/openapi.json that's refreshed nightly by CI; you can fetch it directly at https://docs.crmcy.app/openapi.json.

Common downstream uses: generating typed client libraries with openapi-typescript-codegen or openapi-generator-cli, contract tests in CI (compare your client's expectations against the spec), and seeding Postman / Insomnia collections.

Generating a typed client

npx openapi-typescript https://docs.crmcy.app/openapi.json -o ./crmcy-types.ts

Refreshing the local snapshot

The pnpm --filter @crmcy/docs sync-openapi script fetches ${API_URL}/api/docs-json and writes it to apps/docs/public/openapi.json. Set API_URL to the environment you're targeting (defaults to http://localhost:4000).

Stability

The spec is versioned alongside the api service. Breaking changes are flagged in the Changelog and a deprecation header (Sunset: <date>) lands on affected endpoints at least 90 days before removal.