Reference

Responses and errors

Every answer is JSON with success. When it’s false, error says in plain words what went wrong and what to change.

Error format

400 Bad Request
{
  "success": false,
  "error": "templateParams: This template needs 3 values (for {{1}}, {{2}}, {{3}}), got 2.",
  "expected": 3
}

Some errors add details, such as expected (how many values or cards are needed) or problems (a list of every value that needs fixing).

Status codes

StatusMeaningWhat to do
200WhatsApp accepted the message (or the dryRun passed).Nothing.
400A value is missing or wrong: number, values, file link, button, code…Fix the request. The error says which field.
401The API key is missing, wrong or revoked.Check the key. See API keys.
402The wallet is too low, or sending is paused for your account.Add money to the wallet, or contact us.
403The API isn’t part of your QMessage plan.Contact us to turn it on.
404No API campaign with that name in this project.Check campaignName and that the key is from the right project.
409Can’t send right now: the campaign is paused, the template is no longer approved, the number isn’t connected, or the contact opted out or is blocked.Read the error. Retrying the same request won’t help until that changes.
422WhatsApp refused the message.Read error and hint. See below.
429More than 20 requests a second with this key.Wait a moment and retry.
500Something went wrong on our side.Retry after a short wait.
502WhatsApp couldn’t be reached, or a file couldn’t be uploaded to it.Retry after a short wait.

Common errors

Error saysWhy
campaignName is requiredThe body has no campaignName.
No API campaign named “…”The name doesn’t match an API campaign in the key’s project.
API campaign “…” is pausedSomeone paused it in QMessage. Resume it to send.
destination: Not a valid WhatsApp numberThe number is too short or long. Send it with the country code.
templateParams: This template needs N valuesSend exactly as many values as the template has.
templateParams: Value N is emptyA value is blank. Fill it, or send paramsFallbackValue.
media: This template has an image headerSend media.url, or set a default file on the API campaign.
media.url: Use a public link that starts with https://The file link isn’t https, or isn’t a link.
buttonParams: Send the link ending for button NThe template has a website button whose link needs a value.
This contact opted out of marketing messages.The customer stopped marketing messages. Utility templates still go.
Your wallet balance is too lowAdd money to your QMessage wallet, then send again.

When WhatsApp refuses a message

QMessage checks everything it can before sending. If WhatsApp still refuses the message, you get status 422 with WhatsApp’s reason, its error code and a hint:

422 Unprocessable Entity
{
  "success": false,
  "error": "Template name does not exist in the translation",
  "code": 132001,
  "hint": "This template does not exist (or not in this language).",
  "messageId": "6f1c2a9e-0d3b-4c71-9a55-2b7d8e4f1c20"
}

The failed message is kept in QMessage with this reason, so your team can see it too. Common codes:

CodeMeaning
131026Couldn’t deliver. The number may not be on WhatsApp, or the customer has an old app.
131049WhatsApp held back this marketing message so the customer doesn’t get too many. Try later.
131050The customer stopped marketing messages from your business on WhatsApp.
132001The template doesn’t exist, or not in this language.
132015The template is paused because of low quality.
131056Too many messages to this customer in a short time. Wait and retry.
130429Your number’s sending speed limit was reached. Retry shortly.
131031The WhatsApp account is locked. Contact us.

Retrying

  • Retry 429, 500 and 502 after a short wait, waiting a little longer each time (for example 1, 5, then 30 seconds).
  • Don’t retry 400, 401, 403, 404 or 409 as they are. The same request will fail again until something changes.
  • After a 200, don’t send the same request again: it would send a second message.

Note

A 200 means WhatsApp accepted the message. It can still fail later, for example if the phone can’t be reached for days. Those messages show as Failed in the API campaign’s results in QMessage.
QMessage is a product of GatiQ Platforms LLP. Questions about the API? Write to qmessage@gatiq.in.