MemorySync
API Reference

Create Webhook

Register a webhook endpoint for the active organisation. The response includes a one-time signing secret used to verify HMAC signatures on every delivery — store it securely; the platform will not return it again.
POST/org/webhooks

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.

Request body

FieldTypeRequiredDescription
urlstringrequiredHTTPS endpoint that receives deliveries.
event_typesstring[]requirede.g. memory.created, integration.synced, billing.invoice.paid.
descriptionstringoptionalFree-form label.
activebooleanoptionalDefault true.
request.json
{
"url": "https://hooks.acme.io/memorysync",
"event_types": [
"memory.created",
"memory.forgotten"
]
}

Response

Returns 200 OK with the following body.

FieldTypeRequiredDescription
idstringoptionalEndpoint id.
urlstringoptionalEchoed delivery URL.
event_typesstring[]optionalSubscribed events.
activebooleanoptionalWhether deliveries are enabled.
secretstringoptionalOne-time HMAC signing secret. Store this.
created_atstringoptionalRFC 3339 UTC.
200.json
{
"id": "whk_01HX...",
"url": "https://hooks.acme.io/memorysync",
"event_types": [
"memory.created",
"memory.forgotten"
],
"active": true,
"secret": "whsec_aA9...",
"created_at": "2026-05-04T12:30:11Z"
}

Errors

StatusCodeDescription
400validation_errorBody or query failed schema validation. The error includes the offending field name.
401unauthenticatedMissing or invalid bearer token / API key.
403forbiddenAuthenticated principal lacks the required scope, role, or project access.
404not_foundTarget resource does not exist or is not visible to the calling tenant.
429rate_limitedPer-IP or per-route limit exceeded. Respect the Retry-After header.
500internal_errorUnhandled server error. Quote the request_id when contacting support.

Examples

cURL
curl -X POST https://api.memorysync.io/org/webhooks \
-H "Authorization: Bearer $MEMORYSYNC_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.acme.io/memorysync",
"event_types": [
"memory.created",
"memory.forgotten"
]
}'
javascript
import { MemorySync } from 'memorysync'
const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })
const result = await client.request({
method: 'POST',
path: '/org/webhooks',
body: {
"url": "https://hooks.acme.io/memorysync",
"event_types": [
"memory.created",
"memory.forgotten"
]
},
})
console.log(result)
python
from memorysync import Client
client = Client(api_key=os.environ["MEMORYSYNC_KEY"])
result = client.request(
method="POST",
path="/org/webhooks",
json={
"url": "https://hooks.acme.io/memorysync",
"event_types": [
"memory.created",
"memory.forgotten"
]
},
)
print(result)

Behavior & notes

Verify deliveries with the X-MemorySync-Signature header (HMAC-SHA256 over the raw body, hex-encoded). The secret is shown only at creation; rotate via POST /org/webhooks/{id}/rotate-secret. Failing endpoints back off automatically and auto-pause after 24h of consecutive failure.