Register HTTP endpoints to receive real-time delivery events such as bounces, opens, and clicks.
Summary
Functions
Create Webhook
Register an endpoint to start receiving webhook events for your organization.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.body— application/json request body usingCreateWebhookRequest. Accepted fields:"name"(string, optional) — The name of the webhook"endpointUrl"(string, required) — The endpoint URL of the webhook"status"(string, optional) — The status of the webhook."events"(list of string, required) — The event types to subscribe to
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Webhooks.create_webhook(
client,
%{
"endpointUrl" => "https://example.com/webhooks",
"events" => ["email.queued"]
}
)
Delete Webhook
Remove a webhook endpoint. No further events will be delivered to this URL.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string. The id of the webhookopts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Webhooks.delete_webhook(client, "id")
List Webhooks
Returns all registered webhook endpoints for the organization.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.params— Optional map of query parameters:"cursor"— Optional query parameter, string. Pagination cursor from a previous response"limit"— Optional query parameter, integer. Maximum number of items to return Defaults to30.
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Webhooks.list_webhooks(
client,
%{
"cursor" => "cursor",
"limit" => 30
}
)
Retrieve Webhook
Returns a webhook endpoint with its URL, subscribed events, and configuration.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string. The id of the webhookopts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Webhooks.retrieve_webhook(client, "id")
Update Webhook
Update the endpoint URL, subscribed event types, or rotate the signing secret.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string. The id of the webhookbody— application/json request body usingUpdateWebhookRequest. Accepted fields:"name"(string, optional) — The name of the webhook"endpointUrl"(string, optional) — The endpoint URL of the webhook"events"(list of string, optional) — The event types to subscribe to"status"(string, optional) — The status of the webhook."rotateSecret"(boolean, optional) — If true, a new signing secret will be generated
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Webhooks.update_webhook(
client,
"id",
%{
"name" => "Production webhook"
}
)