Computes the rule's current value and sends an alert_test notification to its emails and webhook. The rule's state does not change. A test event is added to the alert history.
Request#
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Alert ID, for example alert_3f9a1c7e2b8d4a6f0e1c5b92. |
The body is ignored.
Example request#
curl -X POST https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92/test \
-H "Authorization: Bearer $TRIED_API_KEY"const res = await fetch("https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92/test", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const result = await res.json();import os, requests
res = requests.post(
"https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92/test",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
result = res.json()Response#
200 OK
{
"sent": true,
"value": 1720,
"emails": [
"ops@example.com"
],
"webhook_url": "https://example.com/hooks/alerts"
}| Field | Type | Description |
|---|---|---|
sent |
boolean | Always true once the notifications were attempted. |
value |
number | Current metric value used in the message. |
emails |
string[] | Addresses the test went to. Email is sent over SMTP when SMTP_URL is set and only logged otherwise. |
webhook_url |
string or null | The rule's own webhook URL. When it is null, the test goes to the workspace webhook URL if one is set. |
The webhook body is { "event": "alert_test", "alert": { ...alert, "value", "message", "timestamp" } }. See Webhooks.
Errors#
| Status | When |
|---|---|
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the analytics scope. Dashboard users with the member role get The member role is read-only. |
404 |
No alert with that ID in the workspace: Alert <id> not found. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.
Retell compatibility#
Retell's public API reference has no alerting endpoints, so this route has no Retell SDK equivalent.