Skip to the page

Errors

invalid_request

400 Invalid request. Something in the request doesn’t fit: a missing or malformed field, a bad id, or a combination the endpoint refuses.

StatusCodeRetry?
400 Invalid requestinvalid_requestAfter fixing it

What it means

Something in the request doesn’t fit: a missing or malformed field, a bad id, or a combination the endpoint refuses. details names each field.

Common causes

  • A required field is missing, such as to on a send.
  • A field has the wrong type or is outside its range, such as pace_seconds: 2.
  • An id has the wrong prefix for the field, such as a ct_ id where a chat_ id goes.
  • The phone number can’t be read as a number BlueBot can text.
  • The body isn’t valid JSON.

What to do

Check the fields named in the message and send it again.

Can I retry it?

Only after you fix what the message names. Until then the same request gets the same answer.

What the answer looks like

Response400
{
  "error": {
    "code": "invalid_request",
    "message": "Send `to` or `chat_id`.",
    "hint": "Check the fields named in the message and send it again.",
    "doc_url": "https://usebluebot.com/docs/errors/invalid_request",
    "details": [
      {
        "field": "text",
        "message": "Too long: at most 2,000 characters."
      }
    ],
    "request_id": "req_1Hq2LxW9cVbN3mKpRtYs0a"
  }
}

Branch on code, which never changes. message and hint are written for people and may be reworded. Quote request_id when you write to support.

  • Errors: the envelope and every code
  • Idempotency: retrying without sending twice
  • Limits: every cap and what happens when you reach it