Coffrify. Resources. Webhooks
(Coffrify v0.9.0)
View Source
Webhook subscriptions.
Coffrify signs every delivery with Standard Webhooks v2 (webhook-id,
webhook-timestamp, webhook-signature). Verify with
Coffrify.Webhook.Verification.verify/4.
Summary
Functions
Create a webhook subscription.
Delete a webhook subscription.
Fetch the recent delivery attempts for a webhook (debug).
List every webhook subscribed in the workspace.
Replay a past delivery. Preserves the original event_id so the
receiver can dedupe via webhook-id.
Force a non-success delivery back into the retry queue.
Rotate the webhook signing secret. Both new + previous secrets remain valid during the grace window (default 24h, max 168h).
Send a sandbox event to verify signing & URL. Receiver gets
x-coffrify-test-delivery: true.
Patch a webhook (URL, events, is_active, …).
Functions
@spec create(Coffrify.t(), map() | keyword()) :: {:ok, map()} | {:error, Exception.t()}
Create a webhook subscription.
The returned secret MUST be stored — it is only returned once.
Example
{:ok, %{"webhook" => wh, "secret" => secret}} =
Coffrify.Resources.Webhooks.create(client, %{
name: "Production",
url: "https://api.example.com/hooks/coffrify",
events: ["transfer.created", "transfer.downloaded"]
})
@spec delete(Coffrify.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}
Delete a webhook subscription.
@spec deliveries(Coffrify.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Exception.t()}
Fetch the recent delivery attempts for a webhook (debug).
@spec list(Coffrify.t()) :: {:ok, map()} | {:error, Exception.t()}
List every webhook subscribed in the workspace.
@spec replay(Coffrify.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}
Replay a past delivery. Preserves the original event_id so the
receiver can dedupe via webhook-id.
@spec retry(Coffrify.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}
Force a non-success delivery back into the retry queue.
@spec rotate_secret(Coffrify.t(), String.t(), keyword() | map()) :: {:ok, map()} | {:error, Exception.t()}
Rotate the webhook signing secret. Both new + previous secrets remain valid during the grace window (default 24h, max 168h).
@spec test(Coffrify.t(), String.t(), keyword() | map()) :: {:ok, map()} | {:error, Exception.t()}
Send a sandbox event to verify signing & URL. Receiver gets
x-coffrify-test-delivery: true.
@spec update(Coffrify.t(), String.t(), map()) :: {:ok, map()} | {:error, Exception.t()}
Patch a webhook (URL, events, is_active, …).