Skip to main content
Complete reference for errors returned by the Telnyx Messaging API. Errors fall into three categories: API request errors (returned immediately), delivery errors (reported via webhooks), and configuration errors (number/profile issues).
For general Telnyx API errors (authentication, rate limiting, etc.), see the API Error Codes reference.

Delivery errors (40xxx)

These errors occur after the message is accepted by the API but fails during delivery. They appear in message detail records and message.finalized webhooks.

Carrier rejections

CodeErrorCauseAction
40001Not routableDestination is a landline or non-routable numberVerify the recipient can receive SMS/MMS
40002Blocked as spam (temporary)Carrier spam filter triggeredReduce sending rate; review message content for spam patterns
40003Blocked as spam (permanent)Sending number permanently blocked by carrierUse a different sending number; contact support for appeal
40004Rejected by destinationRecipient carrier rejecting for unknown reasonRetry after delay; contact support if persistent
40005Message expiredMessage TTL expired before deliveryIncrease validity period or check carrier delays
40006Recipient unavailableRecipient’s carrier server is downRetry with exponential backoff
40008UndeliverableCarrier did not accept the messageCheck number validity; try alternate route
40009Invalid message bodyMessage content rejectedCheck for invalid characters or encoding issues; see Message Encoding
40011Rate limit exceeded (upstream)Exceeded carrier throughput limitReduce sending rate; see Rate Limiting
40012Invalid destination numberCarrier rejected the destination numberVerify E.164 format and number validity
40013Invalid source numberCarrier rejected the sending numberCheck that your number is active and messaging-enabled
40014Expired in queueMessage sat in queue past validity periodCheck for throughput bottlenecks; increase sending capacity
40015Internal spam filterTelnyx internal spam filter triggeredReview message content; contact support if false positive

10DLC-specific errors

CodeErrorCauseAction
40010Not 10DLC registeredSending number lacks 10DLC campaign registrationRegister for 10DLC
40016T-Mobile sending limitExceeded T-Mobile throughput for this campaignReduce rate or improve brand vetting score for higher limits
40017AT&T spam rejectionAT&T flagged message as spamReview content; avoid URL shorteners and spam-like patterns
40018AT&T sending limitExceeded AT&T throughput for this campaignReduce rate or improve brand vetting score
40019AT&T invalid tag dataIncorrect 10DLC tagging informationVerify campaign and number assignment; troubleshoot 10DLC
40020Artificial traffic inflation2FA traffic blocked for 24 hoursWait 24 hours; review for fraud patterns on your numbers

Toll-free errors

CodeErrorCauseAction
40329Toll-free not verifiedNumber hasn’t passed toll-free verificationComplete toll-free verification
40330Toll-free not provisionedNumber not fully provisioned for messagingWait for provisioning to complete; contact support

API request errors (403xx)

These errors are returned immediately in the API response when the message request is invalid.

Sender/recipient errors

CodeErrorCauseAction
40300Blocked (STOP)Recipient sent STOP — opt-out in effectDo not retry; wait for recipient to opt back in
40301Unsupported message typeCannot send between these number typesCheck source and destination number capabilities
40305Invalid ‘from’ addressSending number not associated with messaging profileAssign the number to your messaging profile
40306Alpha sender not configuredAlphanumeric sender ID not set on profileConfigure alpha sender on your messaging profile
40307Alpha sender mismatchFrom address doesn’t match configured alpha senderUse the exact alpha sender configured on the profile
40308Invalid ‘from’ for MMSMMS requires US long code or short codeUse an MMS-capable number
40309Invalid destination regionDestination country not in profile whitelistAdd the destination region to your messaging profile
40310Invalid ‘to’ addressDestination number is invalidVerify E.164 format: +[country code][number]
40319Incompatible message typeSource and destination types incompatibleCheck number type compatibility
40320Temporarily unusable senderSending number in pending/transitional stateWait for number provisioning to complete
40321No usable numbers in poolNumber pool empty or all numbers unhealthyAdd numbers to pool or check number health
40325Invalid alpha sender IDAlphanumeric sender ID format is invalidUse 1–11 alphanumeric characters

Content errors

CodeErrorCauseAction
40302Message too largeSMS exceeds maximum segment countShorten message or send as MMS
40304Invalid content combinationMixed SMS/MMS content parametersUse text for SMS; media_urls (with optional text) for MMS
40316No contentMessage has no text or mediaInclude text and/or media_urls
40317Invalid MMS contentToo many media items or total size > 1 MBReduce to ≤10 URLs and ≤1 MB total
40322Blocked contentMessage contains prohibited contentRemove flagged content
40328SMS too large (warning)Message splits into too many partsConsider sending as MMS instead

Profile/configuration errors

CodeErrorCauseAction
40311Invalid profile secretX-Profile-Secret header is wrongCheck your messaging profile secret
40312Profile disabledMessaging profile is disabledRe-enable in Mission Control
40313Missing profile secretX-Profile-Secret header required but not sentInclude the header in your request
40314Messaging disabledMessaging disabled on your accountContact Telnyx support
40315Unhealthy senderSending number has poor health metricsCheck number success/spam rates; consider replacing
40318Queue fullInternal message queue at capacityBack off and retry after a delay
40323Activation failedCould not enable messaging on numberContact support
40331Missing whitelistNo whitelisted destinations on profileAdd destination regions to your messaging profile
40333Spend limit reachedMessaging profile cost limit hitIncrease spend limit or wait for reset

Number provisioning errors (401xx)

CodeErrorCauseAction
40100Not messaging enabledNumber not configured for messagingEnable messaging in Mission Control
40150Not in voice registryToll-free number missing from registryContact support
40151Enablement pending elsewhereAnother provider is enabling messagingWait for transfer to complete
40155LOA requiredLetter of Authorization neededSubmit LOA through support

Handle errors in code

import telnyx

telnyx.api_key = "YOUR_API_KEY"

try:
    message = telnyx.Message.create(
        from_="+18005550100",
        to="+18005550101",
        text="Hello!",
        messaging_profile_id="YOUR_PROFILE_ID"
    )
    print(f"Sent: {message.id}")

except telnyx.error.InvalidRequestError as e:
    # API request errors (40xxx)
    error = e.json_body.get("errors", [{}])[0]
    code = error.get("code", "unknown")
    detail = error.get("detail", "No details")

    if code == "40300":
        print(f"Recipient opted out (STOP). Do not retry.")
    elif code == "40333":
        print(f"Spend limit reached. Increase limit or wait for reset.")
    elif code == "40310":
        print(f"Invalid destination number. Check E.164 format.")
    else:
        print(f"Error {code}: {detail}")

except telnyx.error.AuthenticationError:
    print("Invalid API key")

Handle delivery errors via webhooks

Delivery errors arrive asynchronously in message.finalized webhooks:
Python
@app.route("/webhooks", methods=["POST"])
def webhooks():
    body = request.json
    event_type = body["data"]["event_type"]

    if event_type == "message.finalized":
        payload = body["data"]["payload"]
        status = payload["to"][0]["status"]

        if status == "delivery_failed" or status == "sending_failed":
            errors = payload.get("errors", [])
            for error in errors:
                code = error.get("code", "unknown")
                detail = error.get("detail", "")
                print(f"Delivery failed [{code}]: {detail}")

                # Decide whether to retry
                if code in ("40006", "40008"):
                    print("Temporary error — retry with exponential backoff")
                elif code in ("40003", "40300", "40001", "40010", "40314", "40322"):
                    print("Permanent error — do not retry")
                elif code in ("40002", "40011", "40016", "40017", "40018"):
                    print("Intervention required — review content/rate, then retry")
                else:
                    print("Review error and decide")

    return "", 200

Retriable vs permanent errors

Most delivery errors require you to change something before retrying — blindly retrying the same message with the same configuration will not resolve the issue and may result in further blocking.
CategoryCodesAction
Auto-retriable (genuinely temporary)40006, 40008Carrier-side issue — retry with exponential backoff (1s, 2s, 4s, 8s…). 40006: recipient carrier is down. 40008: general undeliverable, may resolve on retry.
Retriable after intervention (fix first)40002, 40005, 40011, 40014, 40016, 40017, 40018, 40318These errors indicate a problem with your sending rate, content, or throughput. Reduce sending rate, review message content for spam patterns, or resolve queue pressure before retrying. Automatic retry without changes will likely fail again.
Temporary hold40020, 4032040020: 2FA traffic blocked for 24 hours — wait, do not retry. 40320: sender in transitional state — wait for provisioning to complete.
Permanent (do not retry)40001, 40003, 40010, 40300, 40314, 40322Fix root cause before attempting again. These will not resolve on their own.
Action required (config/compliance)40010, 40015, 40019, 40315, 40329, 40333Resolve the underlying configuration or compliance issue, then send again.