Inbound OTP delivery-receipt (DLR) webhook

POST /v1/otp/webhooks/delivery/{token}

Endpoint your SMS gateway calls with carrier delivery receipts. It lives on the central API host and identifies your tenant from the opaque `{token}` in the path (your OTP **webhook secret**), so the registered URL (e.g. https://api.affclix.com/v1/otp/webhooks/delivery/YOUR_WEBHOOK_SECRET) stays stable regardless of your subdomain. It is unauthenticated (server-to-server) — the unguessable token is the credential. Affclix matches the gateway message reference to an OTP log and advances its status (sent → delivered/failed). Field names vary by gateway; the common shapes (Twilio, MSG91, Fast2SMS, Kaleyra, Exotel) are auto-detected. Unknown payloads are acknowledged with 202 so the gateway stops retrying.

Parameters

NameInTypeRequiredDescription
tokenpathstringYesYour tenant OTP webhook secret (otp_settings.webhook_secret). Found under OTP Settings.

Request Body *

Raw DLR payload as posted by the SMS gateway (form or JSON).

Content-Type: application/json

FieldTypeRequiredDescription
MessageSidstringNoTwilio message id. Alternatives auto-detected: message_id, messageId, request_id, requestId, id.
MessageStatusstringNoDelivery status. Alternatives auto-detected: status, dlr_status, data.status.
ErrorCodestringNoOptional carrier error. Alternatives: ErrorMessage, error, reason.

Responses

StatusDescription
200Receipt accepted and the matching OTP log was updated.
202Acknowledged but not actionable (no message reference, or an unknown reference). Returned 2xx so the gateway stops retrying.
404Unknown or invalid webhook token — no tenant matched.