Campaign Tracker API

Welcome to the Campaign Tracker Backend API. Below are the available endpoints.

Note: Ensure you have set the Supabase environment variables in your deployment for these endpoints to work.

Campaign Management

GET /api/campaigns

List all campaigns.

POST /api/campaigns

Create a new campaign.

curl -X POST https://campaign-tracker-backend-eight.vercel.app/api/campaigns -H "Content-Type: application/json" -d '{
    "name": "Test Campaign",
    "platform": "Google Ads",
    "status": "Active",
    "budget": 1000,
    "start_date": "2023-10-01",
    "end_date": "2023-10-31",
    "goal": "Traffic"
}'
GET /api/campaigns/<id>

Retrieve a specific campaign.

PATCH /api/campaigns/<id>

Update a campaign.

DELETE /api/campaigns/<id>

Delete a campaign.

Dashboard & Analytics

GET /api/dashboard/stats

Get aggregated dashboard statistics.

GET /api/dashboard/performance

Get monthly performance metrics for charts.

Insights

GET /api/insights/trends?query=marketing

Get trend analysis and related keywords.