Example request:
Example response:
JSON
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
X-Enkrypt-Mode.import requests
import json
import os
import base64
# Read and encode PDF file
with open("document.pdf", "rb") as f:
file_base64 = base64.b64encode(f.read()).decode("utf-8")
url = "https://api.enkryptai.com/guardrails/policy/scan-pdf"
payload = json.dumps({
"file": file_base64
})
headers = {
'Content-Type': 'application/json',
'apikey': os.getenv('ENKRYPTAI_API_KEY'),
'X-Enkrypt-Policy': 'my-policy'
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
from enkryptai_sdk import *
import base64
client = GuardrailsClient(api_key="YOUR_API_KEY")
# Read and encode PDF file
with open("document.pdf", "rb") as f:
file_base64 = base64.b64encode(f.read()).decode("utf-8")
result = client.policy_scan_pdf("my-policy", file_base64)
print(result)
{
"summary": {
"policy_violation": 0,
"injection_attack": 0
},
"details": {
"total_pages": 1,
"pages_with_detections": 0,
"detections": []
}
}
