OonoBox API

Errors

How the OonoBox API reports failures.

Every error uses one envelope, with a matching HTTP status:

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "`to` must be a phone number in international format.",
    "details": null
  }
}
  • code — a stable, machine-readable string. Branch on this, not the message.
  • message — a human-readable explanation, safe to log.
  • details — optional structured context (e.g. which fields failed), or null.

Status codes

HTTPcodeWhen you'll see it
400VALIDATION_FAILEDMissing/invalid fields (bad phone, empty body, …).
401NOT_AUTHENTICATEDMissing, invalid, revoked, or wrong-scope API key.
404NOT_FOUNDThe template (or other resource) doesn't exist in this workspace.
422TEMPLATE_NOT_APPROVEDThe template isn't approved yet.
422WINDOW_CLOSEDFree-form text outside the 24-hour window — send a template instead.
422META_ERRORWhatsApp rejected the send; message forwards Meta's reason.
429RATE_LIMITEDA rate limit was exceeded (e.g. OTP sends per recipient).

Handling tips

  • Treat any 2xx as success and read the JSON body for ids.
  • On 401, stop and check the key + its scopes — retrying won't help.
  • On 429, back off and retry later.
  • WINDOW_CLOSED is expected for proactive outreach — fall back to a template automatically.

On this page