Commit Message Linter & Changelog API

Lint commit messages against Conventional Commits, build a CHANGELOG from git log and compute the next semantic version, with fix suggestions.

GETPOSThttps://apibox.io.vn/v1/commit-lint
Developer utilities▶ Try it online

Three actions on one endpoint. lint checks one message, a list of commits or pasted git log output against Conventional Commits 1.0.0 with the rules of the popular config-conventional preset (type enum and case, scope case, subject case and full stop, header / body line length, blank lines, BREAKING CHANGE footers) or the stricter angular preset; customise with types, scopes, header_max, require_scope. Merge, revert and fixup commits are skipped. Every invalid message gets a corrected suggestion (synonyms such as feature → feat, past tense → imperative).

changelog groups commits into BREAKING CHANGES, Features, Bug Fixes, Performance and Reverts (all_types=1 adds docs, refactor, CI…), links issues and commits when you pass repo_url (GitHub or GitLab), and writes English or Vietnamese headings (lang=vi). bump returns the next version from current_version (breaking → major, feat → minor, fix / perf → patch; 0.x versions bump minor for breaking changes unless pre_major=0; prerelease=beta for pre-releases).

Accepted log formats: default git log, git log --oneline, or messages separated by ---. No configuration files are executed: everything is passed as parameters. Use it in GitLab / Bitbucket / Gitea pipelines, chat bots or release scripts without installing Node tooling.

Markdown · OpenAPI · Postman · llms.txt

Parameters

NameInTypeRequiredDefault
actionbody|querystringnolintlint, changelog or bump (also as path: /v1/commit-lint/changelog; alias mode).
messagebody|querystringnoOne commit message (header, body, footers).
commitsbodyarraynoMessages as strings or {hash, message} objects (max 2000).
logbodystringnoPasted git log / git log --oneline output.
presetbody|querystringnoconventionalconventional (config-conventional) or angular.
typesbody|querystringnoComma-separated allowed types (replaces the preset list).
scopesbody|querystringnoComma-separated allowed scopes.
header_maxbody|querynumberno100Maximum header length (angular: 72).
require_scopebody|querybooleannoRequire a scope.
current_versionbody|querystringnoCurrent version for bump / changelog, e.g. 1.4.2 or v1.4.2.
prereleasebody|querystringnoPre-release identifier, e.g. beta.
repo_urlbody|querystringnohttps://github.com/owner/repo (or GitLab) for issue / commit / compare links.
versionbody|querystringnoChangelog version heading (default: computed next version or "Unreleased").
langbody|querystringnoenen or vi group headings.
all_typesbody|querybooleannoInclude docs / refactor / test / build / CI / chore groups.

Example

curl -X POST "https://apibox.io.vn/v1/commit-lint" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Fixed login redirect."}'

Response

{
  "valid": false,
  "commits": 1,
  "invalid": 1,
  "ignored": 0,
  "config": {
    "preset": "conventional",
    "types": [
      "build",
      "chore",
      "ci",
      "docs",
      "feat",
      "fix",
      "perf",
      "refactor",
      "revert",
      "style",
      "test"
    ],
    "scopes": null,
    "header_max": 100
  },
  "results": [
    {
      "header": "Fixed login redirect.",
      "valid": false,
      "parsed": {
        "type": null,
        "scope": null,
        "subject": null,
        "breaking": false
      },
      "issues": [
        {
          "rule": "type-empty",
          "severity": "error",
          "message": "No type: the header must start with a type such as feat, fix, docs (\"type(scope): subject\")"
        },
        {
          "rule": "subject-empty",
          "severity": "error",
          "message": "No subject after \"type: \""
        }
      ],
      "suggestion": "fix: login redirect"
    }
  ],
  "spec": "https://www.conventionalcommits.org/en/v1.0.0/"
}

Use cases

  • Reject non-conventional commit messages in a GitLab or Bitbucket pipeline
  • Generate release notes from the commits since the last tag
  • Compute the next semantic version in a deploy script
  • Show contributors a corrected commit message in a review bot

FAQ

Which rules are applied?

The rule set of @commitlint/config-conventional (type, scope, subject, header and body length, blank lines) re-implemented server-side, or the angular preset; types, scopes and lengths can be customised.

How is the next version decided?

Any breaking change (! or a BREAKING CHANGE footer) → major, any feat → minor, fix / perf / revert → patch, otherwise no release. Versions below 1.0.0 bump minor for breaking changes by default.

Can it read my repository?

No: paste the output of git log (or send the messages). Nothing is stored.

Related APIs

Start with 1,000 free requests every month. Get free API key →