Webhooks
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 aggregated alerts when your LLM credentials or provider requests fail
- 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 apply to Bring Your Own LLM (BYOM) configurations. They report credential and provider failures for requests that use your credentials.
Zep aggregates BYOM webhook events instead of sending one webhook per request. Zep reports occurrences from a 60-second window in one webhook.
Webhook payload schemas
Episode processed payload
episode.processed events include the following fields:
*A payload for a user graph can include user_id. A payload for a graph with the graph type can include graph_id. Zep sends each field only when the user or graph has a developer-assigned identifier. A user or graph that the v4 API creates has no developer-assigned identifier. Its payload identifies the graph with graph_uuid and, for a user graph, with user_uuid.
Batch completion payloads
Zep sends one payload for every batch, including a batch that a deprecated batch method creates.
Batch API payload
Sent when a batch created via the Batch API finishes as succeeded, canceled, or partial from canceled items. Zep does not send this payload when a run ends as failed, or as partial because items failed. The batch_id matches the value returned by batch.create().
Example payload:
Deprecated batch methods
The deprecated graph.add_batch() and thread.add_messages_batch() methods create a Batch API batch. When that batch completes, Zep sends the Batch API payload above. The payload does not include task_id, episode_uuids, or graph identifiers. To match the payload to a call, compare batch_id with the batch_uuid value in the params of the task that the call returns.
BYOM event payload
byom.request_failed events 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 before the request times out - Disable CSRF protection for the webhook route if your framework enables it by default
Verifying webhook signatures
Verifying webhook signatures is 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 configuration caching.
Pricing
Webhook deliveries consume credits. See the Zep pricing page for costs.
Best practices
- Always verify signatures: Treat unverified webhooks as potentially malicious
- Acknowledge the request: Return a
2xxresponse before the request times out - 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