API Reference · Control-plane API
Manage Webhooks
Inspect one endpoint, discover event types, monitor health, pause or resume delivery, and rotate signing credentials.
Shared access contract
| Control | Required contract |
|---|---|
| Authentication | Bearer access token for an active organization member. |
| Permission | webhooks.manage capability; reads require webhooks:read and mutations require webhooks:write. |
| Project selection | Where supported, pass project_id in Python, { projectId } options in Node.js, or X-Project-ID over HTTPS. |
Get Webhook
GET/org/webhooks/{endpoint_id}
200 OK
| Field | Type | Contract |
|---|---|---|
endpoint_id | integer path | Required positive endpoint ID. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)webhook = client.get_webhook(51,project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"id":51,"name":"Production events","url":"https://hooks.example.com/memorysync","events":["memory.created"],"enabled":true,"project_id":"project_abc123"}
- The raw signing secret is never returned by this read.
| Concern | Contract |
|---|---|
| Scope | Endpoint must match the organization and selected project. |
| Errors | 401/403 access failure; 404 unavailable endpoint. |
Get Webhook Event Types
GET/org/webhooks/event-types
200 OK
| Field | Type | Contract |
|---|---|---|
| Request body | none | No path, query, or body fields. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)event_types = client.get_webhook_event_types(project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"event_types":["memory.created","memory.updated","memory.deleted"],"categories":{"memory":["memory.created","memory.updated","memory.deleted"]}}
- Use this response as the canonical subscription choices.
| Concern | Contract |
|---|---|
| Scope | Event catalog is returned in the caller’s authorized project context. |
| Errors | 401/403 access failure; 5xx catalog unavailable. |
Get Webhook Health
GET/org/webhooks/health
200 OK
| Field | Type | Contract |
|---|---|---|
| Request body | none | No path, query, or body fields. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)health = client.get_webhook_health(project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"active_webhooks":1,"total_webhooks":1,"total_deliveries_24h":240,"success_rate_7d":99.5,"failing_endpoints":0,"pending_retries":0,"dead_letter_count":0}
- Health values are operational summaries, not delivery guarantees.
| Concern | Contract |
|---|---|
| Scope | Aggregates only endpoints and deliveries in the selected project context. |
| Errors | 401/403 access failure; 5xx health aggregation unavailable. |
Pause Webhook
POST/org/webhooks/{endpoint_id}/pause
200 OK
| Field | Type | Contract |
|---|---|---|
endpoint_id | integer path | Required active endpoint ID. |
| Request body | none | No JSON body. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)webhook = client.pause_webhook(51,project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"id":51,"name":"Production events","enabled":false,"project_id":"project_abc123"}
- Use the returned endpoint state to confirm delivery is paused.
| Concern | Contract |
|---|---|
| Scope | Endpoint must match the organization and selected project. |
| Errors | 400 endpoint cannot transition; 401/403 access failure; 404 unavailable endpoint. |
Resume Webhook
POST/org/webhooks/{endpoint_id}/resume
200 OK
| Field | Type | Contract |
|---|---|---|
endpoint_id | integer path | Required paused endpoint ID. |
| Request body | none | No JSON body. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)webhook = client.resume_webhook(51,project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"id":51,"name":"Production events","enabled":true,"project_id":"project_abc123"}
- Resuming allows new deliveries; it does not replay old failures.
| Concern | Contract |
|---|---|
| Scope | Endpoint must match the organization and selected project. |
| Errors | 400 endpoint cannot transition; 401/403 access failure; 404 unavailable endpoint. |
Rotate Webhook Secret
POST/org/webhooks/{endpoint_id}/rotate-secret
200 OK
| Field | Type | Contract |
|---|---|---|
endpoint_id | integer path | Required endpoint ID. |
| Request body | none | No JSON body. |
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)webhook = client.rotate_webhook_secret(51,project_id=os.environ["MEMORYSYNC_PROJECT_ID"],)
response.json
{"id":51,"name":"Production events","secret_prefix":"whsec_efgh","secret":"<shown-once>","project_id":"project_abc123"}
- Store the new secret immediately; the raw value is shown only in this response.
| Concern | Contract |
|---|---|
| Scope | Endpoint must match the organization and selected project. |
| Errors | 401/403 access failure; 404 unavailable endpoint; 409 rotation conflict; 429 rate limited. |