Alerts API for test alerts and snoozing
Alerts can be both read and changed over the API. Flaky tests, performance regressions, skipped-test creep, and failure rate spikes all surface as alerts, and the API returns each one with its event history and lets you change its state the same way the alert detail page does. What the checks look for is described in the alerts overview, and snoozing and disabling covers the states in depth. Authentication, pagination, and error codes are in the API overview.
TestNod keeps one alert per project and alert type, and adds an event to it each time the check trips. As an example, test flakiness on a single project is one alert with a long event history behind it, rather than a new alert every time flakiness turns up.
The alert object
| Field | Type | Notes |
|---|---|---|
id |
string | The alert's identifier. |
project_id |
string | The project the alert belongs to. |
alert_type |
string | performance_regression, test_flakiness, skipped_test_count_creep, or failure_rate_spike. |
name |
string | Human-readable name for the type. |
active |
boolean | Whether the check runs against new test runs. |
snoozed |
boolean | Whether notifications are currently suppressed. |
snoozed_until |
string or null | When the snooze expires. |
last_notified_at |
string or null | When a notification last went out. |
events_count |
integer | Total events ever recorded. |
created_at |
string | ISO 8601 UTC. |
updated_at |
string | ISO 8601 UTC. |
url |
string | The alert's page in the web app. |
active and snoozed are independent. Snoozing silences notifications while the check keeps running and recording events, whereas deactivating stops the check entirely.
List alerts
GET /api/v1/alerts
Lists alerts across every project in your organization, newest first, with the standard limit and cursor parameters.
| Parameter | Notes |
|---|---|
status |
active (the default), snoozed, inactive, or all. |
project_id |
Limit to one project. |
alert_type |
Limit to one alert type. |
The default matches the web app's default view: active alerts that are not currently snoozed. Pass status=all to see everything. An unknown status or alert_type returns 400, and an unknown project_id returns 404.
curl -H "Authorization: Bearer $TESTNOD_API_KEY" \
"https://testnod.com/api/v1/alerts?status=all&alert_type=test_flakiness"
{
"data": [
{
"id": "8c4d9e11-...",
"project_id": "3f1a2b7c-...",
"alert_type": "test_flakiness",
"name": "Test Flakiness",
"active": true,
"snoozed": false,
"snoozed_until": null,
"last_notified_at": "2026-08-29T22:04:10Z",
"events_count": 37,
"created_at": "2026-03-02T11:41:55Z",
"updated_at": "2026-08-29T22:04:10Z",
"url": "https://testnod.com/alerts/8c4d9e11-..."
}
],
"pagination": { "next_cursor": null, "has_more": false }
}
Get an alert
GET /api/v1/alerts/:id
Returns one alert with the same fields as the list endpoint. An id that belongs to another organization returns 404.
Alert event history
GET /api/v1/alerts/:alert_id/events
Lists the alert's events newest first. Each event records one occurrence, with the test run that triggered it embedded in full.
| Field | Type | Notes |
|---|---|---|
id |
integer | The event's identifier. |
alert_id |
string | The parent alert. |
metadata |
object | Type-specific details, such as the failing test and its failure rate. |
triggered_at |
string | When the event was recorded. |
test_run |
object | The full test run object that tripped the check. |
The metadata keys vary by alert type, and they derive from your uploaded test output, so escape them before rendering.
Snooze or disable an alert
Four actions change an alert's state, and each one returns the updated alert:
| Method | Path | Effect |
|---|---|---|
| POST | /api/v1/alerts/:id/snooze |
Suppress notifications for a fixed period. Requires duration. |
| POST | /api/v1/alerts/:id/unsnooze |
Resume notifications immediately. |
| POST | /api/v1/alerts/:id/enable |
Resume checking new test runs. |
| POST | /api/v1/alerts/:id/disable |
Stop checking new test runs. |
duration must be one of 1h, 4h, 24h, or 1w. There is no indefinite snooze, so disable the alert instead when you want to silence it without a fixed end date. A missing or unrecognized duration is rejected rather than quietly defaulted:
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": [ { "field": "duration", "message": "must be one of 1h, 4h, 24h, 1w" } ]
}
}
curl -X POST \
-H "Authorization: Bearer $TESTNOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"duration": "4h"}' \
https://testnod.com/api/v1/alerts/8c4d9e11-.../snooze
Disabling an alert leaves its event history intact, and re-enabling it resumes checking from the next test run. Neither snoozing nor disabling deletes anything.