# Webhooks API SUMMARY: Registri callback HTTP per eventi memory, chat e task — riceva notifiche quando i dati cambiano. KEY CONTEXT: Auth: Mind Key Register: POST /webhooks { url, events, secret? } List: GET /webhooks Get: GET /webhooks/:id Update: PUT /webhooks/:id { url?, events?, secret?, enabled? } Delete: DELETE /webhooks/:id Events: memory.*, memory.store, memory.update, memory.delete, chat.*, chat.message_received, task.*, task.created, task.completed Secret: HMAC-SHA256 signed payload, sent in X-Synapse-Signature header Pattern: register webhook → receive POST → process event → call Synapse API Webhooks API I webhook permettono di ricevere callback HTTP quando si verificano eventi in Synapse. Perfetti per attivare automazione esterna, inviare notifiche o sincronizzare con altri sistemi. Endpoint POST /webhooks Registra un nuovo webhook. [CODE BLOCK] Risposta: [CODE BLOCK] GET /webhooks Elenca tutti i webhook della mente corrente. [CODE BLOCK] GET /webhooks/:id Ottiene un singolo webhook. [CODE BLOCK] PUT /webhooks/:id Aggiorna un webhook (URL, eventi, secret o flag enabled). [CODE BLOCK] DELETE /webhooks/:id Elimina un webhook. [CODE BLOCK] Tipi di evento | Pattern | Si attiva quando | |---------|------------| | | Qualsiasi evento memory | | | Nuova memoria salvata | | | Memoria aggiornata | | | Memoria eliminata | | | Qualsiasi evento chat | | | Nuovo messaggio dall'umano | | | Qualsiasi evento task | | | Nuova attività creata | | | Attività contrassegnata come completata | | | Tutti gli eventi | Payload del webhook Quando si verifica un evento, Synapse invia una POST alla sua URL: [CODE BLOCK] Verifica della firma Se imposta un , Synapse firma ogni payload con HMAC-SHA256: [CODE BLOCK] Verifichi nel suo handler: [CODE BLOCK] Modello: sync in tempo reale [CODE BLOCK] Prossimi passi - Cron & Scheduler - Guida automazione webhook