Response Format

The success and error envelopes, pagination, response headers, error codes and idempotency.

Success

A successful response wraps the result in data. It is an object or an array, depending on the route.

{
  "data": {
    "message_id": "true_5581999999999@c.us_3EB0C767D26A1D5E",
    "chat_id": "5581999999999@c.us"
  }
}

Most routes answer 200. Creating a label or a group answers 201.

Lists and pagination

The list routes take limit and offset and return a plain array in data, with no total count.

RoutelimitDefault
GET /chats1 to 10020
GET /chats/{chatId}/messages1 to 10020
GET /contacts1 to 500100

For the next page, advance offset by limit. Stop when a page comes back empty. Messages also accept before and after (Unix seconds, exclusive) to filter by time.

Data passed through from WhatsApp

Some group routes (GET /groups, POST /groups, GET /groups/{gid}, GET /groups/{gid}/participants, and adding or removing participants) return the data as WhatsApp gives it, unchanged. Its fields may vary: read only what you need and don't fail on fields you don't know.

Errors

Every error has the same shape:

{
  "error": {
    "codigo": "numero_sem_whatsapp",
    "mensagem": "Este numero nao tem conta no WhatsApp. Nada foi enviado."
  }
}
FieldMeaning
codigoA stable error code. Decide what to do based on it.
mensagemA human-readable explanation, currently in Portuguese. Log it or show it, but don't parse it: it may change.

The field names (codigo, mensagem) and the error codes are Portuguese identifiers. They are stable and safe to match in your code.

Common error codes

StatusCodeWhat to do
400dados_invalidosA field in the body, query or path is wrong or missing. The message names the field.
400requisicao_invalidaThe body is not valid JSON.
400destino_invalidoto is neither a phone number (country code + area code + number) nor a chat ID.
400midia_invalidaSend url or base64, exactly one of them. A url must be public http(s); a base64 must be valid.
400idempotency_key_invalidaIdempotency-Key must be 1 to 255 visible characters, without spaces.
401chave_invalidaThe API key is missing, malformed, unknown or revoked.
402sem_assinaturaThe account has no active subscription. Reactivate the plan in the dashboard.
403sem_permissaoWhatsApp refused for lack of permission (for example, the number is not a group admin). Nothing was done.
404rota_nao_encontradaThe route does not exist.
400 / 404 / 409 / 422recusado_pelo_whatsappWhatsApp refused the request (invalid data, an item that doesn't exist, or a conflict with the current state). The status repeats WhatsApp's.
409conexao_desconectadaThe number is disconnected from WhatsApp. Reconnect it (scan the QR code) and try again.
409instancia_suspensaThe connection is suspended for billing reasons. Nothing is sent.
409sessao_em_estado_inesperadoThe WhatsApp session is not in the right state for this. Check the connection and try again.
409requisicao_em_andamentoA request with the same Idempotency-Key is still running. Wait for its answer.
413corpo_grande_demaisThe request body is larger than 25 MB. Send large files by url.
413midia_grandeThe file at url is larger than 50 MB. Nothing was sent.
415tipo_de_conteudo_nao_suportadoSend the body as application/json.
422numero_sem_whatsappThe number has no WhatsApp account. Nothing was sent. Check numbers with GET /contacts/check.
422idempotency_key_reutilizadaThe same Idempotency-Key was used for a different request. Use one value per request.
422midia_indisponivelThe url didn't deliver the file (name doesn't resolve, non-2xx answer, too many redirects, empty).
422destino_nao_suportadoStatus and broadcast lists (@broadcast) are not valid destinations. Use a chat or a group.
429muitas_tentativas, excesso_de_pedidos, consulta_repetidaAbuse protection. Wait for Retry-After. See Rate limits.
429bloqueio_temporario, limite_do_whatsappWhatsApp itself is limiting this number. Stop sending and wait.
500erro_internoUnexpected error on our side. Contact support with the x-request-id.
501recurso_nao_suportadoThis feature is not available for this WhatsApp connection.
502 / 504resultado_incertoWhatsApp didn't confirm in time and the message may have gone out. Check the chat, or wait for message.sent, before resending.
502 / 503whatsapp_indisponivelTemporary WhatsApp instability. Nothing was sent; try again shortly (the 503 carries Retry-After).
503servidor_offlineThe server that hosts this connection is down. Try again in a few minutes.
503instancia_sem_servidorThe connection is not assigned to a WhatsApp server. Contact support.
503banco_indisponivelMomentary instability on our side. Try again after Retry-After.
504whatsapp_sem_respostaWhatsApp didn't answer a read in time. Try again shortly.

Route-specific codes, such as formato_de_voz_invalido, lista_so_individual or etiquetas_indisponiveis, are explained in the guides and listed per route in the API Reference tab.

Treat resultado_incerto differently: the message may already be on the recipient's phone. Check the chat before resending, or retry with the same Idempotency-Key, which returns the same error instead of sending twice.

Response headers

HeaderWhenMeaning
x-request-idEvery responseThe request id. Include it when you contact support, so we can find the request.
idempotent-replayedRepeated Idempotency-Keytrue when the response is the stored one from an earlier request: nothing was done again.
AgeSome readsThe response came from a short cache (up to 10 seconds) instead of WhatsApp. See Rate limits.
Retry-After429 from abuse protection, some 503How many seconds to wait before trying again.

Idempotency

Every route that changes something (POST, PUT, PATCH and DELETE) accepts the optional Idempotency-Key header. Repeating the same value, with the same API key, within 24 hours returns the first response with idempotent-replayed: true, without sending again.

  • Use one value per message: a UUID, your order id or the id of the workflow run.
  • Same value, different request (other body or other route): 422 idempotency_key_reutilizada.
  • First request still running: 409 requisicao_em_andamento. Wait for it.
  • Error where nothing went out (validation, 402, 409, 422...): the value is released, so you can fix the request and retry with the same value.
  • resultado_incerto: the value stays taken, and a retry returns the same error instead of risking a duplicate message.

n8n, Make and many HTTP clients retry automatically when a response is slow. Without an Idempotency-Key, each retry can become another WhatsApp message.

On this page