latestOpenAPI 3.0.3GitGuardian2026-08-201871515.0 MB

511b067cdcb1

Scan Methods

Multiple content scan

Scan provided document contents for policy breaks. Multiple documents are returned by the same index order.

There should not be more than 20 documents in the payload. Individual documents should not exceed 1MB.

Quota usage is based on requests and not on the content size. One request to this endpoint will consume 1 API call. Also note that the quota is set on a rolling month and not on a calendar month. See this documentation for more details.

This endpoint is stateless and as such will not store in our servers neither the documents nor the secrets found.

post/v1/multiscan

Request body

filenamestring
documentstring required

Example request

[
  {
    "filename": ".env",
    "document": "import urllib.request\nurl = 'http://jen_barber:correcthorsebatterystaple@cake.gitguardian.com/isreal.json'\nresponse = urllib.request.urlopen(url)\nconsume(response.read())\n"
  },
  {
    "filename": "tasks.py",
    "document": "__version__=\"1.0.0\""
  }
]

Response

Successful Scan

policy_break_countinteger required

Number of policy breaks on this document.

policiesstring[] required

Policies checked on this document.

is_diffboolean required

Indicates whether the document is a diff.

Example response

[
  {
    "policy_break_count": 2,
    "policies": [
      "Filename",
      "File extensions",
      "Secrets detection"
    ],
    "policy_breaks": [
      {
        "type": ".env",
        "policy": "Filenames",
        "matches": [
          {
            "type": "filename",
            "match": ".env"
          }
        ]
      },
      {
        "type": "Basic Auth String",
        "policy": "Secrets detection",
        "validity": "cannot_check",
        "matches": [
          {
            "type": "username",
            "match": "jen_barber",
            "index_start": 52,
            "index_end": 61,
            "line_start": 2,
            "line_end": 2
          },
          {
            "type": "password",
            "match": "correcthorsebatterystaple",
            "index_start": 63,
            "index_end": 87,
            "line_start": 2,
            "line_end": 2
          },
          {
            "type": "host",
            "match": "cake.gitguardian.com",
            "index_start": 89,
            "index_end": 108,
            "line_start": 2,
            "line_end": 2
          }
        ]
      }
    ]
  },
  {
    "policy_break_count": 0,
    "policies": [
      "Filename",
      "File extensions",
      "Secrets detection"
    ],
    "policy_breaks": []
  }
]