Authentication
API keys (Public Metrics API)
Section titled “API keys (Public Metrics API)”The versioned /api/v1/* endpoints on the web app authenticate with long-lived AnswerixAI API keys (prefix ans_), created under Settings → MCP & API Keys in the dashboard:
curl "https://app.answerixai.com/api/v1/brands" \ -H "Authorization: Bearer ans_..."This is the right choice for external integrations — Looker Studio, Sheets, scripts, and the MCP server. See the Metrics API reference for the endpoint list.
App sign-in (OAuth) for the MCP server
Section titled “App sign-in (OAuth) for the MCP server”AI apps such as Claude and ChatGPT can connect to the MCP endpoint, https://app.answerixai.com/api/mcp, by signing the person in instead of with an API key. The web app is the authorization server (OAuth 2.1 with PKCE S256, as the MCP authorization spec 2025-11-25 has it), with the issuer https://app.answerixai.com:
- An app finds it from the endpoint’s
401(WWW-Authenticate: Bearer resource_metadata="https://app.answerixai.com/.well-known/oauth-protected-resource/api/mcp", scope="mcp:read mcp:write"), then/.well-known/oauth-authorization-server. - It registers with a Client ID Metadata Document or by dynamic client registration (
POST /api/oauth/register), sends the person to/api/oauth/authorize, and redeems the code at/api/oauth/token. - Scopes:
mcp:read(everylist_andget_tool) andmcp:write(every other tool), which the person can leave out on the consent page. - Access tokens (
ans_oat_…) last an hour. Refresh tokens (ans_ort_…) last 30 days and rotate on every use. Both are bound to the MCP endpoint (RFC 8707resource). - A token acts as the person who allowed it, with their role and brand access. They see and disconnect it in Settings → MCP & API Keys → Connected apps; an app revokes its own at
/api/oauth/revoke(RFC 7009).
These tokens work at /api/mcp only. The Metrics API (/api/v1/*), the REST routes under /api/mcp/… and the server’s /api/* refuse them with 401. On AnswerixAI Cloud, app sign-in needs a paid plan; API keys work on every plan. The MCP server guide has the full flow, lifetimes and errors.
Bearer token
Section titled “Bearer token”All /api/* endpoints on the AnswerixAI server require a Supabase JWT bearer token in the Authorization header:
curl https://api.your-domain.com/api/health \ -H "Authorization: Bearer <SUPABASE_JWT>"Getting a token
Section titled “Getting a token”The cleanest way is via the Supabase JS client in your own backend code:
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);const { data: { session },} = await supabase.auth.signInWithPassword({ email, password,});
const token = session.access_token;The web app does this automatically — every server action and fetch attaches the current session token transparently.
Cron endpoints
Section titled “Cron endpoints”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:
curl -X POST https://api.your-domain.com/api/internal/daily-tracking \ -H "Authorization: Bearer $CRON_SECRET"The same secret must be configured on both sides (Vercel env + server env).
Public endpoints
Section titled “Public endpoints”Three endpoints don’t require any auth:
GET /t.js— tracking pixel scriptPOST /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", "timestamp": "..." }
CRUD endpoints for managing brands programmatically.