Error codes
Every error from the API has the same shape. error is a stable code you can branch on, docs links to its page here, and requestId identifies the request when you contact support.
json
{
"statusCode": 402,
"error": "insufficient_balance",
"message": "Insufficient balance",
"required": 300,
"docs": "https://docs.msgine.net/errors/insufficient_balance",
"requestId": "req_3kX9vQ2mHf7a"
}Validation errors also carry details, one entry per problem. The SDKs expose all of these fields on their error type, see Errors and retries.
| Code | Status | Meaning |
|---|---|---|
validation_error | 400 | The request is invalid. |
insufficient_balance | 402 | Your balance is too low for this request. |
email_credits_exhausted | 402 | You do not have enough email credits for this send. |
recipient_opted_out | 400 | Every recipient has opted out of messages from your account. |
unauthorized | 401 | Authentication failed. |
api_key_missing | 401 | No API key was sent. |
api_key_invalid | 401 | The API key is wrong, revoked, or belongs to a suspended account. |
signature_missing | 401 | This key requires signed requests, and the signature headers are missing. |
signature_invalid | 401 | The request signature does not match. |
signature_expired | 400 | The request timestamp is more than two minutes from MsGine’s clock. |
signature_replayed | 400 | This signed request was already received. |
forbidden | 403 | You are not allowed to do this. |
ip_not_allowed | 403 | Requests with this API key are not allowed from your IP address. |
scope_missing | 403 | The API key does not have the scope this endpoint needs. |
not_found | 404 | Nothing with that id exists in your account. |
conflict | 409 | The resource is not in a state that allows this. |
rate_limit_exceeded | 429 | Too many requests. |
trial_recipient_not_verified | 403 | On trial credit you can message only phone numbers you have verified. |
country_not_allowed | 400 | Verifications to this country are not enabled for your account. |
verification_expired | 410 | This verification has expired. |
verification_closed | 409 | This verification is already approved, cancelled or failed. |
verification_send_limit | 409 | This verification has been sent the maximum number of times. |
verify_rate_limited | 429 | Too many verifications for this number or account right now. |
internal_error | 500 | Something failed on MsGine’s side. |
service_unavailable | 503 | A service MsGine depends on is not reachable right now. |
http_error | 400 | The request failed. |