Overview

Every endpoint in the API guarantees a consistent wrapper format whether it succeeds or fails. Unhandled exceptions are automatically caught by a global middleware and mapped to an appropriate HTTP status code.

Standard Success Response

JSON
{
  "isSuccess": true,
  "data": { ... },
  "message": "Operation completed successfully",
  "error": null,
  "errors": []
}

Standard Error Response

JSON
{
  "isSuccess": false,
  "data": null,
  "message": "",
  "error": "Contact not found",
  "errors": []
}

Validation Errors (400)

JSON
{
  "isSuccess": false,
  "data": null,
  "error": "Validation failed",
  "errors": [
    "Email is required",
    "Password must be at least 8 characters"
  ]
}