kirim.dev/ docsGet started
Menu

Errors

Errors use the same envelope shape as Meta's Cloud API, so a client that already handles Cloud API errors keeps working. There are two sources:

Meta's errors, passed through

If Meta rejects a request — a bad payload, a rate limit, an unapproved template — that error is forwarded to youuntouched, with Meta's own type, code, and message. Handle these exactly as you would calling Meta directly.

kirim.dev's own errors

Failures that never reach Meta — authentication, billing, throughput — carry a Kirim* type so you can tell them apart from Meta's, while keeping the familiar envelope:

error envelope
{
  "error": {
    "message": "This account has no active subscription. Subscribe in the dashboard.",
    "type": "KirimBillingException",
    "code": 402
  }
}
HTTPtypeWhen
401Missing or invalid API key.
402KirimBillingExceptionNo active subscription for this account.
404KirimRoutingExceptionUnknown or unsupported route, or an account you do not own.
413KirimRequestTooLargeRequest body exceeds the size limit.
422KirimAccountExceptionThe number is not connected yet.
429KirimThrottleExceptionSending too fast for this number; retry after the given delay.
502KirimUpstreamExceptionCould not reach Meta. The request was not sent.
503KirimUpstreamExceptionTemporarily unable to serve the request.

On a 429, respect the Retry-After header — the limiter paces you below Meta's ceiling so your sends are not rejected mid-campaign.