Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(api): describe the production validation error body

Yudhi Armyndharis52e1597372dd
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index 18f471a2d..a6740bf8a 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -92,7 +92,7 @@ Errors use the NestJS default shape. The HTTP status is on the status line and m
}
```
-Validation failures (`statusCode: 400`) return `message` as an **array** of field-level strings. A global `ValidationPipe` runs with `whitelist` + `forbidNonWhitelisted`, so any request-body field not declared on the DTO is rejected with `400`.
+Validation failures (`statusCode: 400`) return `message` as an **array** of field-level strings, with `error: "Bad Request"`, when field detail is enabled: by default outside production, or anywhere with `VALIDATION_ERROR_DETAIL=true`. Under `NODE_ENV=production` (the Docker image, compose and Helm default) detail is off unless that variable is set, and the body is only `{ "statusCode": 400, "message": "Bad Request" }`. Clients should accept `message` as either a string or an array of strings. A global `ValidationPipe` runs with `whitelist` + `forbidNonWhitelisted`, so any request-body field not declared on the DTO is rejected with `400`.
### General Error Codes