-
Notifications
You must be signed in to change notification settings - Fork 0
Error Codes
Nick edited this page Nov 27, 2025
·
1 revision
Complete reference for all error codes returned by Masker API.
Request successful.
Invalid request format or validation error.
Common Errors:
- Missing
textorjsonfield - Empty
textfield - Invalid
modevalue (must be "mask" or "placeholder") - Invalid
entitiesvalues - Both
textandjsonprovided
Request body exceeds size limit.
Limits:
- Text field: 32KB
- Total JSON payload: 64KB
Unexpected server error.
import requests
import time
def redact_with_retry(text, max_retries=3):
url = "https://masker.kikuai.dev/v1/redact"
headers = {"Content-Type": "application/json"}
data = {"text": text, "mode": "placeholder"}
for attempt in range(max_retries):
try:
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
return response.json()
elif response.status_code == 413:
raise ValueError("Text is too large. Maximum 32KB.")
else:
response.raise_for_status()
except requests.exceptions.RequestException as e:
if attempt == max_retries - 1:
raise
time.sleep(2 ** attempt)
raise Exception("Max retries exceeded")| Code | Meaning | Retry? | User Action |
|---|---|---|---|
| 200 | Success | No | Use response data |
| 400 | Bad Request | No | Fix request format |
| 413 | Payload Too Large | No | Reduce payload size |
| 500 | Server Error | Yes | Retry or contact support |
Last Updated: 2025-11-27