Quickstart
Upload a PDF and download it with PHI removed
1. Create an API key
Sign in to the dashboard, open API Keys, and click Create new secret key. Save the key (it starts with sk_) somewhere safe; you won't be able to see it again.
export LYPE_API_KEY=sk_your_api_key2. Accept the Business Associate Agreement
Accept it once for your account, before uploading documents that contain PHI. Use the BAA page in the dashboard or the API:
curl -X POST https://api.lype.com/api/baa/accept \
-H "x-api-key: $LYPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"organizationName": "Acme Clinic", "signerName": "Jane Doe", "signerTitle": "Compliance Officer"}'See Business Associate Agreement.
3. Upload a PDF
curl -X POST https://api.lype.com/api/attachments \
-H "x-api-key: $LYPE_API_KEY" \
-F "file=@record.pdf;type=application/pdf"The response includes the attachment id. Processing starts immediately in the background:
{
"id": "f7831202-8c86-488f-8f32-35f09d9a1eeb",
"fileName": "record.pdf",
"status": "pending",
"progress": 0,
"downloadUrl": null,
...
}4. Wait for processing
Short documents usually finish within seconds; longer ones take longer. Either poll the download endpoint — it returns 409 until the redacted PDF is ready — or stream progress events.
curl -s -o /dev/null -w "%{http_code}\n" \
https://api.lype.com/api/attachments/$ID/download \
-H "x-api-key: $LYPE_API_KEY"
# 409 while processing, 200 when ready5. Download the redacted PDF
curl -OJ https://api.lype.com/api/attachments/$ID/download \
-H "x-api-key: $LYPE_API_KEY"This saves <id>-redacted.pdf.