Skip to main content
All errors use a consistent envelope. The exact shape differs slightly between validation errors and business logic errors. Validation errors (400 from DTO checks, fired before any database call):
data contains the raw class-validator error objects. There is no customMessage on validation errors. Business logic errors (thrown by the service or controller):
customMessage is present only when the service explicitly sets it. Use it for logging and user-facing messages.

401 Unauthorized

Applies to every endpoint.

400 Bad Request — validation

Fires before any database call. data contains the raw class-validator error objects.

400 Bad Request — business logic

404 Not Found

500 Internal Server Error

message is always Internal server error. Do not parse customMessage — use it for logging only. Safe to retry with exponential back-off.

Per-item errors in batch endpoints

POST /accounts, POST /deals, and POST /sales-activities always return HTTP 200. Check each item’s status field in results.