SMS Delivery Reports via Webhook

curl-sms tells you what happened to every SMS: queued, sent, delivered or failed with an error code. Instead of polling, add a webhook and receive each status change as a signed POST to your server.

The event

{
  "id": "evt_01JDQ8P2K9W3E6Y1M4T7Z0R5C8",
  "type": "sms.status_changed",
  "created": 1763892907,
  "data": { "id": "01JDQ8M3V6R1T5ZK2X9N4C7B0A", "status": "delivered", "at": "2026-11-23T10:15:07.123Z" }
}

data.id is the ID you got back when sending. On failures data also contains error_code. Further events cover billing: billing.quota_warning, billing.spend_limit_reached and billing.balance_low.

Receive and verify (Python, Flask)

import hashlib
import hmac
import os
import time

from flask import Flask, abort, request

app = Flask(__name__)
SECRET = os.environ["CURLSMS_WEBHOOK_SECRET"]  # whsec_…


@app.post("/hooks/curl-sms")
def curl_sms_hook():
    header = request.headers.get("X-CurlSMS-Signature", "")
    parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
    t, sig = parts.get("t", ""), parts.get("v1", "")
    if not t.isdigit() or abs(time.time() - int(t)) > 300:
        abort(400)
    mac = hmac.new(SECRET.encode(), t.encode() + b"." + request.get_data(), hashlib.sha256).hexdigest()
    if not hmac.compare_digest(mac, sig):
        abort(400)
    event = request.get_json()
    if event["type"] == "sms.status_changed":
        print(event["data"]["id"], event["data"]["status"])
    return "", 204

The signature is an HMAC-SHA256 over <t>.<raw body> with your endpoint secret. Node.js and Go versions are in the webhook docs.

Good to know

  • sent vs. delivered: sent means the mobile network accepted the SMS. delivered comes from the network's delivery report; some networks, roaming or switched-off phones report late or never. Treat delivered as a bonus, not a requirement.
  • At least once: the same event can arrive twice. Store the event id and process it once; order is not guaranteed, compare data.at.
  • Answer fast: any 2xx within 10 seconds. Failed deliveries are retried up to 8 times over about 24 hours.
  • Test keys trigger webhooks too, with a simulated status, so you can build your receiver without sending real SMS.
  • No server? Discord webhook URLs work directly and receive readable messages.

Add endpoints under Webhooks in the dashboard. Statuses in detail: query status.