# Scanning Files

Nightfall’s file scan API allows a user to upload a file in chunks, then to scan it with Detection Rules once the upload is complete.

The scan will then be processed asynchronously before sending the results to the webhook URL that is provided along with your Detection Rules.

The following sequence diagram illustrates the full process for scanning a binary file with Nightfall.

<figure><img src="/files/qHM4tVXIuLXN6dVVAygE" alt=""><figcaption></figcaption></figure>

For a detailed walkthrough of the API calls necessary to upload and scan a file and full script that shows the entire process, see [Uploading and Scanning Files](https://docs.nightfall.ai/docs/uploading-files)[.](/developer-api/key-concepts/file_scan/scan_api_calls.md)

### Prerequisites

In order to utilize the File Scanning API you need the following:

* An active API Key authorized for file scanning passed via the header `Authorization: Bearer <key>` — see [Authentication and Security](/developer-api/introduction/authentication_security.md)
* A Nightfall Detection Policy associated with a webhook URL
* A web server configured to listen for file scanning results (detailed information to follow)

File scanning also support Nightfall's functionality for [Using Exclusion Rules](/developer-api/key-concepts/scanning_features/exclusion_rules.md) and [Using Context Rules](/developer-api/key-concepts/scanning_features/context_rules.md) as part of your scan requests.


---

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