Skip to main content
POST
/
guardrails
/
guardrail
/
scan-pdf
Scan PDF Using Guardrail
curl --request POST \
  --url https://api.enkryptai.com/guardrails/guardrail/scan-pdf \
  --header 'Content-Type: application/json' \
  --header 'X-Enkrypt-Guardrail: <x-enkrypt-guardrail>' \
  --header 'X-Enkrypt-Mode: <x-enkrypt-mode>' \
  --header 'apikey: <api-key>' \
  --data '
{
  "file": "<string>"
}
'
{
  "summary": {},
  "details": {
    "total_pages": 123,
    "pages_with_detections": 123,
    "detections": [
      {}
    ]
  }
}

Authorizations

apikey
string
header
required

Headers

X-Enkrypt-Guardrail
string
required

The guardrail name

Example:

"My Guardrail"

X-Enkrypt-Mode
enum<string>
required

Whether to apply input (prompt) or output (response) detectors

Available options:
prompt,
response
Example:

"prompt"

Body

application/json
file
string
required

Base64-encoded PDF file content.

Response

200 - application/json

Scan results for the provided PDF using the specified guardrail.

summary
object
required

Summary counts of detections by detector type.

details
object
required

Detailed scan results including page-level information.