Docs / API: Alert rules
Delete a rule
Deletes the rule and its delivery log.
DELETE/api/v1/rules/{id}
| Property | Value |
|---|---|
| Authentication | Required. Send Authorization: Bearer <key>. |
| Rate-limit cost | 1 unit |
| Status | Live |
#Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Rule id. |
#Request
curl -s -X DELETE "https://farbeamlabs.com/api/v1/rules/<id>" \
-H "Authorization: Bearer $FARBEAM_KEY"const res = await fetch("https://farbeamlabs.com/api/v1/rules/<id>", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.FARBEAM_KEY}` }
});
const { data, meta, error } = await res.json();
if (error) throw new Error(`${error.code}: ${error.message}`);
console.log(data);import os, requests
res = requests.delete(
"https://farbeamlabs.com/api/v1/rules/<id>",
headers={"Authorization": f"Bearer {os.environ['FARBEAM_KEY']}"},
timeout=30,
)
body = res.json()
if "error" in body:
raise RuntimeError(body["error"]["code"])
print(body["data"])You can send this request now in the API playground.
#Errors
| HTTP | Code | Meaning |
|---|---|---|
| 401 | missing_key | The request has no key. |
| 404 | not_found | The item does not exist. |
All errors share one format. See errors.