API reference

Webhook endpoints

Manage where webhooks are delivered, and inspect deliveries, from code. Everything here can also be done in Settings → Developers → Webhooks. Scope: webhooks.

The endpoint object

{
"id": "0199ed2a-…",
"url": "https://example.com/webhooks/malla",
"description": "ERP sync",
"events": ["order.paid", "order.cancelled"],
"status": "active",
"disabledReason": null,
"consecutiveFailures": 0,
"stats": { "total24h": 42, "succeeded24h": 41, "failed24h": 1, "successRate": 0.976 },
"lastDelivery": { "id": "…", "status": "succeeded", "eventType": "order.paid", "createdAt": "…", "responseStatus": 200 },
"createdBy": null,
"createdAt": "2026-10-12T15:04:05.000Z",
"updatedAt": "2026-10-12T15:04:05.000Z"
}

The signing secret is never part of the object: it's returned on creation and by reveal-secret.

GET/webhook-endpoints

All endpoints (up to 10), as { "data": [...] }.

POST/webhook-endpoints

Body
url Required. Public https URL.
events Required. Event types from the catalog, or ["*"] for all.
description Optional.

Answers 201 with { "endpoint": {...}, "secret": "whsec_..." }. Store the secret to verify signatures.

curl -X POST "https://api.malla.fun/webhook-endpoints" \
-H "Authorization: Bearer $MALLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/webhooks/malla", "events": ["order.paid", "order.cancelled"] }'

GET/webhook-endpoints/:id

Returns { "endpoint": {...} }.

PATCH/webhook-endpoints/:id

Change url, events, description or status (active / disabled). Setting status: "active" re-enables an endpoint that was disabled after repeated failures.

await malla.webhookEndpoints.update(id, { status: 'active' })

DELETE/webhook-endpoints/:id

Deletes the endpoint.

POST/webhook-endpoints/:id/reveal-secret

Returns { "secret": "whsec_..." }.

POST/webhook-endpoints/:id/roll-secret

Generates a new secret and returns it. The old one stops working immediately: deploy the new one first.

POST/webhook-endpoints/:id/test

Sends a webhook.test event to this endpoint only. Answers 202 with { "delivery": {...} }.

await malla.webhookEndpoints.sendTestEvent(id)

GET/webhook-endpoints/:id/deliveries

The delivery log, newest first.

Query
status pending, succeeded or failed.
limit 1–100, default 20.
cursor From the previous page.
{
"data": [
{
"id": "…",
"eventId": "evt_0199d6f0c2a87c3e9b1f4a5d6e7f8a9b",
"eventType": "order.paid",
"status": "failed",
"attempts": 9,
"nextAttemptAt": null,
"responseStatus": 500,
"error": null,
"createdAt": "…",
"deliveredAt": null
}
],
"nextCursor": null
}

GET/webhook-endpoints/:id/deliveries/:deliveryId

One delivery with the exact payload sent and the first 1 KB of your responseBody. Returns { "delivery": {...} }.

POST/webhook-endpoints/:id/deliveries/:deliveryId/resend

Sends the delivery again, with the same event id. Answers 202.

const { data: failed } = await malla.webhookEndpoints.listDeliveries(id, { status: 'failed' })
for (const delivery of failed)
await malla.webhookEndpoints.resendDelivery(id, delivery.id)