error string identifying the specific problem, and may include additional fields — like limit_bytes or upgrade — that tell you exactly what to do next.
Error shape
Example error body
upgrade: true flag signals that the error is caused by a plan limit and can be resolved by upgrading — useful for surfacing an actionable prompt to users.
HTTP status codes
| Status | Meaning | Notes |
|---|---|---|
400 | Bad request | A required field is missing or malformed. |
401 | Unauthorized | Missing or invalid API key. |
402 | Upgrade required | A plan limit was hit (upgrade: true). See below. |
404 | Not found | The resource doesn’t exist or isn’t yours. |
409 | Conflict | address_taken — that inbox address is already in use. |
413 | Payload too large | attachment_too_large — over the per-message size limit. |
422 | Unprocessable | no_deliverable_recipients — all recipients are suppressed or blocked. |
Plan-limit errors (402)
The following errors carryupgrade: true and indicate you have reached a cap for your current plan:
error | Trigger |
|---|---|
inbox_limit_reached | Over your plan’s inbox cap. |
custom_domains_require_paid_plan | Custom domains require Pro or higher. |
dedicated_subdomain_requires_scale | Dedicated sending subdomains require Scale or higher. |
storage_limit_reached | Over your attachment storage cap. |
Recommendations
Follow these practices to handle errors cleanly and keep your agent reliable:-
401— surface the key problem immediately. A missing or invalid API key is a configuration issue, not a transient error. Do not retry; surface the problem so it can be fixed. -
402— treat it as actionable. Link the user or operator to the Billing page rather than failing silently. Theupgrade: truefield confirms an upgrade will resolve it. -
Use idempotency keys on sends. Pass a
client_idon everyPOST /messagescall. If you retry after a network timeout, Sentvia deduplicates onclient_idand never delivers the same message twice. -
Verify webhook signatures and return
2xxfast. Sentvia retries delivery with exponential backoff on any non-2xxresponse. Verify the signature, enqueue processing, and acknowledge immediately to avoid duplicate deliveries.