Skip to main content
PATCH
/
v1
/
alerts
/
{alert_identifier}
Update Alert
curl --request PATCH \
  --url https://api.mixpeek.com/v1/alerts/{alert_identifier} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "retriever_id": "<string>",
  "notification_config": {
    "channels": [
      {
        "channel_id": "wh_safety_team",
        "channel_type": "webhook"
      },
      {
        "channel_id": "sl_alerts",
        "channel_type": "slack"
      }
    ],
    "include_matches": true,
    "include_scores": true
  },
  "enabled": true,
  "metadata": {}
}
'
{
  "name": "<string>",
  "retriever_id": "<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",
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "metadata": {}
}

Headers

Authorization
string

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Examples:

"Bearer YOUR_API_KEY"

"Bearer YOUR_STRIPE_API_KEY"

X-Namespace
string

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'

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Path Parameters

alert_identifier
string
required

Alert ID (alt_...) or name

Body

application/json

Request model to update an alert.

All fields are optional - provide only what you want to update. Core fields (retriever_id, notification_config) can be updated since alerts don't have join history like taxonomies.

name
string | null

Updated name for the alert

Required string length: 1 - 200
description
string | null

Updated description for the alert

Maximum string length: 1000
retriever_id
string | null

Updated retriever ID

notification_config
AlertNotificationConfig · object

Updated notification configuration

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

Updated enabled status

metadata
Metadata · object

Updated metadata

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"

retriever_id
string
required

ID of the retriever to execute. The retriever defines filters, scoring, limits.

Examples:

"ret_safety_search"

"ret_prohibited_content"

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"

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