Format checks
Check email, phone and URL formats, including additional email-domain rules.
Validation · REST API
Validate a string against configurable format, length and security rules through one REST endpoint without modifying the original input.
Free tier available. This endpoint requires a JWT Bearer Token.
Check email, phone and URL formats, including additional email-domain rules.
Combine required, length and regular-expression checks in one request.
Detect potentially unsafe patterns with XSS and SQL injection checks.
Use the same endpoint with different rules to check email addresses and URLs. Email checks can also include disposable-domain and DNS-related rules.
Endpoint
POST /api/v1/data-protection/validateInput: application/json · Output: application/json
Input
{
"input": "test@gmail.com",
"rules": [
"REQUIRED",
"EMAIL",
"NO_DISPOSABLE_EMAIL",
"MX_EMAIL"
],
"failFast": false
}Output (when all rules pass)
{
"valid": true,
"errors": []
}{
"input": "https://example.com",
"rules": ["REQUIRED", "URL"],
"failFast": false
}EMAIL checks format; NO_DISPOSABLE_EMAIL checks known disposable domains; MX_EMAIL checks whether the domain is configured to receive email. These checks do not prove mailbox ownership.
Combine required, length, regex and security rules to validate input without changing its value.
Input
{
"input": "<script>alert(1)</script>",
"rules": ["REQUIRED", "NO_XSS"],
"failFast": false
}Example invalid response
{
"valid": false,
"errors": [
{
"rule": "NO_XSS",
"message": "Potential XSS detected"
}
]
}Detection rules are an additional input check, not a substitute for contextual output encoding, parameterized queries or other application security controls.
Pass one or more rule strings in the rules array.
| Rule | Purpose |
|---|---|
REQUIRED | Reject null or empty input. |
EMAIL | Check email format. |
NO_DISPOSABLE_EMAIL | Check against known disposable email domains. |
MX_EMAIL | Check the domain's email-receiving DNS configuration. |
PHONE | Check phone number format. |
URL | Check URL format. |
MIN_LENGTH:n | Require a minimum length. |
MAX_LENGTH:n | Enforce a maximum length. |
REGEX:pattern | Apply a custom regular expression. |
NO_XSS | Detect potential XSS patterns. |
NO_SQL_INJECTION | Detect potential SQL injection patterns. |
| Field | Description |
|---|---|
input | Raw string to validate. |
rules | Array of rule strings to apply. |
failFast | Boolean; defaults to false. If true, stop at the first error. |
A completed validation returns a valid boolean and an errors array. Each error includes rule and message. A failed validation can still return HTTP 200.
Input validation in SwaggerApply consistent format and length checks to form fields before processing.
Reuse configurable checks across services and flag potentially unsafe input.
Browse the API catalog or consult the interactive reference for full request and response details.