invalid_request — Request failed validation
What the API returns
{
"error": {
"code": "invalid_request",
"message": "The request payload failed validation.",
"request_id": "req_01JRQ8F4X9N2K7YB3C5V6W8H0T"
}
}Every Wapito error is this one envelope. Branch on code, which is stable; message is written for people and can be reworded; details appears only when there is something specific to say; request_id is what to quote to support.
What it means
invalid_request is an HTTP 400 error from the Wapito WhatsApp API: request failed validation. The response message reads “The request payload failed validation.” It is not retryable: the same request fails again until you change it. 5 endpoints can raise it, POST /groups among them.
Why it happens
Wapito validates every request body, query string and path parameter against the published OpenAPI schema before the WhatsApp engine is touched at all. This status means a required field was absent, a value had the wrong type, an enum value was not one of the allowed strings, or an array broke its length limit. The offending paths are listed one by one in details.issues, so you never have to guess which field the API disliked.
How to fix invalid_request
Read details.issues: each entry names the exact path, such as participants.0, and what was expected there.
Compare your body against the request schema for that operation in the API reference, paying attention to types - ids and timestamps are strings, never numbers.
Send Content-Type: application/json and a real JSON body; a form-encoded body or a body serialised twice arrives as a string and fails the same way.
The same failure in other stacks
If you are moving from a library or a self-hosted gateway, this is the same failure under the name that stack gives it:
WAHA 422 Unprocessable Entity
Endpoints that raise it
Where you will meet it
- Create Group
Feature guide
Retry guidance
Do not retry as sent
The same request fails the same way until something changes: the body, the credential, the recipient or the state of the channel. Keep it off every retry loop, fix the cause above, and send a corrected request once.
Frequently asked questions
Why does details.issues sometimes list a field I did not send?
Because the field is required. The validator reports the path it expected to find, not the path you supplied, so a missing required key shows up as an issue on that key with a message about it being required. Add the key with a valid value and the request goes through.
Should my code retry a 400 invalid_request?
No. Nothing about the request will change on a second attempt, so a retry only burns quota and adds latency. Log the issues array, fix the payload in code, and deploy. Reserve retries for 429, 503 and 504, which really are transient.
Related
Try it on your own number
Create a channel, link a WhatsApp number by QR or pairing code, and call the API in a couple of minutes. The Sandbox plan is free and needs no card.