Skip to content
Chatwise
Skip to Content
Developer docs

Errors

How errors are shaped, what each status means, and which requests to retry.

View as Markdown

A route that refuses or fails answers with a 4xx or 5xx status and a JSON body. message says what is wrong, and some errors have more fields. Every error lists them all.

An address that isn't a public route can answer 404 with HTML, or 401 with the message Unauthorized. If you get one of those, check the path and the method.

Shapes

Most errors have only a message. Some 500s also have an errorId: quote it when you contact support.

{
  "message": "Conversation not found"
}

Invalid parameters and fields. errors has one entry for each problem. path starts with params, query, headers or body.

{
  "message": "Validation failed",
  "errors": [
    {
      "path": "query.limit",
      "message": "Limit must be an integer between 1 and 100"
    }
  ]
}

A value that was refused. field names it, and some have more in data.

{
  "object": "Webhook endpoint",
  "field": "url",
  "message": "Use a public https:// URL on port 443, without a username, password or #fragment."
}

Errors with a code. Check code in your program, not message.

{
  "code": "TEMPLATE_EXISTS",
  "message": "A WhatsApp template with this name and language already exists"
}

Codes

CodeStatusWhat it means
ADMIN_SERVICES_BLOCKED402Sending is paused for the workspace. Contact support.
WHATSAPP_REAUTH_REQUIRED403Meta no longer accepts Chatwise's access to the number. reason is expired, revoked or missing. Reconnect it in the dashboard.
TEMPLATE_EXISTS409There is a template with this name and language.
IDEMPOTENCY_KEY_REUSED409The key was used with another template.
TEMPLATE_SUBMISSION_IN_PROGRESS409A submission of this name and language, with this key or another, is running or unconfirmed. Wait, then repeat it with the key it was made with.
TEMPLATE_SUBMISSION_UNCONFIRMED409, 502Meta hasn't confirmed the submission. Repeat it with the same key and body. If a 409 keeps coming back, Meta doesn't have the template: submit it under another name.
WHATSAPP_CONNECTION_CHANGED409The workspace connected another WhatsApp Business Account since. Submit again with a new key.
WHATSAPP_LOOKUP_FAILED502Meta couldn't be asked about the submission. Repeat it with the same key and body.
WHATSAPP_RATE_LIMITED503WhatsApp is limiting submissions. Wait, then repeat it with the same key and body.

Statuses

StatusWhat it meansRetry?
400A parameter, body field, cursor or date range is invalid, or a key without messages:read subscribes to message events.No. Fix the request.
401The key is missing, invalid, expired or revoked.No, except Invalid API key.
402Sending is paused for the workspace.No.
403The key lacks a scope, WhatsApp has to be reconnected, or its account can't create templates.No.
404It doesn't exist in the key's workspace, or the workspace has no connected WhatsApp number.No.
409A template submission conflicts with an earlier one.As its code says.
413The body is larger than 100 KB.No.
429Too many requests with this key.Yes, after Retry-After seconds.
500Something failed in Chatwise, or WhatsApp didn't accept a message you sent.Reads: yes, with growing waits. Template creation: yes, with the same key and body. Sends: see below.
502, 503Meta didn't confirm a template submission, or is busy.Template creation: yes, with the same key and body. Sends: see below.

Sends aren't retried safely

The two send routes have no idempotency key. After a timeout, or a 500, 502 or 503, read the conversation's messages before you send again. If the message is there, it was sent. If it isn't, it may still have been sent.

When WhatsApp doesn't accept a message, the answer is a 500 whose message starts with Internal server error: WhatsApp send failed:, followed by Meta's HTTP status and, when that was JSON, Meta's answer:

  • 429: try again later.
  • 5xx: check the conversation first, as above.
  • Anything else: fix what the answer names. The same request will fail again.

A send that isn't accepted can still create the customer's conversation, without a message.

On this page