Errors▾

Errors

One error envelope for every failure, with a stable machine-readable code.

Sendport uses conventional HTTP status codes. Every failure returns the same envelope.

Error envelope
{
  "error": {
    "type": "invalid_request_error",
    "code": "template_not_found",
    "message": "No approved template named 'order_shipped' in language 'ar'.",
    "param": "template.name",
    "doc_url": "https://sendport.tech/docs/errors#template_not_found",
    "request_id": "req_9f3c2a7b41de08c5b2e6d1a4"
  }
}

Status codes

StatusMeaningRetry?
200 / 202Success. 202 means queued for asynchronous delivery.—
400Malformed body or a parameter failed validation.No — fix the request
401Missing, malformed or revoked API key.No
403The key is valid but not permitted on this number.No
404No such resource, or it belongs to another account.No
409Conflicts with current state, e.g. a template name in use.No
422Rejected by WhatsApp — outside the session window, opted out.No
429Rate limited. See Rate limits.Yes, with backoff
5xxSomething broke on our side.Yes, with backoff

Error codes

CodeStatusWhat happened
missing_api_key401No Authorization header was sent
invalid_api_key401The key is malformed or has been revoked
resource_not_found404The path or id does not resolve
invalid_phone_number400to is not valid E.164
template_not_found404No approved template with that name and language
template_param_mismatch400Placeholder count does not match the approved body
session_window_closed422More than 24h since the contact's last message — send a template
contact_opted_out422The contact blocked the number or replied STOP
media_too_large400Beyond the per-type size cap
number_not_connected403The sending number is not connected or is disabled
rate_limit_exceeded429Too many requests in the window

Log the request id

request_id is also returned as the X-Request-Id header on successful calls. Logging it on both paths makes support requests solvable in one round trip.