Amantiz APIv2

Webhooks

Receive delivery events at an HTTPS endpoint you control.

Events

EventSent when
message.sentThe provider accepted the message
message.deliveredDelivery was confirmed
message.bouncedThe recipient address or number rejected it
message.openedE-mail was opened (when tracking is enabled)

Verifying signatures

Each request carries an Amantiz-Signature header, an HMAC-SHA256 of the raw body with your webhook secret. Compare it in constant time and reject requests older than five minutes.

import hmac, hashlib

def valid(body: bytes, header: str, secret: bytes) -> bool:
    digest = hmac.new(secret, body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(digest, header)

Retries

Respond with any 2xx status within 10 seconds. Failed deliveries are retried with exponential back-off for up to 24 hours (1 min, 5 min, 30 min, 2 h, then every 6 h).