Back to Nightingale

Mute rule HTTP API (for external A2A agents / when giving the user curl commands)

aiagent/skill/embedded/builtin/alert-mute-copilot/http-api.md

9.1.12.0 KB
Original Source

Mute rule HTTP API (for external A2A agents / when giving the user curl commands)

The in-app AI assistant should not use these endpoints (use the built-in FC tools). Authentication: Authorization: Bearer <token>. Route definitions are in center/router/router.go.

OperationMethodPathNotes
List (across business groups)GET/api/n9e/busi-groups/alert-mutesMutes visible to the current user; supports query search, pagination, and expired=1 to query expired ones
List (single business group)GET/api/n9e/busi-group/:id/alert-mutes
DetailGET/api/n9e/busi-group/:id/alert-mute/:amid
CreatePOST/api/n9e/busi-group/:id/alert-mutesBody is a single AlertMute JSON object
UpdatePUT/api/n9e/busi-group/:id/alert-mute/:amidSingle-object body, replaced wholesale—GET first, then modify, then PUT
Bulk field changePUT/api/n9e/busi-group/:id/alert-mutes/fieldsBody: {"ids":[...],"fields":{...}}, suitable for bulk disable/extend
DeleteDELETE/api/n9e/busi-group/:id/alert-mutesBody: {"ids":[1,2,3]}
Preview hit eventsPOST/api/n9e/busi-group/:id/alert-mutes/previewPreview the active events a mute draft would hit; run this before creating a large-scope mute
Trial runPOST/api/n9e/alert-mute-tryrunDo a match trial run with a rule draft
Bulk cleanup of expired mutesDELETE/api/n9e/alert-mutesRequires admin; asynchronously cleans up expired fixed-period mutes in the background (periodic mutes are not cleaned up)

Permissions: create/update/delete require business-group read-write permission (bgrw) + the corresponding /alert-mutes/* menu permission; listing only requires read-only.

Directly modifying the DB (last resort): table alert_mute; tags/periodic_mutes/severities/datasource_ids are JSON/serialized fields; the in-memory cache reloads automatically in ~9s, no restart needed; back up before changing.