Update a rule
Change any field. Only the fields sent change. A rule that lost its last channel was disabled. Enabling it again needs channel_ids in the same request (400 invalid_rule otherwise).
curl -X PATCH "https://mythic-analytics.gulp.workers.dev/client/v1/alerts/rules/123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"enabled": false
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/alerts/rules/123e4567-e89b-12d3-a456-426614174000"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"enabled": false
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/alerts/rules/123e4567-e89b-12d3-a456-426614174000", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"enabled": false
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"enabled": false
}`)
req, err := http.NewRequest("PATCH", "https://mythic-analytics.gulp.workers.dev/client/v1/alerts/rules/123e4567-e89b-12d3-a456-426614174000", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/alerts/rules/123e4567-e89b-12d3-a456-426614174000')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"enabled": false
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"name": "John Doe",
"sources": [
"contracts"
],
"location_ids": [
"example_string"
],
"min_severity": "info",
"channel_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"notify_on_resolve": true,
"enabled": true,
"id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/client/v1/alerts/rules/{id}Target server for requests. Edit to use your own host.
Agency key (ak_) only; a location secret key (sk_) gets 403 agency_required. Agency-wide scoped keys (mcp_) are accepted and need alerts:read or alerts:write. Keys are server-side credentials; this surface serves no CORS headers.
ak_) only; a location secret key (sk_) gets 403 agency_required. Agency-wide scoped keys (mcp_) are accepted and need alerts:read or alerts:write. Keys are server-side credentials; this surface serves no CORS headers.The media type of the request body
Empty or omitted = every source.
Client ids. Empty or omitted = every client, including ones added later. Agency-level alerts (quota) only match rules that cover every client.
The default, info, receives every alert. drift and 80% quota raise only info.
Required on create, at least one. Channels must belong to the agency.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Agency key (ak_) only; a location secret key (sk_) gets 403 agency_required. Agency-wide scoped keys (mcp_) are accepted and need alerts:read or alerts:write. Keys are server-side credentials; this surface serves no CORS headers.
Path Parameters
Body
Empty or omitted = every source.
Client ids. Empty or omitted = every client, including ones added later. Agency-level alerts (quota) only match rules that cover every client.
The default, info, receives every alert. drift and 80% quota raise only info.
infowarningcriticalRequired on create, at least one. Channels must belong to the agency.