Developers

Build an alert rule via the API

Alert rules notify you the moment something changes, a citation lost, share of voice dropped, a spike in crawl errors. You can build them in the admin, or via the API for automation.

Via the API

POST to /wp-json/citetrack/v1/alert-rules with a JSON body:

{ "metric": "share_of_voice", "condition": "drops_below", "threshold": 25, "window": "7d", "scope": {"engine": "gemini"}, "channels": ["email"] }

Fields: metric (e.g. share_of_voice, citation_count, crawl_errors), condition (drops_below, rises_above, changes_by), threshold, window (the period to evaluate), optional scope (prompt, page, crawler, AI service, engine or source slice), and channels (email, webhook, Slack).

Use scope to reduce noise

A site-wide rule is useful for big movement. A scoped rule is better for purchase-critical pages and prompts: only the pricing page, only a named crawler, only Gemini answers, only a specific buyer question, or only a source/opportunity workflow.

Test before you trust it

Call /alert-rules/{id}/test to dry-run the rule against current data and see whether it would fire, no notification is sent. Once it behaves, enable it. For a head start, /alert-rules/templates returns ready-made rules (lost-citation, SoV-drop, crawl-error-spike) you can instantiate as-is.

Configure channel destinations (notification email, webhook/Slack URL) under CiteTrack AI → Alerts first, or the rule fires with nowhere to send.

← All articles