API Reference
Docs
Base URL https://api.sanitext.app
Quickstart
Sign up, copy your key from the dashboard, and call the API.
curl https://api.sanitext.app/v1/redact \
-H "Authorization: Bearer pf_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Contact John Doe at jdoe@example.com"}' Authentication
Pass your key as a Bearer token on every request. Keys are shown once at creation; rotate anytime from the dashboard.
Authorization: Bearer pf_live_… POST /v1/detect
Body: { "text": "...", "threshold": 0.5 }. Returns spans with byte offsets.
{ "entities": [
{ "label": "EMAIL", "start": 20, "end": 36,
"score": 0.99, "text": "jdoe@example.com" } ],
"count": 1, "ms": 31 } POST /v1/redact
Same body; returns the text with each span replaced by [LABEL].
{ "redacted": "Contact [FIRSTNAME] [LASTNAME] at [EMAIL]",
"entities": [ … ], "count": 3, "ms": 28 } Entity labels
FIRSTNAMELASTNAMEEMAILPHONEADDRESSDATEURLACCOUNTSECRET
Coverage varies by language; verify against your data before production use.
Errors
| 400 | invalid_json / missing_text | Body is not valid JSON or has no "text" string. |
| 401 | invalid_api_key | Missing/invalid Bearer token, or the key was revoked. |
| 413 | text_too_large | Input exceeds 1 MiB. |
| 429 | quota_exceeded | Monthly character quota reached — upgrade your plan. |
| 502 | engine_unavailable | Transient engine error — retry with backoff. |
Rate limits & quotas
Quotas are a rolling 30-day character cap per plan. Requests over the cap return
429. Max request size is 1 MiB. Short inputs return in <1s; very large
documents are slower — use the async bulk endpoint on Scale/Enterprise.