Skip to content
HALOWERK

Codewerk

license headers

Reads the first lines of every source file (inline files, or up to 3000 files of a public repository or git bundle; languages and comment syntax from the scc language table, data and prose formats skipped). Validates SPDX-License-Identifier tags with spdx-expression-parse and compares them with the expected expression, recognises common license notices without SPDX tag (Apache-2.0, MIT, GPL/LGPL/AGPL "or later", MPL-2.0), checks SPDX-FileCopyrightText or Copyright lines and an optional.

POST https://code.halowerk.com/v1/license-headers

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
expected_licensestringYesExpected SPDX license expression, e.g. Apache-2.0 or MIT OR Apache-2.0.
filesarrayNoAlternative to a repository: files with content (at least the beginning).
repo_urlstringNoPublic HTTPS clone URL, e.g. https://github.com/owner/repo. No credentials, port 443 only; ssh/git/file URLs are rejected.
bundle_base64stringNoAlternative to repo_url: a git bundle (git bundle create repo.bundle --all), base64-encoded, up to about 180 KB.
refstringNoBranch or tag to analyse instead of the default branch.
require_copyrightbooleanNoReport files without a copyright line.
copyright_holderstringNoHolder that must appear in the copyright line.
includearrayNogitignore-style patterns (*, ?, **) limiting the files checked, e.g. src/ or *.ts.
excludearrayNogitignore-style patterns to skip, e.g. vendor/ or *.min.js.
max_header_linesintegerNoNumber of leading lines searched for the header.
max_filesintegerNoMaximum number of repository files checked.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "expected_license"
  ],
  "properties": {
    "expected_license": {
      "type": "string",
      "minLength": 2,
      "maxLength": 200,
      "description": "Expected SPDX license expression, e.g. Apache-2.0 or MIT OR Apache-2.0."
    },
    "files": {
      "type": "array",
      "minItems": 1,
      "maxItems": 300,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "content"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "content": {
            "type": "string",
            "maxLength": 100000
          }
        }
      },
      "description": "Alternative to a repository: files with content (at least the beginning)."
    },
    "repo_url": {
      "type": "string",
      "minLength": 12,
      "maxLength": 300,
      "pattern": "^https://\\S+$",
      "description": "Public HTTPS clone URL, e.g. https://github.com/owner/repo. No credentials, port 443 only; ssh/git/file URLs are rejected."
    },
    "bundle_base64": {
      "type": "string",
      "minLength": 24,
      "maxLength": 250000,
      "description": "Alternative to repo_url: a git bundle (git bundle create repo.bundle --all), base64-encoded, up to about 180 KB."
    },
    "ref": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
      "description": "Branch or tag to analyse instead of the default branch."
    },
    "require_copyright": {
      "type": "boolean",
      "default": true,
      "description": "Report files without a copyright line."
    },
    "copyright_holder": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Holder that must appear in the copyright line."
    },
    "include": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "description": "gitignore-style patterns (*, ?, **) limiting the files checked, e.g. src/ or *.ts."
    },
    "exclude": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "description": "gitignore-style patterns to skip, e.g. vendor/ or *.min.js."
    },
    "max_header_lines": {
      "type": "integer",
      "minimum": 3,
      "maximum": 100,
      "default": 25,
      "description": "Number of leading lines searched for the header."
    },
    "max_files": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3000,
      "default": 1000,
      "description": "Maximum number of repository files checked."
    }
  }
}

Open original schema

Published input example

{
  "expected_license": "MIT",
  "files": [
    {
      "path": "src/a.js",
      "content": "// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Acme\nexport const a = 1;\n"
    },
    {
      "path": "src/b.py",
      "content": "import os\n"
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’