> For the complete documentation index, see [llms.txt](https://help.nightfall.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.nightfall.ai/developer-api/key-concepts/text_scan.md).

# Scanning Text

The `scan` endpoint allows you to apply Policies and Detection Rules to a list of text strings provided as a `payload`.

```sh
curl --request POST \
     --url https://api.nightfall.ai/v3/scan \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer  NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
     --header 'Content-Type: application/json' \
     --data '
{
     "policy": {
          "detectionRules": [
               {
                    "detectors": [
                         {
                              "minNumFindings": 1,
                              "minConfidence": "LIKELY",
                              "displayName": "US Social Security Number",
                              "detectorType": "NIGHTFALL_DETECTOR",
                              "nightfallDetector": "US_SOCIAL_SECURITY_NUMBER"
                         }
                    ],
                    "name": "My Match Rule",
                    "logicalOp": "ANY"
               }
          ]
     },
     "payload": [
          "The customer social security number is 458-02-6124",
          "No PII in this string"
     ]
}
```

You may use[ Pre-Configured Detection Rules](/developer-api/key-concepts/scanning_features/pre_configured_detection_rules.md) or [Create Inline Detection Rules](/developer-api/key-concepts/scanning_features/inline_detection_rules.md)

Text scanning supports the use of[ Exclusion Rules](/developer-api/key-concepts/scanning_features/exclusion_rules.md),[ Context Rules](/developer-api/key-concepts/scanning_features/context_rules.md), and [Redaction](https://docs.nightfall.ai/docs/using-redactions)[ ](/developer-api/key-concepts/scanning_features/redaction.md)as well as other [Scanning Features](https://docs.nightfall.ai/docs/scanning-features).

For scanning files, see [Scanning Files](/developer-api/key-concepts/file_scan.md).

Note that you must generate an[ API key ](/developer-api/key-concepts/setup/api_key.md)to send requests to the Nightfall API.
