Error Handling

The Registration API uses structured error responses with detailed validation messages. If a request encounters any issues, such as invalid or missing data, we respond with an error object that includes information about the error type, expected and received data types, and the location of the error within the request payload.

Errors are represented as an array of issues, with each issue containing the following fields:
• code: The type of error (e.g., 'invalid_type').
• message: A human-readable description of the error.
• path: The location of the error within the request payload.
• expected: The expected data type.
• received: The received data type or value.

Example Error Response

{
  "success": false,
  "reason": [
    {
      "code": "invalid_type",
      "message": "Email is required",
      "path": ["email"],
      "expected": "string",
      "received": "undefined"
    }
  ]
}