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
- BYOM monitoring: Receive alerts when your own LLM credentials hit rate limits or fail, so you can respond to provider issues quickly
- Reduced polling: Eliminate the need to continuously check for updates
Setting up webhooks
Webhooks are configured per project within the Webhooks page in the Zep Dashboard sidebar.
Available events
Graph events
BYOM events
These events are specific to Bring Your Own LLM (BYOM) configurations. They notify you when requests using your own model credentials encounter rate limits or failures, so you can monitor and react to issues with your LLM provider configuration.
BYOM webhook events are aggregated rather than sent per-request. Zep accumulates events over a 60-second window and delivers a single webhook summarizing all occurrences in that period. This prevents webhook spam during bursts of errors or rate limiting.
Webhook payload schemas
Graph event payload
Graph events (episode.processed, ingest.batch.completed) include the following fields:
*Only one of graph_id or user_id will be present in a given payload, depending on the graph type.
BYOM event payload
BYOM events (byom.rate_limited, byom.request_failed) include the following fields:
BYOM error codes
The error_code field in byom.request_failed events indicates the specific failure reason:
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.
Changes to webhook configuration (including creating, updating, or deleting endpoints) take 5-10 minutes to propagate and take effect. This delay is due to a caching mechanism that ensures optimal performance across Zep’s infrastructure.
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