invalid_recipient — Recipient is not valid

HTTP 400
Not retryable

What the API returns

{
  "error": {
    "code": "invalid_recipient",
    "message": "The recipient is not a valid WhatsApp address.",
    "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_recipient is an HTTP 400 error from the Wapito WhatsApp API: recipient is not valid. The response message reads “The recipient is not a valid WhatsApp address.” It is not retryable: the same request fails again until you change it. 5 endpoints can raise it, POST /messages/text among them.

Why it happens

The value you put in the to field could not be parsed into a WhatsApp address. Wapito accepts a plus-prefixed E.164 number, bare digits, or a full address ending in one of the known suffixes for users, groups, linked identities and channels. Anything else - a local number with a leading zero, a number with spaces or dashes left in, or an address with a suffix that does not exist - stops here before a send is attempted.

How to fix invalid_recipient

  1. Normalise the number to E.164 with a real phone-number library before you send it, rather than with string concatenation.

  2. Drop national trunk prefixes: a Brazilian 011 99999 9999 must become +5511999999999, not +55011999999999.

  3. If you are addressing a group or a channel, pass the id exactly as the API returned it, suffix included, and keep it a string.

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:

  • jid-malformed

Endpoints that raise it

Where you will meet it

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

Does a valid format mean the number is on WhatsApp?

No. This check is purely about shape. A perfectly formatted number that nobody has ever registered will pass validation and then fail later with not_on_whatsapp. Run the number checker first if you are working from a list you did not collect yourself.

Can I send to a group id I built by hand?

Only if it is byte-for-byte the id the API gave you. Group ids are long numeric strings with a suffix, and rebuilding one from an integer silently loses digits on most languages. Store the id as text everywhere, including in your database column type.

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.