Webhooks let Mixpeek notify your systems when events occur in real time. Use them to trigger workflows, invalidate caches, and keep downstream systems in sync without polling.
What are webhooks?
- Outbound notifications: Mixpeek sends HTTP POST requests to your endpoints when events occur
- Low latency: Receive changes in near real time to kick off downstream jobs
- Channel-flexible: Deliver to URLs (webhook), Slack, Email, or SMS via channel configs
- Cache-aware: Events include cache invalidation scopes for maintaining consistency
Event types
Events are grouped into categories based on the resources they track:- Object Lifecycle
- Collection Lifecycle
- Taxonomy Lifecycle
- Cluster Lifecycle
object.created
✅ - New object ingested into bucketobject.updated
✅ - Object content or metadata updatedobject.deleted
✅ - Object permanently deletedobject.redacted
⏳ - PII stripped from object (planned)
Status Legend: ✅ Currently implemented | ⏳ Planned for future release
Channels
Webhook (HTTP)
POST to your HTTPS endpoint with optional custom headers and a JSON body
Slack
Notify a Slack channel via a webhook URL and template
Send email notifications with a subject/body template
SMS
Short text alerts for critical events
Delivery model
- Request: For webhook channel, Mixpeek issues an HTTP POST to your configured
url
- Headers: Optional custom headers are included (e.g., shared secret)
- Timeout: Delivery attempts honor a configurable request timeout (default 10s)
- Payload: JSON body, optionally rendered from a Jinja2
payload_template
- Success: Any 2xx response code is treated as success
Keep webhook endpoints idempotent and return quickly (e.g., enqueue work and respond 200). Long processing should happen asynchronously in your system.
Create a webhook
Use the API to register a webhook with one or more channels and event types:Standard payload structure
All webhook events follow a consistent structure:Cache invalidation scopes
Events include cache invalidation information to help maintain consistency:Scope | When Used | Example |
---|---|---|
KEY | Document-level changes (create, update, delete) | Single object modified |
COLLECTION | Collection-wide changes (config, taxonomy, ranker) | Collection settings updated |
NAMESPACE | Namespace-wide changes (model rollout) | Global model update |
Use the
cache_scope_to_invalidate
field to intelligently invalidate caches in your application.Receive webhooks (server examples)
- Node (Express)
- Python (Flask)
Event-specific examples
- Object Created
- Collection Updated
- Taxonomy Created
Security & reliability
Verify origin
Use a shared secret in headers (e.g.,
X-Mixpeek-Secret
) and verify on receiptHTTPS only
Terminate TLS and reject plain HTTP endpoints
Idempotency
Deduplicate using
event_id
to safely handle retriesFast acks
Respond 2xx quickly; do heavy work asynchronously
Best practices
Store event IDs
Persist
event_id
to deduplicate retries and track event historyUse cache scopes
Leverage
cache_scope_to_invalidate
to intelligently refresh your cachesSubscribe selectively
Only subscribe to event types your application needs to reduce noise
Monitor delivery
Track webhook delivery success rates and response times in your observability stack
Operate & monitor
- Observability: Track delivery successes/failures in your logs/metrics; correlate by
event_id
- Alerting: Page on sustained non‑2xx rates from your webhook endpoints
- Tasks: Prefer webhooks over tight polling; for long jobs, see Tasks
- Testing: Use the E2E webhook test suite for comprehensive validation
Troubleshooting
1
401/403 responses
Ensure your endpoint accepts the request and validates the shared secret correctly
2
Timeouts
Keep processing under the configured timeout; otherwise quickly ack and process async
3
Unexpected payload
If using
payload_template
, validate your template; otherwise log the raw body for inspection4
Missing events
Verify your webhook subscription includes the expected
event_types
and is is_active: true
5
Duplicate events
Events may be delivered multiple times on retry; always use
event_id
for deduplicationReferences
List Webhooks
View all webhook subscriptions for your organization
Create Webhook
Register a new webhook subscription
Get Webhook
Retrieve webhook details by ID
Update Webhook
Modify webhook configuration
Delete Webhook
Remove a webhook subscription
Tasks
Monitor asynchronous jobs that trigger webhook events
Observability
Health checks and monitoring for webhook delivery
Security
Authentication and authorization best practices