MemoryKit

Create Webhook

Register a webhook endpoint for event notifications.

POST/v1/webhooks

Request body

urlstringrequired

HTTPS endpoint URL (max 2048 chars).

eventsstring[]

Event types to subscribe to. Default: ["*"] (all).

Response

Returns 201 Created with the webhook object.

Important: The secret field is only returned on creation. Save it immediately — you'll need it to verify webhook signatures.

idstring

Webhook ID.

urlstring

The registered endpoint URL.

eventsstring[]

Subscribed event types.

secretstring

Webhook signing secret (only returned on creation).

is_activeboolean

Whether the webhook is active.

failure_countnumber

Number of consecutive delivery failures.

created_atstring

ISO 8601 timestamp.

Example response
{
  "id": "wh_abc123",
  "url": "https://example.com/webhooks/memorykit",
  "events": ["*"],
  "secret": "whsec_abc123def456...",
  "is_active": true,
  "failure_count": 0,
  "created_at": "2025-01-15T10:30:00Z"
}
const webhook = await mk.webhooks.create({
  url: "https://example.com/webhooks/memorykit",
  events: ["memory.completed", "memory.failed"],
});
// Save webhook.secret immediately!
Edit on GitHub

On this page