Webhooks
Receive real-time notifications when events occur in Zep
Webhooks allow your application to receive real-time notifications when specific events occur in Zep, such as when an episode finishes processing or a batch ingestion completes. Instead of polling for changes, Zep pushes event data directly to your server as HTTP POST requests.
Webhooks are only available on certain plans. See the Zep pricing page for details.
Why use webhooks
Webhooks enable event-driven architectures where your application reacts immediately to changes:
- Episode processed notifications: Trigger downstream processing when new data is added to a graph
- Batch completion alerts: Know when large data imports finish so you can start using the data
- Reduced polling: Eliminate the need to continuously check for updates
Setting up webhooks
Webhooks are configured per project in the Zep Dashboard.
Available events
Additional events will be added in the future.
Webhook payload schema
Every webhook payload includes the following fields:
*Only one of graph_id or user_id will be present in a given payload, depending on the graph type.
Receiving webhooks
Your webhook endpoint must:
- Accept HTTP POST requests
- Return a
2xxstatus code (200-299) within 15 seconds to acknowledge receipt - Disable CSRF protection for the webhook route if your framework enables it by default
Verifying webhook signatures
Verifying webhook signatures is highly recommended. Without verification, attackers could send fake HTTP POST requests to your endpoint, potentially causing your application to process fraudulent data.
Zep signs every webhook with a cryptographic signature using your endpointโs signing secret. Verifying this signature ensures that:
- The webhook genuinely came from Zep
- The payload hasnโt been tampered with in transit
Using the Svix libraries (recommended)
Zep uses Svix to manage webhooks. The easiest way to verify signatures is with the Svix client libraries.
First, install the Svix library:
Then verify incoming webhooks:
The verification process requires the raw request body exactly as received. Many web frameworks automatically parse JSON bodies, which can break signature verification. Make sure to access the raw body before any parsing middleware runs.
Manual verification
If you prefer not to use the Svix libraries, you can verify signatures manually using HMAC-SHA256.
Every webhook includes three headers for verification:
svix-id: Unique message identifiersvix-timestamp: Unix timestamp (seconds since epoch)svix-signature: Base64-encoded signatures (may include multiple, comma-separated)
Construct the signed content
Concatenate the svix-id, svix-timestamp, and the raw request body, separated by periods:
Calculate the expected signature
Use HMAC-SHA256 with your signing secret (base64-decoded, excluding the whsec_ prefix) to sign the content:
For more details on manual verification, see the Svix documentation on manual verification.
Managing webhooks
The Webhooks tab in the Zep Dashboard provides several management features:
- Disable/Enable: Temporarily stop receiving events without deleting your endpoint configuration
- Activity logs: View the history of webhook deliveries and their status
- Replay messages: Re-send failed webhooks for debugging or recovery
- Rate limiting: Configure throttling to control the rate of incoming webhooks
- Delete: Remove an endpoint entirely
Webhook configuration is project-specific. Each project has its own set of webhook endpoints and subscriptions. If you have multiple projects, youโll need to configure webhooks separately for each one.
Pricing
Webhook deliveries consume credits. See the Zep pricing page for costs.
Best practices
- Always verify signatures: Treat unverified webhooks as potentially malicious
- Respond quickly: Return a
2xxresponse within 15 seconds to avoid timeout retries - Process asynchronously: If handling takes longer than a few seconds, acknowledge receipt immediately and process the event in a background job
- Handle duplicates: Webhooks may occasionally be delivered more than once; use the
svix-idheader to deduplicate - Monitor failures: Check the activity logs in the Dashboard to identify and fix delivery issues
Further reading
For additional information on consuming webhooks:
- Why verify webhooks - Security considerations explained
- Svix webhook verification libraries - Full library documentation
- Manual verification guide - Detailed manual verification steps