{"openapi":"3.0.3","info":{"title":"Prometheus AlertManager API","description":"AlertManager handles alerts sent by Prometheus and routes them to the appropriate\nnotification channels based on configurable rules. This API provides programmatic\naccess to alert management, silences, and status information.\n\n**Base URL**: `https://alertmanager.haiven.site/api/v2`\n\n**Authentication**: None required for internal access\n\n**Related Documentation**:\n- [AlertManager README](/mnt/apps/docker/infrastructure/alertmanager/README.md)\n- [AlertManager User Guide](/mnt/apps/docker/infrastructure/alertmanager/USER_GUIDE.md)\n","version":"0.28.0","contact":{"name":"Haiven Infrastructure"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"}},"servers":[{"url":"https://alertmanager.haiven.site/api/v2","description":"Public AlertManager API (Traefik, Let's Encrypt TLS)"},{"url":"http://alertmanager:9093/api/v2","description":"Docker internal access"}],"tags":[{"name":"General","description":"General status and health endpoints"},{"name":"Alerts","description":"Alert management operations"},{"name":"Silences","description":"Silence management operations"},{"name":"Receivers","description":"Receiver configuration"}],"paths":{"/status":{"get":{"tags":["General"],"summary":"Get AlertManager status","description":"Returns the current status of the AlertManager cluster including version info and uptime","operationId":"getStatus","responses":{"200":{"description":"AlertManager status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertmanagerStatus"},"example":{"cluster":{"name":"","status":"ready","peers":[]},"versionInfo":{"branch":"HEAD","buildDate":"2024-01-01T00:00:00Z","buildUser":"root@localhost","goVersion":"go1.21.0","revision":"abc123","version":"0.28.0"},"uptime":"2024-01-15T10:30:00.000Z","config":{"original":""}}}}}}}},"/alerts":{"get":{"tags":["Alerts"],"summary":"List active alerts","description":"Returns a list of all currently active alerts","operationId":"getAlerts","parameters":[{"name":"active","in":"query","description":"Show active alerts","schema":{"type":"boolean","default":true}},{"name":"silenced","in":"query","description":"Show silenced alerts","schema":{"type":"boolean","default":true}},{"name":"inhibited","in":"query","description":"Show inhibited alerts","schema":{"type":"boolean","default":true}},{"name":"unprocessed","in":"query","description":"Show unprocessed alerts","schema":{"type":"boolean","default":true}},{"name":"filter","in":"query","description":"A list of matchers to filter alerts by","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"receiver","in":"query","description":"A regex matching receivers to filter alerts by","schema":{"type":"string"}}],"responses":{"200":{"description":"List of alerts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GettableAlert"}},"example":[{"annotations":{"description":"Disk space on /dev/sda1 is at 92%","summary":"Disk space low on haiven-server"},"endsAt":"2024-01-15T12:00:00.000Z","fingerprint":"abc123def456","receivers":[{"name":"storage-alerts"}],"startsAt":"2024-01-15T10:00:00.000Z","status":{"inhibitedBy":[],"silencedBy":[],"state":"active"},"updatedAt":"2024-01-15T10:00:00.000Z","generatorURL":"https://prometheus.haiven.site/graph","labels":{"alertname":"DiskSpaceLow","severity":"warning","instance":"haiven-server:9100","device":"/dev/sda1"}}]}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}},"post":{"tags":["Alerts"],"summary":"Create new alerts","description":"Create new alerts or update existing ones","operationId":"postAlerts","requestBody":{"description":"Alerts to create","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PostableAlert"}},"example":[{"labels":{"alertname":"TestAlert","severity":"warning"},"annotations":{"summary":"This is a test alert","description":"Testing AlertManager notification"},"startsAt":"2024-01-15T10:00:00.000Z","endsAt":"2024-01-15T11:00:00.000Z"}]}}},"responses":{"200":{"description":"Alerts created successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/alerts/groups":{"get":{"tags":["Alerts"],"summary":"List alert groups","description":"Returns a list of alert groups","operationId":"getAlertGroups","parameters":[{"name":"active","in":"query","description":"Show active alerts","schema":{"type":"boolean","default":true}},{"name":"silenced","in":"query","description":"Show silenced alerts","schema":{"type":"boolean","default":true}},{"name":"inhibited","in":"query","description":"Show inhibited alerts","schema":{"type":"boolean","default":true}},{"name":"filter","in":"query","description":"A list of matchers to filter alerts by","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"receiver","in":"query","description":"A regex matching receivers to filter alerts by","schema":{"type":"string"}}],"responses":{"200":{"description":"List of alert groups","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertGroup"}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/silences":{"get":{"tags":["Silences"],"summary":"List silences","description":"Returns a list of all silences (active and expired)","operationId":"getSilences","parameters":[{"name":"filter","in":"query","description":"A list of matchers to filter silences by","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}],"responses":{"200":{"description":"List of silences","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GettableSilence"}},"example":[{"id":"550e8400-e29b-41d4-a716-446655440000","status":{"state":"active"},"updatedAt":"2024-01-15T10:00:00.000Z","comment":"Planned maintenance","createdBy":"admin","endsAt":"2024-01-15T12:00:00.000Z","matchers":[{"isEqual":true,"isRegex":false,"name":"alertname","value":"DiskSpaceLow"}],"startsAt":"2024-01-15T10:00:00.000Z"}]}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}},"post":{"tags":["Silences"],"summary":"Create a silence","description":"Create a new silence to suppress matching alerts","operationId":"postSilences","requestBody":{"description":"Silence to create","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostableSilence"},"example":{"matchers":[{"name":"alertname","value":"DiskSpaceLow","isRegex":false,"isEqual":true}],"startsAt":"2024-01-15T10:00:00.000Z","endsAt":"2024-01-15T12:00:00.000Z","createdBy":"admin","comment":"Planned disk maintenance"}}}},"responses":{"200":{"description":"Silence created","content":{"application/json":{"schema":{"type":"object","properties":{"silenceID":{"type":"string","description":"The ID of the created silence"}}},"example":{"silenceID":"550e8400-e29b-41d4-a716-446655440000"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"string"}}}},"404":{"description":"Silence not found (for updates)","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/silences/{silenceID}":{"get":{"tags":["Silences"],"summary":"Get a silence by ID","description":"Returns a single silence by its ID","operationId":"getSilence","parameters":[{"name":"silenceID","in":"path","description":"ID of the silence","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Silence details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GettableSilence"}}}},"404":{"description":"Silence not found"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}},"delete":{"tags":["Silences"],"summary":"Delete (expire) a silence","description":"Expires a silence by its ID, effectively deleting it","operationId":"deleteSilence","parameters":[{"name":"silenceID","in":"path","description":"ID of the silence to expire","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Silence expired successfully"},"404":{"description":"Silence not found"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/receivers":{"get":{"tags":["Receivers"],"summary":"List receivers","description":"Returns a list of all configured receivers","operationId":"getReceivers","responses":{"200":{"description":"List of receivers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Receiver"}},"example":[{"name":"default"},{"name":"critical"},{"name":"warning"},{"name":"gpu-alerts"},{"name":"storage-alerts"},{"name":"service-alerts"}]}}}}}}},"components":{"schemas":{"AlertmanagerStatus":{"type":"object","properties":{"cluster":{"$ref":"#/components/schemas/ClusterStatus"},"versionInfo":{"$ref":"#/components/schemas/VersionInfo"},"config":{"$ref":"#/components/schemas/AlertmanagerConfig"},"uptime":{"type":"string","format":"date-time"}}},"ClusterStatus":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["ready","settling","disabled"]},"peers":{"type":"array","items":{"$ref":"#/components/schemas/PeerStatus"}}}},"PeerStatus":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"}}},"VersionInfo":{"type":"object","properties":{"version":{"type":"string"},"revision":{"type":"string"},"branch":{"type":"string"},"buildUser":{"type":"string"},"buildDate":{"type":"string"},"goVersion":{"type":"string"}}},"AlertmanagerConfig":{"type":"object","properties":{"original":{"type":"string"}}},"GettableAlert":{"type":"object","required":["labels","receivers","fingerprint","startsAt","updatedAt","endsAt","status"],"properties":{"annotations":{"type":"object","additionalProperties":{"type":"string"}},"receivers":{"type":"array","items":{"$ref":"#/components/schemas/Receiver"}},"fingerprint":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"$ref":"#/components/schemas/AlertStatus"},"labels":{"type":"object","additionalProperties":{"type":"string"}},"generatorURL":{"type":"string","format":"uri"}}},"PostableAlert":{"type":"object","required":["labels"],"properties":{"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"annotations":{"type":"object","additionalProperties":{"type":"string"}},"labels":{"type":"object","additionalProperties":{"type":"string"}},"generatorURL":{"type":"string","format":"uri"}}},"AlertStatus":{"type":"object","required":["state","silencedBy","inhibitedBy"],"properties":{"state":{"type":"string","enum":["unprocessed","active","suppressed"]},"silencedBy":{"type":"array","items":{"type":"string"}},"inhibitedBy":{"type":"array","items":{"type":"string"}}}},"AlertGroup":{"type":"object","required":["labels","receiver","alerts"],"properties":{"labels":{"type":"object","additionalProperties":{"type":"string"}},"receiver":{"$ref":"#/components/schemas/Receiver"},"alerts":{"type":"array","items":{"$ref":"#/components/schemas/GettableAlert"}}}},"GettableSilence":{"type":"object","required":["id","status","updatedAt","matchers","createdBy","comment","startsAt","endsAt"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/SilenceStatus"},"updatedAt":{"type":"string","format":"date-time"},"matchers":{"type":"array","items":{"$ref":"#/components/schemas/Matcher"}},"createdBy":{"type":"string"},"comment":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}}},"PostableSilence":{"type":"object","required":["matchers","startsAt","endsAt","createdBy","comment"],"properties":{"id":{"type":"string","format":"uuid","description":"If provided, updates an existing silence"},"matchers":{"type":"array","items":{"$ref":"#/components/schemas/Matcher"}},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"comment":{"type":"string"}}},"SilenceStatus":{"type":"object","required":["state"],"properties":{"state":{"type":"string","enum":["expired","active","pending"]}}},"Matcher":{"type":"object","required":["name","value","isRegex"],"properties":{"name":{"type":"string","description":"Label name to match"},"value":{"type":"string","description":"Label value to match"},"isRegex":{"type":"boolean","description":"Whether the value is a regex pattern"},"isEqual":{"type":"boolean","description":"Whether this is an equality or negative match","default":true}}},"Receiver":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the receiver"}}}}}}