Quickstart
Last updated
Was this helpful?
Last updated
Was this helpful?
The Document will guide you in making your first API request.
This page will get you up and running with the Nightfall API so you can start scanning for sensitive data.
The Nightfall API requires a valid API key to authenticate your API requests.
You can create API keys in the .
Learn more about .
Below is an example request to the scan endpoint.
To run this example yourself, replace the API key (NF-rEpLaCe...
) with the one you created in the dashboard or set it as the environment variable NIGHTFALL_API_KEY
as necessary.
The cURL example may be run from the command line without any additional installation. To run the example, you will need to download the corresponding SDK.
The Policy (policy
) you define indicates what to scan for in your payload with a logical grouped (ANY or ALL) set of Detection Rules (detectionRules
).
Detection Rules can be defined two ways:
In the example above, two of Nightfall's native Detectors are being used: US_SOCIAL_SECURITY_NUMBER
and CREDIT_CARD_NUMBER
.
In the payload body, you can see that we are submitting a list of three different strings to scan (payload
). The first will trigger the U.S. Social Security Detector. The last will trigger the credit card Detector. The middle example will trigger neither.
The Nightfall API returns a response with an array (findings
) with a length that corresponds to the length of the payload array. In this example, only the first and last items in the request payload triggered the Detectors, so the second element of the array is empty.
In the first element of the array, you can see details about which Detection Rule was triggered and the data that was found (finding
). The response also provides a confidence level (confidence
), as well as the location within the original text where the data was found either in terms of bytes (byteRange
) or characters (codepointRange
).
Congratulations! You have successfully completed the Nightfall Quickstart.
You can modify the Detectors or payload in the example request to get more practice with the Nightfall API.
i, as shown above
in the Nightall app, which you will then .
Learn more about in the Nightfall app to create your own Detectors, Detection Rules, and Policies. See for an example as to how to execute queries using an existing Detection Rules UUID.
You can find a full list of native Detectors in the .
If you don't want to create your Detectors, Detection Rules, and Policies in the Nightfall app, but would prefer to do it in code, it is possible to define with your own regular expressions or word list as well as extend our native Detectors with and rules.
When defining a Detection Rule, you configure the minimum(minConfidence
) and minimum number of times the match must be found (minNumFindings
) for the rule to be triggered.
Another feature Nightfall offers is the ability to sensitive findings. Detectors may be configured (via redactionConfig
) to replace the text that triggered them with a variety of customizable masks, including an encrypted version of the text.