Webhooks. Input maps are sent as given: create/2 accepts endpoint,
events and an optional signing_secret (carry over an existing whsec_
secret so the receiver keeps verifying unchanged); update/3 accepts
endpoint, events and status.
MillionSend.Webhooks.create(%{
endpoint: "https://acme.dev/hooks/email",
events: ["email.delivered", "email.bounced"]
})Subscribable events: email.* (sent, delivered, delivery_delayed,
bounced, complained, opened, clicked), deliverability.* (warning,
paused), quota.* (warning, reached, paused), contact.* (created,
updated, deleted, unsubscribed, resubscribed, topic_opt_in,
topic_opt_out) and suppression.* (added, removed).
Summary
Functions
POST /webhooks — the response carries the signing_secret.
GET /webhooks/:id — includes the signing_secret.
GET /webhooks — accepts limit:, after:, before:.
DELETE /webhooks/:id
POST /webhooks/:id/rotate — mint a new signing secret (or install the
signing_secret: given, a whsec_ value). For overlap_hours: (0..72) the
previous secret keeps signing too: every delivery in that window carries both
signatures, so the receiver can switch at any point without a gap. Both
options are optional; the response carries the new signing_secret and
previous_secret_expires_at.
PATCH /webhooks/:id — endpoint, events, status (:enabled | :disabled).
Functions
@spec create(MillionSend.Client.t(), map()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
POST /webhooks — the response carries the signing_secret.
@spec get(MillionSend.Client.t(), String.t()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
GET /webhooks/:id — includes the signing_secret.
GET /webhooks — accepts limit:, after:, before:.
@spec list(MillionSend.Client.t() | keyword()) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}
@spec list( MillionSend.Client.t(), keyword() ) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}
@spec remove(MillionSend.Client.t(), String.t()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
DELETE /webhooks/:id
@spec rotate(String.t()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
POST /webhooks/:id/rotate — mint a new signing secret (or install the
signing_secret: given, a whsec_ value). For overlap_hours: (0..72) the
previous secret keeps signing too: every delivery in that window carries both
signatures, so the receiver can switch at any point without a gap. Both
options are optional; the response carries the new signing_secret and
previous_secret_expires_at.
MillionSend.Webhooks.rotate(id)
MillionSend.Webhooks.rotate(id, overlap_hours: 24)
@spec rotate(MillionSend.Client.t() | String.t(), String.t() | keyword()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
@spec rotate(MillionSend.Client.t(), String.t(), keyword()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
@spec update(MillionSend.Client.t(), String.t(), map()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
PATCH /webhooks/:id — endpoint, events, status (:enabled | :disabled).