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"]
})
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
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 update(MillionSend.Client.t(), String.t(), map()) :: {:ok, MillionSend.Webhooks.Webhook.t()} | {:error, MillionSend.Error.t()}
PATCH /webhooks/:id — endpoint, events, status (:enabled | :disabled).