Masking APIsErrors & Limits

Masking Errors & Limits

All error responses, HTTP status codes, and payload limits for Protecto Masking APIs.

All Masking APIs (Mask with Token, Mask with Format, Identify and Mask, Mask with Policy, Mask with Attributes) share the same error format and limits.

Error response format

All masking errors return a consistent structure:

{
  "data": null,
  "success": false,
  "error": {
    "message": "Payload is empty"
  }
}
FieldTypeDescription
successbooleanAlways false for errors
datanullAlways null for errors
error.messagestringHuman-readable error description

Error messages by category

HTTP statusError messageWhen it occurs
400Payload is emptyRequest body is empty or mask array is empty
400mask data missingThe mask key is missing from the request body
400Missing valueOne or more mask[].value fields are empty
400Missing token_nameThe token_name field is empty or not provided

Limits

ConstraintValue
Maximum masked output length600 characters
Trial token creation limit1,000 masked values
Rate limitsPlan-based (enforced on all tiers)

The 600-character limit applies to the masked output, not just the input. Split large inputs into smaller values before masking.

Retry behavior

HTTP statusScenarioRecommended action
400Validation or input errorDo not retry — fix the request
403Trial subscription exhaustedUpgrade subscription
500Internal failure after retriesRetry with exponential backoff or contact support

Masking is deterministic. Retrying the same request does not create duplicate or inconsistent tokens.

Best practices

  • Validate request payloads before sending — check that mask, value, token_name, and format fields are populated
  • Keep masked outputs under 600 characters by splitting long inputs
  • Handle trial subscription exhaustion gracefully with clear user-facing messaging
  • Log error messages exactly as returned for support and debugging