Surge

Error Reference

All errors follow a consistent structure:

{
  "error": {
    "type": "error_type_slug",
    "message": "Human-readable description."
  }
}

Validation errors include a detail map with per-field errors:

{
  "error": {
    "type": "validation_error",
    "message": "Could not perform the request with the provided parameters.",
    "detail": {
      "body": ["can't be blank"],
      "to": ["is not a valid E.164 phone number"]
    }
  }
}

Authentication and authorization

TypeHTTP statusDescription
missing_api_key401No Authorization header was provided
invalid_api_key401The API key doesn't exist or has been revoked
demo_api_key403The action requires a live key but a demo key was used
platform_locked403The platform has been locked due to a policy violation

Resource errors

TypeHTTP statusDescription
not_found404The requested resource doesn't exist
account_not_found404The account ID in the path doesn't exist or isn't accessible
account_archived410The account has been archived and no longer accepts mutating operations
bad_request400The request body is malformed (unparseable JSON, wrong content type, etc.)

Validation errors

TypeHTTP statusDescription
validation_error422One or more fields failed validation. Check the detail map for field-level errors
invalid_pagination422The cursor value is invalid or the pagination parameters are out of range

State and business rule errors

TypeHTTP statusDescription
account_not_ready422The account doesn't have enough information to perform this action (e.g., create a campaign)
accounts_limit_exceeded422The platform has reached its maximum number of accounts
link_size_limit422The message contains too many URLs
opted_out422The recipient has opted out; sending is not permitted
campaign_locked422The campaign cannot be updated in its current status

Rate and quota errors

TypeHTTP statusDescription
demo_message_limit403The demo number's 25-message limit has been reached

Server errors

TypeHTTP statusDescription
internal_server_error500Something went wrong on Surge's side. These are logged automatically; contact support if they persist

Messaging-layer errors

These errors appear as failure_reason in message.failed webhook events after a message was accepted. They come from the carrier network or Surge's delivery pipeline, not from the Surge API directly.

TypeDescription
account_archivedThe sending account was archived before the message could be dispatched
account_lockedThe platform was locked due to a policy violation
attachment_retrieval_errorSurge couldn't fetch the attachment URL to build the MMS
blockedThe number has been explicitly blocked at the carrier level
carrier_errorA transient error from the carrier network
configuration_errorThe account's carrier credentials are misconfigured
daily_message_cap_reachedThe campaign's daily T-Mobile volume cap was exceeded
geo_not_enabledThe destination country is not in the platform's allowed regions
invalid_attachment_urlThe attachment URL is malformed or not publicly accessible
invalid_content_typeThe MMS attachment type isn't supported by the recipient's carrier
invalid_mobile_numberThe destination is not a valid mobile number (permanently undeliverable)
matching_sender_and_receiverThe sending and receiving number are identical
message_filteredThe carrier's spam filter or Surge's content policy blocked the message
message_too_bigThe message body exceeds the 1,600-character limit
mms_not_supportedThe recipient's carrier or handset doesn't support MMS
opted_outThe conversation is opted out; the message was not dispatched
premium_rate_numberThe destination is a premium-rate number
suspected_fraudSurge's fraud detection system flagged the send
unknown_destinationThe destination number doesn't exist on any carrier (permanently undeliverable)
unknown_errorAn unclassified error occurred
unreachable_carrierThe destination carrier network is unreachable (permanently undeliverable)
unreachable_destinationThe recipient's number is disconnected or out of service
unregistered_numberThe sending number isn't registered with the carrier for this message type
unsupported_routeNo valid carrier route exists for this number pair

Permanently undeliverable numbers. When Surge records invalid_mobile_number, unknown_destination, or unreachable_carrier for a destination, that number is flagged globally. All future sends to it — from any account — are cancelled immediately without reaching the carrier. This prevents wasted volume quota. The flag clears automatically if a future send to that number succeeds.

See Handle Failures for per-reason remediation guidance.


Phone number purchase errors

TypeDescription
no_matching_numbersNo numbers match the requested type and area code
phone_numbers_limit_exceededThe account has reached its phone number limit