Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
docs(api): point the tracking and auth references at real routes (#979)
Gökhan Geyik8ca6327edf3d
diff --git a/docs/api-reference/authentication.mdx b/docs/api-reference/authentication.mdxindex 0b9a69131..2db09649d 100644--- a/docs/api-reference/authentication.mdx+++ b/docs/api-reference/authentication.mdx@@ -45,10 +45,10 @@ The web app does this automatically — every server action and fetch attaches t## Cron endpoints-A handful of internal endpoints (used by Vercel Cron and Stripe success callbacks) authenticate via a shared `CRON_SECRET` instead of user tokens:+A handful of internal endpoints under `/api/internal/*` (used by Vercel Cron and the Stripe success callback) authenticate via a shared `CRON_SECRET` instead of user tokens:```bash-curl https://api.your-domain.com/cron/daily-tracking \+curl -X POST https://api.your-domain.com/api/internal/daily-tracking \-H "Authorization: Bearer $CRON_SECRET"```@@ -59,13 +59,12 @@ The same secret must be configured on both sides (Vercel env + server env).Three endpoints don't require any auth:- `GET /t.js` — tracking pixel script-- `POST /t/collect` — tracking pixel beacon (validates origin against `brand_domains`)-- `GET /healthz` (where exposed) — basic uptime check+- `POST /track/{trackingCode}` — tracking pixel beacon (the tracking code identifies the brand; rate-limited)+- `GET /` — basic uptime check, returns `{ "status": "ok", "service": "aeo-server", "mode": "cloud" | "self-hosted", "timestamp": "..." }`<Note>- The internal `/api/health` endpoint described in the routes file IS- auth-protected — by design, it returns the authenticated user's ID. For uptime- monitoring, use `/t.js` instead (returns 200 + JS content).+ The `/api/health` endpoint IS auth-protected — by design, it returns the+ authenticated user's ID. For uptime monitoring, use `GET /` instead.</Note><Carddiff --git a/docs/api-reference/tracking.mdx b/docs/api-reference/tracking.mdxindex 62a77a241..d2e1095fa 100644--- a/docs/api-reference/tracking.mdx+++ b/docs/api-reference/tracking.mdx@@ -6,26 +6,28 @@ description: "Trigger AI engine queries and inspect tracking jobs."## Trigger a tracking run```http-POST /api/tracking/start+POST /api/tracking/checkContent-Type: application/jsonAuthorization: Bearer <SUPABASE_JWT>{"brandId": "uuid",- "platforms": ["chatgpt", "gemini", "perplexity"],- "models": ["gemini-2.5-flash"]+ "promptId": "uuid"}```-Enqueues a tracking job. Returns:+`promptId` is optional — omit it to run every active prompt for the brand. The platforms and models come from the brand's own configuration, not from the request. Enqueues a tracking job. Returns:```json{"success": true,- "jobId": "job-uuid"+ "jobId": "job-uuid",+ "message": "Tracking job enqueued"}```+Errors: `400` when `brandId` is missing, `404` when the brand doesn't exist, `403` when it belongs to another organization, `409` when the brand is paused. In cloud mode the request can also return `402` (no active subscription or trial) or `429` (daily on-demand limit or cooldown reached).+## Poll job status```http@@ -37,28 +39,45 @@ Returns:```json{+ "success": true,"status": "active",- "progress": { "phase": "querying-platforms", "completed": 12, "total": 30 },+ "progress": {+ "current": 12,+ "total": 30,+ "promptText": "best running shoes for beginners",+ "model": "gemini-2.5-flash",+ "platform": "gemini"+ },"result": null,"failedReason": null}```-`status` values: `waiting`, `active`, `completed`, `failed`, `cancelled`.+`status` values: `waiting`, `active`, `completed`, `failed`, `cancelled`. `result` is only set once the job is `completed`, and `failedReason` only when it is `failed`. An unknown `jobId` returns `{ "success": true, "status": "not_found" }`.++To cancel a running job, send `DELETE /api/tracking/job/{jobId}` with the same bearer token.## Internal cron endpointThe web app's cron route (`/api/cron/daily-tracking`) calls the server's internal endpoint with a shared secret:```http-POST /cron/daily-tracking+POST /api/internal/daily-trackingAuthorization: Bearer <CRON_SECRET>```-This loops over every brand in the org, picks brands due for refresh based on `brand_platforms.check_frequency`, and enqueues tracking jobs for them.+This loops over every active (not paused) brand, skips organizations without an active subscription (cloud mode) or without the daily monitoring feature, skips brands with no active prompts, and enqueues a tracking job for the rest. Returns:++```json+{+ "success": true,+ "triggered": 4,+ "total": 5+}+```<Note>-Vercel Cron triggers `/api/cron/daily-tracking` on a schedule defined in `web/vercel.json`. To run the same flow manually for testing, hit the server endpoint directly with the cron secret.+Vercel Cron triggers `/api/cron/daily-tracking` on a schedule defined in `web/vercel.json`. Self-hosted servers run the same flow on their own built-in daily schedule. To run it manually for testing, hit the server endpoint directly with the cron secret.</Note>## Latest results