mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-24 22:45:56 +03:00
[PR #1260] [CLOSED] Add API endpoint to clear a check's events #1101
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#1101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/healthchecks/healthchecks/pull/1260
Author: @gniting
Created: 2/1/2026
Status: ❌ Closed
Base:
master← Head:add-clear-events-api📝 Commits (1)
8c451bcAdd API endpoint to clear a check's events📊 Changes
9 files changed (+522 additions, -2 deletions)
View changed files
➕
hc/api/tests/test_clear_events.py(+92 -0)📝
hc/api/urls.py(+5 -0)📝
hc/api/views.py(+23 -0)📝
templates/docs/api.html-fragment(+62 -0)📝
templates/docs/api.md(+72 -0)📝
templates/docs/apiv1.html-fragment(+62 -0)📝
templates/docs/apiv1.md(+72 -1)📝
templates/docs/apiv2.html-fragment(+62 -0)📝
templates/docs/apiv2.md(+72 -1)📄 Description
This PR adds a new Management API endpoint to clear a check's events, mirroring the existing "Clear Events" functionality available in the web interface.
Endpoint: POST
/api/v{1,2,3}/checks/<uuid>/events/clearDetails → This endpoint resets a check's state and removes all associated event data:
newlast_ping,last_start,last_duration,alert_afternewstate (clears all ping-related metadata, deletes pings, notifications, and flips)The implementation matches the behavior of the web UI's "Clear Events" action (hc/front/views.py:858-875).
Changes
hc/api/urls.py- Added routehc/api/views.py- Added clear_events viewhc/api/tests/test_clear_events.py- Added 8 test casestemplates/docs/api*.mdandtemplates/docs/api*.html-fragment- Added documentation for v1, v2, and v3Testing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.