Skip to content
API Now! is currently in closed beta. We are constantly updating these guides as we release updates!

Validation Error

← Back to Overview

This error occurs when the request payload values do not conform to the data rules, types, or business constraints defined in the Domain Modeler.


{
"type": "https://docs.apinow.app/errors/validation",
"title": "Validation Error",
"status": 422,
"code": "VALIDATION_ERROR",
"detail": "Field validation failed",
"instance": "/api/v1/users",
"errors": [
{
"detail": "Value 'invalid-email' is not a valid email address.",
"pointer": "/email",
"code": "validation"
},
{
"detail": "Password must be at least 8 characters long.",
"pointer": "/password",
"code": "validation"
}
]
}

For API Consumers (What it means & how to fix)

Section titled “For API Consumers (What it means & how to fix)”
  • Check Field Errors: Inspect the errors array in the response. Each item contains:
    • pointer: The JSON pointer pointing to the invalid property in your request payload (e.g., /email).
    • detail: A descriptive message of why the field failed validation.
  • Payload Format: Ensure that data types are correct (e.g. sending a number instead of a string for numeric properties) and that required fields are not omitted.

For API Authors (Domain & API Modeler notes)

Section titled “For API Authors (Domain & API Modeler notes)”
  • Semantic Validators: The Serverless Engine automatically attaches validation rules based on applied Semantic Modules (like checking formatting for Email, Phone, URL, or constraints on Password and UserRole).
  • Required Properties: Ensure that fields marked as “Required” in your Domain Modeler are actually necessary, or provide a default value to prevent validation failures.