# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.nightfall.ai/developer-api/key-concepts/text_scan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
