/api/v1/transform/redactRedact secrets API
Strip emails, IPs, tokens, keys, JWTs, UUIDs.
POST /api/v1/transform/redact strips secrets from markdown — emails, IPs, bearer tokens, AWS/Stripe/GitHub keys, JWTs, UUIDs, phones, credit cards. Categories are opt-in; counts are returned.
Overview
Heuristic redaction of common sensitive patterns. Each category is opt-in: emails, IPv4, bearer tokens, AWS access keys, Stripe secret keys, GitHub tokens, JWTs, UUIDs, phone numbers, credit card numbers. Counts per category are returned.
Request
Authenticate with Authorization: Bearer YOUR_API_KEY and send a JSON body containing the parameters below. Pick your language:
curl -X POST 'https://trymarkdownviewer.com/api/v1/transform/redact' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown":"Contact: ada@example.com (Bearer abc123abc123)"}'Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| markdown | string | required | Markdown source. |
| categories | RedactionCategory[] | optional | Categories to redact. Defaults to common secret patterns. |
Response
Success responses are wrapped in a data field. Errors use { error: { code, message } } with an appropriate HTTP status — see the error reference.
{
"data": {
"text": "Contact: [REDACTED:email] ([REDACTED:bearer])",
"replacements": 2,
"perCategory": {
"email": 1,
"bearer": 1,
"ipv4": 0,
"aws-key": 0,
"stripe-secret": 0,
"github-token": 0,
"jwt": 0,
"uuid": 0,
"phone": 0,
"credit-card": 0
}
}
}Use cases
AI prompt prep
Scrub secrets before sending content to an LLM.
Public docs
Pre-flight check before publishing internal-flavoured docs.
Related endpoints
Try in browser
Free tools that run the same logic locally — no API key, no upload.
Try it
Send a real request against your account in the API playground. Errors there link straight back to the error reference.