Karta.Messaging.Plugs.Bird.Errors (Karta v1.0.0)

What Bird's answers to a send mean for Karta (Karta.Messaging.Errors):

AnswerClassAlso
202accepted
401, 403permanent, unauthorizedthe connector is paused (error)
402permanent, insufficient_balancethe connector is paused
409 E01004 (same key in flight)retry
409 E01005 (key with another body)permanent
421 (key for the other region)permanent, wrong_regionthe connector is paused
422 SMSDestinationNotEnabled, SMSDestinationDailySpendExceeded, SMSAlphaNotSupported, SMSUnsupportedFeaturepermanent, the code
422 about the recipient (code with Recipient, Destination+Invalid, InvalidNumber)unknown_recipient
other 422, 400permanent
429rate_limitedRetry-After seconds
5xx, a transport error or a timeoutretry, same attemptthe job runs again with the same Idempotency-Key (Bird does not keep a 5xx for the key, so nothing is sent twice)

The body of an error is {"error": {"code", "name", "message", "type", "param", "request_id", "doc_url"}} (seen against the real API on 2026-11-13: E01001 ValidationError for an http callback URL, E12056 SMSSenderNotConfigured for a sender the workspace does not have). Karta keeps the code (E12056). The documentation's descriptive names (SMSDestinationNotEnabled, SMSDestinationDailySpendExceeded, SMSAlphaNotSupported, SMSUnsupportedFeature) are the name; E01004 and E01005 are codes. Recipient errors are matched by pattern on the code or the name because the documentation does not list them. All of these are permanent.

Summary

Functions

{:error, class, detail} for an HTTP answer; detail.pause says the connector must be paused.

Whether the detail asks for the connector to be paused.

A transport failure (connection refused, timeout): the same attempt is tried again.

Functions

classify(status, body, headers)

@spec classify(pos_integer(), term(), [{String.t(), String.t()}]) ::
  {:error, atom(), map()}

{:error, class, detail} for an HTTP answer; detail.pause says the connector must be paused.

pause?(arg1)

@spec pause?(map()) :: boolean()

Whether the detail asks for the connector to be paused.

transport(reason)

@spec transport(term()) :: {:error, atom(), map()}

A transport failure (connection refused, timeout): the same attempt is tried again.