API Reference
Test Webhook Endpoint
Send a synthetic event to a webhook endpoint to verify wiring. The handler creates a real delivery record (with a realistic payload for the chosen event type) and hands it off to the dispatch worker. The endpoint URL receives a normal signed delivery — there is no special test header.
POST/org/webhooks/{endpoint_id}/test
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
endpoint_id | integer | required | Webhook endpoint id. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
event_type | string | optional | One of the event types the endpoint is subscribed to. Defaults to memory.created. Must be valid AND in the endpoint subscription list. |
request.json
{"event_type": "memory.created"}
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
delivery_id | integer | optional | Newly created delivery row. |
event_id | string | optional | Generated test event id (suffixed with _{endpoint_id}). |
event_type | string | optional | Echoed event type. |
endpoint_id | integer | optional | Echoed endpoint id. |
status | string | optional | Always pending at creation; the worker advances it. |
payload | object | optional | Full event envelope including the synthesised data body. |
message | string | optional | Human-readable summary. |
200.json
{"delivery_id": 9012,"event_id": "evt_test_a1b2c3d4e5f6_42","event_type": "memory.created","endpoint_id": 42,"status": "pending","payload": {"id": "evt_test_a1b2c3d4e5f6","type": "memory.created","created": "2026-05-04T12:31:00Z","data": {"memory_id": "mem_test_abc123","content": "This is a test memory created via the dashboard."}},"message": "Test event 'memory.created' dispatched. Delivery ID: 9012."}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X POST https://api.memorysync.io/org/webhooks/EXAMPLE_ID/test \-H "Authorization: Bearer $MEMORYSYNC_KEY" \-H "Content-Type: application/json" \-d '{"event_type": "memory.created"}'
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'POST',path: '/org/webhooks/EXAMPLE_ID/test',body: {"event_type": "memory.created"},})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="POST",path="/org/webhooks/EXAMPLE_ID/test",json={"event_type": "memory.created"},)print(result)
Behavior & notes
Requires owner or admin role and webhooks:write scope. Returns 400 when the endpoint is paused, 400 when event_type is unknown or not in the subscription list, and 404 when the endpoint id is not visible to the caller's organisation. Track the delivery via GET /org/webhooks/{endpoint_id}/deliveries.