REST API for the CEO daily data bot. Uses Supabase REST API with
service_rolekey for full access.
https://bgxgukkriymmtlzkkjkg.supabase.co/rest/v1
All requests require these headers:
apikey: <SUPABASE_SERVICE_ROLE_KEY>
Authorization: Bearer <SUPABASE_SERVICE_ROLE_KEY>
Get the most recent audit run with overall health score.
GET /audit_runs?order=created_at.desc&limit=1
Response fields: id, run_date, score (0-100), grade (A-F), total_checks, passed_checks, failed_checks, categories (array), critical_issues (array), quick_wins (array), account_summary (object)
Example: "What's our current audit score?"
→ score: 62.5, grade: C, passed: 45/74 checks
Get pending negative keywords that need review.
GET /negative_keywords?status=eq.candidate&order=cost.desc
Response fields: id, term, campaign, match_type, category, impressions, clicks, cost, conversions, status
Example: "How many negative keywords need review?"
→ Count of candidate status rows
GET /negative_keywords?status=eq.approved&select=id,term,campaign,cost
Get search term summary for the latest audit.
GET /search_term_summaries?order=created_at.desc&limit=1
Response fields: total_terms, total_cost, total_conversions, wasted_spend, negative_candidates_count, expansion_candidates_count, category_breakdown (object)
Example: "How much are we wasting on bad search terms?"
→ wasted_spend: $894
Get recent campaign performance data.
GET /campaign_metrics?order=snapshot_date.desc&limit=50
Filter by campaign:
GET /campaign_metrics?campaign_name=eq.Non-Brand&order=snapshot_date.desc&limit=30
Response fields: snapshot_date, campaign_id, campaign_name, campaign_type, status, impressions, clicks, cost, conversions, conv_value, ctr, cpc, conv_rate, roas
GET /search_terms?term_type=eq.wasted_spend&order=cost.desc&limit=20
Or negative candidates sorted by cost:
GET /search_terms?term_type=eq.negative_candidate&order=cost.desc&limit=20
GET /keyword_action_log?order=performed_at.desc&limit=50
Response fields: action_type, term, campaign, previous_status, new_status, performed_by, performed_at
GET /push_requests?order=created_at.desc&limit=10
Response fields: status, keyword_count, pushed_count, failed_count, created_at, completed_at
GET /negative_keywords?status=eq.candidate&select=cost
Sum the cost field client-side.
GET /campaign_metrics?snapshot_date=gte.2026-03-01&snapshot_date=lte.2026-03-13
Add header: Prefer: count=exact and select=id with head=true
GET /negative_keywords?status=eq.candidate&select=id
Header: Prefer: count=exact
The count is in the Content-Range response header.
- All monetary values are in USD
costis in dollars (not micros)ctris percentage (e.g., 3.5 = 3.5%)- Dates are ISO 8601 format
- The
service_rolekey bypasses Row Level Security — keep it private