Scan Plain Text

Scan Plain Text

Provide a list of arbitrary string data, and scan each item with the provided detectors to uncover sensitive information. Returns a list equal in size to the number of provided string payloads. The item at each list index will be a list of all matches for the provided detectors, or an empty list if no occurrences are found.

POSThttps://api.nightfall.ai/v3/scan
Authorization
Body
policyUUIDsarray of string

A list of UUIDs referring to policies to use to scan the request payload. Policies can be built in the Nightfall Dashboard. Maximum 1.

policyobject

Policy can contain a list of pre-configured detection rule UUID's and/or a list of inline detection rules with which to scan the request payload. At least one list must be non-empty.

payloadarray of string

The text sample(s) you wish to scan. This data is passed as a string list, so you may choose to segment your text into multiple items for better granularity. The aggregate size of your text (summed across all items in the list) must not exceed 500 KB for any individual request, and the number of items in that list may not exceed 50,000.

Response

Success

Headers
Body
findingsScanResponseV3Array (array of EachItemV3Array (array of FindingV3 (object)))

A list of all findings that were detected in the request payload. Each item in the list is a list of all findings that occurred at the corresponding list index from the input payload.

redactedPayloadarray of string

A list containing the the redacted version of each string in the input payload. If no redactions were applied, the corresponding string will be empty.

Request
const response = await fetch('https://api.nightfall.ai/v3/scan', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "findings": [
    [
      {
        "finding": "text",
        "redactedFinding": "text",
        "beforeContext": "text",
        "afterContext": "text",
        "detector": {
          "name": "text",
          "uuid": "123e4567-e89b-12d3-a456-426614174000",
          "subdetector": {
            "name": "text",
            "uuid": "123e4567-e89b-12d3-a456-426614174000"
          }
        },
        "confidence": "VERY_UNLIKELY",
        "location": {
          "byteRange": {},
          "codepointRange": {}
        },
        "redactedLocation": {
          "byteRange": {},
          "codepointRange": {}
        }
      }
    ]
  ],
  "redactedPayload": [
    "text"
  ]
}

Last updated