Create a new alert that monitors document ingestion and sends notifications.
Alerts attach retrievers to collections. When new documents are ingested, the alert runs the retriever and sends notifications if matches are found.
Key Components:
retriever_id: References a retriever that defines query logic (filters, scoring, limits)notification_config: Defines where to send notifications (webhook, Slack, email)Note: The retriever owns all query semantics. The alert’s job is simply to run the retriever and notify if results exist.
REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
"Bearer YOUR_API_KEY"
"Bearer YOUR_STRIPE_API_KEY"
REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'
"ns_abc123def456"
"production"
"my-namespace"
Request model to create an alert.
Creates a new alert that can be attached to collections to monitor for matching content and send notifications when matches are found.
Note: The alert references a retriever that contains all query logic (filters, min_score, limits, collection targeting). The alert's job is simply to run that retriever and notify if results exist.
Human-readable name for the alert
1 - 200"Safety Incident Detector"
"Prohibited Content Alert"
ID of the retriever to execute. The retriever defines filters, scoring, limits.
"ret_safety_search"
"ret_prohibited_content"
How and where to send notifications when alert triggers
{
"channels": [
{
"channel_id": "wh_safety_team",
"channel_type": "webhook"
},
{
"channel_id": "sl_alerts",
"channel_type": "slack"
}
],
"include_matches": true,
"include_scores": true
}Optional description of what this alert monitors
1000"Alerts when new videos match known safety incidents"
Whether the alert is active and will execute
Additional user-defined metadata for the alert
Successful Response
Response model for a single alert.
Human-readable name for the alert
1 - 200"Safety Incident Detector"
"Prohibited Content Alert"
ID of the retriever to execute. The retriever defines filters, scoring, limits.
"ret_safety_search"
"ret_prohibited_content"
How and where to send notifications when alert triggers
{
"channels": [
{
"channel_id": "wh_safety_team",
"channel_type": "webhook"
},
{
"channel_id": "sl_alerts",
"channel_type": "slack"
}
],
"include_matches": true,
"include_scores": true
}Unique identifier for the alert
"alt_abc123xyz789"
Namespace this alert belongs to
"ns_production"
Optional description of what this alert monitors
1000"Alerts when new videos match known safety incidents"
Whether the alert is active and will execute
Timestamp when the alert was created
Timestamp when the alert was last updated
Additional user-defined metadata for the alert