Webhooks
Receive real-time notifications when events occur in Zep
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.
Webhooks enable event-driven architectures where your application reacts immediately to changes:
Webhooks are configured per project within the Webhooks page in the Zep Dashboard sidebar.
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.
episode.processed events include the following fields:
*Only one of graph_id or user_id will be present in a given payload, depending on the graph type.
ingest.batch.completed is fired by two different code paths and the payload differs depending on the source.
Sent when a batch created via the Batch API finishes processing. The batch_id matches the value returned by batch.create().
Example payload:
Sent when a batch submitted through the deprecated graph.add_batch() or thread.add_messages_batch() methods finishes processing. The task_id matches the task UUID returned by those calls.
*Only one of graph_id or user_id will be present in a given payload, depending on the graph type.
The presence of batch_id versus task_id is how you tell the two variants apart. New Batch API payloads include batch_id and omit graph/episode fields; legacy payloads include task_id, episode_uuids, and graph identifiers.
BYOM events (byom.rate_limited, byom.request_failed) include the following fields:
The error_code field in byom.request_failed events indicates the specific failure reason:
Your webhook endpoint must:
2xx status code (200-299) within 15 seconds to acknowledge receiptVerifying 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:
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.
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)Concatenate the svix-id, svix-timestamp, and the raw request body, separated by periods:
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.
The Webhooks tab in the Zep Dashboard provides several management features:
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.
Webhook deliveries consume credits. See the Zep pricing page for costs.
2xx response within 15 seconds to avoid timeout retriessvix-id header to deduplicateFor additional information on consuming webhooks: