A trigger runs work; its output is its run history. An alert watches a condition and sends a notification. A webhook pushes every event of the types you subscribe to; the change feed holds the same events for you to pull.
Create an alert
An alert runs a retriever against your content and notifies you when the result meets its condition. Attached to a collection, it checks every new document as it is processed. Prerequisites: a collection that processes documents, and a retriever that returns what you want to hear about. For “notify me when a document lands in a category”, the retriever needs no embeddings: a singleattribute_filter stage on the field your taxonomy writes is enough, because taxonomies run before alerts.
1
Create the alert
2
Attach it to a collection
Add it to the collection’s
alert_applications, mapping document fields to the retriever’s inputs:cURL
source_type is document_field (a dot path on the document) or constant (a fixed value).3
Process documents
Upload objects as usual. After each batch, the alert runs once per new document in parallel, and sends one notification if any document matched.
Conditions
A threshold field can be a top-level key such as
score or an aggregate column, a dot path such as metadata.price, or a bare name looked up in the row’s metadata. A missing field or a value of another type does not fire. A retriever that ends in an aggregate stage returns groups as rows, so min_count: 3 means three groups. min_count or threshold with trigger_on: no_results returns 422 naming the field. A run that errors or returns degraded neither fires a no_results alert nor clears one. last_fired_at on the alert shows when it last notified.
inputs is how a time window works on every path: a retriever filter on {{time_ago(minutes=INPUT.window_minutes)}} with "inputs": {"window_minutes": 60} looks back one hour.
When an alert is evaluated
execution_mode on the application is on_ingest (default), scheduled or on_demand.
on_ingestevaluates the alert as each batch is processed.- Every alert that is not
on_demandis also evaluated by a background sweep. It runs after an alert is created, changed or deleted, and after a batch completes, at most once every 30 minutes. An alert that depends on the clock (no_results, a threshold, a cooldown, a re-notify interval or a templated input) is swept every 30 minutes. A document written through the API outside a batch reaches the sweep within 6 hours. - To evaluate on your own schedule, create a trigger with
action_type: "alert_evaluation"(below). While it is active, the sweep skips that alert in that namespace. on_demandalerts never run automatically.
Notification channels
Process matches into another collection with the batch channel
Process matches into another collection with the batch channel
After the batch that fired the alert completes, Mixpeek submits one batch per source bucket holding the objects whose documents matched. Output documents keep lineage back to those objects; list capture fields such as
captured_at in the target collection’s field_passthrough to copy them.The target must read from a bucket that holds the matched objects, must be user-defined (names starting
_ or mxp_ are system collections), and must differ from the watched collection. A missing collection_id, an unknown key or a bad dedup_strategy returns 422 on save; the three target conditions are checked when the alert fires.The batch that fires the alert must leave the target out. A batch created without collection_ids covers every collection on the bucket, the target included, so with dedup_strategy: skip the follow-up batch skips those objects. Uploads through POST /v1/buckets/{bucket_identifier}/objects?auto_process=true and POST /v1/buckets/{bucket_identifier}/objects/batch?auto_process=true create that kind of batch. To test the channel, create the batch with POST /v1/buckets/{bucket_identifier}/batches and list collection_ids without the target.Each follow-up batch records its origin in additional_data.triggered_by_alert. If it cannot start, Mixpeek sends an alert.execution.failed event with the reason, after retrying transient errors 3 times.Check it worked
GET /v1/alerts/{alert_id}/executions lists each run with triggered, match_count, duration_ms and per-channel deliveries:
cURL
Default alerts
Every new organization gets one system alert per built-in condition, across all its namespaces. They email the organization’snotifications_email, which starts as the signup address; change it with PATCH /v1/organizations.
List them with
GET /v1/organizations/alerts and switch one with PATCH /v1/organizations/alerts/{alert_identifier} and {"enabled": false}. A default you change or disable is not recreated. Each condition is evaluated by a saved retriever named system-<condition> (for example system-collection-stale) and tagged system-alert; run it like any retriever to see what meets the condition now. Mixpeek never overwrites one you edited.
Run work on a schedule with triggers
A trigger combines an action with a schedule. This one re-runs a cluster every night at 02:00 UTC:cURL
trigger_type: "event" is in the schema and rejected at create: nothing emits the events it would wait for yet. Use a short interval meanwhile.
With taxonomy_enrichment, set incremental: true to process only documents added since the last run, so you do not pay again for documents already labeled.
Manage triggers with POST /v1/triggers/list, GET, PATCH and DELETE /v1/triggers/{trigger_id}, POST /v1/triggers/{trigger_id}/pause and /resume. Run one now with POST /v1/triggers/{trigger_id}/execute, and read what ran and what failed with GET /v1/triggers/{trigger_id}/history.
Clusters also have their own triggers under /v1/clusters/triggers; see Keep clusters current.
Receive events with webhooks
A webhook is defined for the organization and POSTs each event of the types you subscribe to.cURL
channel is webhook, slack or email. Create and update refuse URLs that can never receive a delivery, such as example.com or .test and .invalid hosts.
Events
The full list is theWebhookEventType enum in Create webhook. Each resource also has .created, .updated and .deleted events, and clusters, triggers and alerts have .execution.completed and .execution.failed.
To receive runs of some primitives only, add
"resource_types": ["retriever"] alongside "event_types": ["resource.executed", "resource.execution_failed"]. The filter applies to every event type; for per-kind events the resource type is the first part of the name. A finished batch sends one resource.executed per collection it wrote, with resource_type collection and the batch id as execution_id, and its credits split evenly across them. A retriever’s resource.executed carries pinned_revision.config, the exact stages, collection_ids and input_schema that ran; send them to POST /v1/retrievers/execute (with collection_ids as collection_identifiers) to rerun that version.
Payload and headers
Delivery body
X-Mixpeek-Event (the event type) and X-Mixpeek-Event-Id (the same on a retry, so you can drop duplicates). cache_scope (collection, namespace or key) tells you which retriever caches to invalidate.
Verify a delivery
With asigning_secret, every delivery carries X-Mixpeek-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256>. The HMAC is over <t>. followed by the raw body, keyed by your secret. Recompute it over the raw bytes before parsing JSON, compare in constant time, and reject timestamps more than 300 seconds from your clock.
verify_signature.py
redacted. To also gate access with a credential your endpoint already checks, add it under configs.headers, for example {"Authorization": "Bearer <token>"}. Mixpeek sends header values exactly as stored and returns them in plain text when you read the webhook; it does not mint or refresh tokens. A header you set with the same name as one of Mixpeek’s replaces it.
Delivery behavior
- Mixpeek retries with exponential backoff until your endpoint returns
2xx. Return200within 10 seconds and do heavy work in the background. - Handlers must be idempotent; deduplicate on
event_id. - After 30 failed deliveries in a row spanning at least two hours, Mixpeek pauses the webhook (
is_active: false, withpaused_reason) and alerts your organization. Any success resets the count. Update the webhook to turn it back on. - A batch submitted with its own
webhook_urlgets one unsignedPOSTwithbatch_id,status,documents_written,progressandcompleted_atwhen it ends, retried 3 times (after 2, 4 and 8 seconds) on5xxor429. For an authenticated callback, subscribe tocollection.documents.batch_completedinstead.
Pull events from the change feed
GET /v1/events returns your organization’s events in order, for 90 days. You hold the position, so a consumer that stops resumes where it left off.
cURL
Response
An empty page returns the cursor you sent, so a poller can call again with the same value.
seq is monotonic per organization and orders events across namespaces. operation is insert, update, delete or other.
Batch processing writes one collection.documents.written event per flushed chunk (with batch_id, document_ids and count), emitted only after the documents are confirmed in storage. When the batch ends, one collection.documents.batch_completed per collection carries total_documents counted from the store, or null if the count failed. Delivery is at-least-once, and a chunk event can be lost if the writer dies between the storage confirm and the emit. To check completeness, compare the union of document_ids across a batch’s chunk events with total_documents; on a mismatch, list the collection’s documents filtered by that batch_id.
What goes wrong
Related
- Taxonomies and Clusters: the enrichment these tools schedule and watch
- Monitoring and troubleshooting: analytics, logs and batch diagnostics
- Create alert, Create webhook, List events in the API reference

