Skip to main content

Webhooks

Register HTTPS endpoints to receive real-time notifications when memory events occur. Supports raw JSON, Slack, and Discord payload formats.

Base URL: https://novyx-ram-api.fly.dev

Tier: Pro+


Create Webhook

POST /v1/webhooks

Register a new webhook endpoint to receive memory events.

Request body

ParameterTypeRequiredDefaultDescription
urlstringYesHTTPS URL to receive events
eventsstring[]YesEvent types to subscribe to
descriptionstringNoHuman-readable description (max 200 chars)
formatstringNo"raw"Payload format: raw, slack, or discord

Response fields

FieldTypeDescription
webhook_idstringUnique webhook identifier
urlstringRegistered URL
eventsstring[]Subscribed event types
activebooleanWhether the webhook is active
descriptionstring | nullDescription
formatstringPayload format
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

Examples

from novyx import Novyx

nx = Novyx(api_key="nram_your_key")

webhook = nx.create_webhook(
url="https://example.com/hooks/novyx",
events=["memory.created", "memory.deleted", "rollback.completed"],
description="Production memory alerts",
)
print(webhook["webhook_id"])

Response

{
"webhook_id": "wh_a1b2c3d4",
"url": "https://example.com/hooks/novyx",
"events": ["memory.created", "memory.deleted", "rollback.completed"],
"active": true,
"description": "Production memory alerts",
"format": "raw",
"created_at": "2026-03-09T12:00:00Z",
"updated_at": "2026-03-09T12:00:00Z"
}

Errors

StatusCodeCause
403FEATURE_NOT_AVAILABLERequires Pro+ plan
422VALIDATION_ERRORInvalid URL (must be HTTPS) or empty events list

List Webhooks

GET /v1/webhooks

List all registered webhooks.

Response fields

FieldTypeDescription
webhooksarrayArray of webhook objects
total_countnumberTotal webhooks

Examples

result = nx.list_webhooks()
for wh in result["webhooks"]:
print(f"{wh['webhook_id']}: {wh['url']} ({', '.join(wh['events'])})")

Get Webhook

GET /v1/webhooks/{webhook_id}

Retrieve a single webhook by ID.

Path parameters

ParameterTypeDescription
webhook_idstringWebhook identifier

Examples

webhook = nx.get_webhook("wh_a1b2c3d4")
print(f"Active: {webhook['active']}")

Errors

StatusCodeCause
404NOT_FOUNDWebhook does not exist

Update Webhook

PUT /v1/webhooks/{webhook_id}

Update a webhook. Send only the fields you want to change.

Path parameters

ParameterTypeDescription
webhook_idstringWebhook identifier

Request body

ParameterTypeRequiredDescription
urlstringNoNew HTTPS URL
eventsstring[]NoUpdated event types
activebooleanNoEnable or disable
descriptionstringNoUpdated description (max 200 chars)
formatstringNoPayload format: raw, slack, or discord

Examples

updated = nx.update_webhook(
"wh_a1b2c3d4",
events=["memory.created", "memory.updated", "memory.deleted"],
format="slack",
)

Errors

StatusCodeCause
404NOT_FOUNDWebhook does not exist
422VALIDATION_ERRORInvalid URL or event types

Delete Webhook

DELETE /v1/webhooks/{webhook_id}

Delete a webhook and stop receiving events.

Path parameters

ParameterTypeDescription
webhook_idstringWebhook identifier

Examples

result = nx.delete_webhook("wh_a1b2c3d4")
print(result["success"]) # True

Response

{
"success": true,
"webhook_id": "wh_a1b2c3d4"
}

Errors

StatusCodeCause
404NOT_FOUNDWebhook does not exist

Delivery History

GET /v1/webhooks/{webhook_id}/deliveries

View recent delivery attempts for a webhook.

Path parameters

ParameterTypeDescription
webhook_idstringWebhook identifier

Query parameters

ParameterTypeRequiredDefaultDescription
limitnumberNo20Max results (1–100)

Response fields

FieldTypeDescription
deliveriesarrayArray of delivery records
total_countnumberTotal deliveries

Each delivery includes:

FieldTypeDescription
delivery_idstringDelivery identifier
event_typestringEvent that triggered the delivery
status_codenumberHTTP response status
successbooleanWhether delivery succeeded
attemptnumberAttempt number
errorstring | nullError message if failed
created_atstringISO 8601 timestamp

Examples

deliveries = nx.webhook_deliveries("wh_a1b2c3d4", limit=10)
for d in deliveries["deliveries"]:
status = "ok" if d["success"] else f"failed ({d['error']})"
print(f"{d['event_type']}: {status}")

Response

{
"deliveries": [
{
"delivery_id": "del_x1y2z3",
"event_type": "memory.created",
"status_code": 200,
"success": true,
"attempt": 1,
"error": null,
"created_at": "2026-03-09T14:30:00Z"
}
],
"total_count": 24
}