Skip to main content
POST
/
v1
/
alerts
Create Alert
curl --request POST \
  --url https://api.mixpeek.com/v1/alerts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "notification_config": {
    "channels": [
      {
        "channel_type": "<string>",
        "channel_id": "wh_safety_team",
        "config": {
          "url": "https://example.com/webhook"
        }
      }
    ],
    "include_matches": true,
    "include_scores": true,
    "template_id": "<string>"
  },
  "description": "Alerts when new videos match known safety incidents",
  "source": "retriever",
  "retriever_id": "ret_safety_search",
  "trigger_on": "results",
  "system_condition": {
    "params": {}
  },
  "namespace_selector": {
    "mode": "all",
    "namespace_ids": [
      "<string>"
    ]
  },
  "enabled": true,
  "metadata": {}
}
'
{
  "name": "<string>",
  "notification_config": {
    "channels": [
      {
        "channel_type": "<string>",
        "channel_id": "wh_safety_team",
        "config": {
          "url": "https://example.com/webhook"
        }
      }
    ],
    "include_matches": true,
    "include_scores": true,
    "template_id": "<string>"
  },
  "alert_id": "<string>",
  "namespace_id": "ns_production",
  "description": "Alerts when new videos match known safety incidents",
  "source": "retriever",
  "retriever_id": "ret_safety_search",
  "trigger_on": "results",
  "system_condition": {
    "params": {}
  },
  "namespace_selector": {
    "mode": "all",
    "namespace_ids": [
      "<string>"
    ]
  },
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

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.

name
string
required

Human-readable name for the alert

Required string length: 1 - 200
Examples:

"Safety Incident Detector"

"Prohibited Content Alert"

notification_config
AlertNotificationConfig · object
required

How and where to send notifications when alert triggers

Example:
{
"channels": [
{
"channel_id": "wh_safety_team",
"channel_type": "webhook"
},
{
"channel_id": "sl_alerts",
"channel_type": "slack"
}
],
"include_matches": true,
"include_scores": true
}
description
string | null

Optional description of what this alert monitors

Maximum string length: 1000
Example:

"Alerts when new videos match known safety incidents"

source
enum<string>
default:retriever

Trigger source: 'retriever' (runs a retriever) or 'system' (built-in metric)

Available options:
retriever,
system
retriever_id
string | null

ID of the retriever to execute (source=retriever only). The retriever defines filters, scoring, limits.

Example:

"ret_safety_search"

trigger_on
enum<string>
default:results

source=retriever: fire on 'results' or 'no_results'

Available options:
results,
no_results
system_condition
SystemCondition · object | null

Built-in data-plane condition to watch (source=system only)

namespace_selector
NamespaceSelector · object | null

Org-level namespace scoping (all vs selected)

enabled
boolean
default:true

Whether the alert is active and will execute

metadata
Metadata · object | null

Additional user-defined metadata for the alert

Response

Successful Response

Response model for a single alert.

name
string
required

Human-readable name for the alert

Required string length: 1 - 200
Examples:

"Safety Incident Detector"

"Prohibited Content Alert"

notification_config
AlertNotificationConfig · object
required

How and where to send notifications when alert triggers

Example:
{
"channels": [
{
"channel_id": "wh_safety_team",
"channel_type": "webhook"
},
{
"channel_id": "sl_alerts",
"channel_type": "slack"
}
],
"include_matches": true,
"include_scores": true
}
alert_id
string

Unique identifier for the alert

Example:

"alt_abc123xyz789"

namespace_id
string | null

Namespace this alert belongs to

Example:

"ns_production"

description
string | null

Optional description of what this alert monitors

Maximum string length: 1000
Example:

"Alerts when new videos match known safety incidents"

source
enum<string>
default:retriever

Trigger source: 'retriever' (runs a retriever) or 'system' (built-in metric)

Available options:
retriever,
system
retriever_id
string | null

ID of the retriever to execute (source=retriever only). The retriever defines filters, scoring, limits.

Example:

"ret_safety_search"

trigger_on
enum<string>
default:results

For source=retriever: fire on 'results' (matches found) or 'no_results' (retriever went dark).

Available options:
results,
no_results
system_condition
SystemCondition · object | null

Built-in data-plane condition to watch (source=system only)

namespace_selector
NamespaceSelector · object | null

Org-level namespace scoping (all vs selected). When omitted, the alert is scoped to its own namespace_id.

enabled
boolean
default:true

Whether the alert is active and will execute

created_at
string<date-time> | null

Timestamp when the alert was created

updated_at
string<date-time> | null

Timestamp when the alert was last updated

metadata
Metadata · object

Additional user-defined metadata for the alert