Webhook Endpoints
Webhook Endpoints — methods, parameters, and examples for easy-sdk (gem).
Manages the webhook endpoints registered on your account — the URLs Easy Labs POSTs events to. For verifying inbound deliveries see Webhooks; this resource is for endpoint CRUD plus delivery-history reads.
Accessed via client.webhooks.
Methods
register(url:, events: ["*"])
POST /webhooks. Returns the registered endpoint including
secret — the HMAC signing key. The secret is returned only on
creation; capture and store it immediately.
endpoint = client.webhooks.register(
url: "https://example.com/webhooks/easy",
events: ["payment.created", "subscription.*"]
)
ENV["EASY_WEBHOOK_SECRET"] = endpoint[:secret] # store this securelylist
GET /webhooks.
client.webhooks.listupdate(id, **body)
PATCH /webhooks/:id. Common updates: active:, events:, url:.
client.webhooks.update("wh_…", active: false)delete(id)
DELETE /webhooks/:id.
client.webhooks.delete("wh_…")list_deliveries(**query)
GET /webhooks/deliveries. Every delivery across all endpoints. Query
params (e.g. success: false, limit: 50) are passed through.
client.webhooks.list_deliveries(success: false, limit: 50)list_endpoint_deliveries(endpoint_id, **query)
GET /webhooks/:id/deliveries. Deliveries scoped to one endpoint.
client.webhooks.list_endpoint_deliveries("wh_…", limit: 50)Object shape
Endpoint — :id, :url, :events, :active, :secret (only on
create), :created_at, …
Delivery — :id, :endpoint_id, :event_type, :status_code,
:success, :response_body, :attempts, :delivered_at, …
Examples
Register and persist the secret
endpoint = client.webhooks.register(url: "https://example.com/webhooks/easy")
SecretStore.write(:easy_webhook_secret, endpoint[:secret])Triage failed deliveries
failed = client.webhooks.list_deliveries(success: false, limit: 100)[:data] || []
failed.each { |d| WebhookFailureMailer.alert(d).deliver_later }Disable an endpoint temporarily
client.webhooks.update("wh_…", active: false)
# …investigate / fix the receiver…
client.webhooks.update("wh_…", active: true)