---
title: "Content scan"
method: POST
path: "/v1/scan"
tags: ["Scan Methods"]
---

# Content scan

`POST /v1/scan`

Scan provided document content for policy breaks.

Request body shouldn't exceed 1MB.

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

## Request body

- object
  - `filename` string
  - `document` string, required

## Response `200`

Successful Scan

- object — Result of a content scan.
  - `policy_break_count` integer, required — Number of policy breaks on this document.
  - `policies` string[], required — Policies checked on this document.
  - `policy_breaks` object[], required — List of policy breaks.
    - `type` string, required — Type of detected policy.
    - `policy` string, required — Name of failing policy.
    - `validity` 'no_checker' | 'valid' | 'invalid' | 'failed_to_check' | 'unknown', nullable — Validity of the found secret.
    - `matches` object[], required — List of secret matches.
      - `type` string, required — Type of match
      - `match` string, required — Matched string of failure
      - `line_start` integer — start line number of match (index origin = 1)
      - `line_end` integer — end line number of match (index origin = 1)
      - `index_start` integer — start index of match in file as an array (index origin = 0)
      - `index_end` integer — end index of match in file as an array (index origin = 0)
    - `known_secret` boolean — Indicates whether the secret is known by your GitGuardian dashboard.
    - `incident_url` string — The incident's URL on your GitGuardian dashboard, if it is a known secret, or an empty string otherwise.
  - `is_diff` boolean, required — Indicates whether the document is a diff.

## Other responses

- `400` — Invalid data
- `401` — Invalid API key
- `403` — Quota limit reached
- `503` — API under maintenance

---

[API](https://skmtc.net/gitguardian/apis/gitguardian-api.md) · [All operations](https://skmtc.net/gitguardian/apis/gitguardian-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitguardian/gitguardian-api/revisions/511b067cdcb1/schema)
