Inbound OTP delivery-receipt (DLR) webhook
/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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | Yes | Your 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
| Field | Type | Required | Description |
|---|---|---|---|
MessageSid | string | No | Twilio message id. Alternatives auto-detected: message_id, messageId, request_id, requestId, id. |
MessageStatus | string | No | Delivery status. Alternatives auto-detected: status, dlr_status, data.status. |
ErrorCode | string | No | Optional carrier error. Alternatives: ErrorMessage, error, reason. |
Responses
| Status | Description |
|---|---|
| 200 | Receipt accepted and the matching OTP log was updated. |
| 202 | Acknowledged but not actionable (no message reference, or an unknown reference). Returned 2xx so the gateway stops retrying. |
| 404 | Unknown or invalid webhook token — no tenant matched. |