Docs Overview

HeadlessAnalytics Documentation

HeadlessAnalytics is the API-first operating intelligence layer for agentic companies. It tracks what happens across digital products, physical identifiers, enterprise systems, AI agents, workflows, campaigns, decisions, proofs, and outcomes, then makes that intelligence available to agents and operators through API, SDK, CLI, MCP, webhooks, OpenAPI, exports, and optional dashboards.

Operating Intelligence Model

A normal analytics platform asks what happened. HeadlessAnalytics asks what happened, what it changed in the operating graph, what an agent should know next, whether a recommendation is consequential, and what proof should be generated.

Workspace

The tenancy boundary for keys, events, entities, dashboards, connectors, decisions, proof trails, and exports.

Business

A graph node representing a company, brand, client, location, product line, or operating unit. Every workspace has a default business.

Event

The atomic fact: something happened, caused by an actor, against an object, in a source/context, with properties and outcomes.

Trackable

A generated or external identifier for QR codes, barcodes, RFID tags, sensors, robots, agents, MCP servers, and CLI workflows.

Operating Graph

Events become entities, relationships, attribution touchpoints, agent runs, workflow runs, decisions, receipts, proofs, and outcomes.

Full Hypervisor

The governance layer for consequential actions: DecisionObject, AuthorityGrant, ContextContract, attestation, receipt, and proof.

Full glossary with all terms →

Quickstart

Use the API directly, or configure the SDK, CLI, and MCP server around the same API key. The dashboard is useful for setup and operations, but it is not required for daily execution.

Canonical event envelope (HA public dialect)
curl -X POST https://api.headlessanalytics.com/api/ingest \
  -H "Authorization: Bearer ha_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "event": "qr.bottle_scanned",
    "businessId": "default",
    "traceId": "trace_spring_launch",
    "actor": { "type": "customer", "id": "anon_123" },
    "object": { "type": "product", "id": "olive-oil-500ml" },
    "source": { "channel": "qr", "campaign": "spring-launch" },
    "attribution": { "source": "qr", "campaign": "spring-launch" },
    "trackable": { "kind": "qr_code", "code": "ethiopia-bag-001" },
    "context": { "surface": "bag", "region": "northeast" },
    "properties": { "sku": "olive-oil-500ml", "lot": "L2026-04" },
    "trustTier": "T2"
  }'

This is the HA public dialect. The ROIzilla canonical shape uses id, type, organization_id, workspace_id, and schema_version fields internally.

End-to-End Flow

A DTC brand ships 10,000 bags of single-origin coffee, each with a QR code. Their growth agent provisions the tracking plan, generates identifiers, and begins operating. No dashboard. No manual setup. The agent seeds, tracks, queries, decides, enforces, and exports — entirely headlessly.

End-to-end without opening the dashboard
ha tracking-plan-create '{"name":"Roast & Origin","vertical":"dtc_commerce_ops"}'
ha create-trackable qr_code "Ethiopia Single-Origin Bag" https://roastandorigin.com/ethiopia
ha use ethiopia-bag-001 qr_scan '{"sku":"ETH-250G","lot":"L2026-04","campaign":"spring-launch"}'
ha track order.created '{"revenue":22,"source":"bag_qr","campaign":"spring-launch"}'
ha agent-context recommend_next_actions '{"businessId":"default","limit":250}'
ha graphql 'query Ops { businessHealth { healthScore revenue nextActions } attribution { bySource byCampaign } }'
ha decision-create campaign.scale '{"status":"approved","risk":"medium"}'
ha enforce '{"action":"campaign.scale","amount":500,"currency":"USD"}' '{"decisionObjectId":"..."}'
ha proof-export '{"title":"Campaign scale proof","receiptIds":["..."]}'

What To Track

Track every event that changes state, creates context, influences revenue, modifies risk, or helps an agent decide what should happen next.

Websites and ecommerce
Mobile apps and portals
QR codes and barcodes
RFID, sensors, and robotics
AI agents and copilots
CLI, MCP, and SDK workflows
Ads, marketplaces, email, and affiliates
CRMs, payments, accounting, and field ops

QR Codes, Barcodes, RFID, Sensors, And Robotics

Trackables let enterprises generate and observe identifiers that exist outside your website. A QR code on a bottle, an RFID tag in a warehouse, a barcode on packaging, a sensor ping, a robot action, and an MCP tool call can all become first-class events in the same operating graph.

Generate and use a QR-backed trackable
ha create-trackable qr_code "Single-Origin Coffee Bag" https://roastandorigin.com/ethiopia
ha use ethiopia-bag-001 qr_scan '{"sku":"ETH-250G","lot":"L2026-04"}'
ha metric-query '{"eventName":"qr.bag_scanned","limit":500}'

MCP For Agentic Work

The MCP server gives agents governed tools for tracking, querying metrics, reading business health, getting agent context, querying GraphQL, checking usage, recommending actions, creating decisions, enforcing actions, and exporting proof trails.

Claude Desktop / agent config
{
  "mcpServers": {
    "headlessanalytics": {
      "command": "npx",
      "args": ["-y", "@headlessanalytics/mcp"],
      "env": {
        "HA_API_KEY": "ha_live_...",
        "HA_API_URL": "https://api.headlessanalytics.com"
      }
    }
  }
}

CLI

The CLI is built for operators, CI jobs, local scripts, and agent shells. It can generate trackables, query intelligence, process alerts, pull connectors, enforce actions, and export packets.

Common commands
ha health default
ha usage
ha agent-context recommend_next_actions '{"limit":250}'
ha graphql 'query Ops { businessHealth { healthScore revenue nextActions } }'
ha funnel-query '[{"name":"Scan","event":"qr.bottle_scanned"},{"name":"Order","event":"order.created"}]'
ha decision-create campaign.scale '{"status":"approved","risk":"medium"}'
ha enforce '{"action":"campaign.scale","amount":500}' '{"decisionObjectId":"..."}'
ha destination-export bigquery '{"limit":500,"config":{"projectId":"analytics-prod","datasetId":"ha","tableId":"events"}}'

SDKs And Agent Frameworks

First-party clients are available for TypeScript/JavaScript, Python, Go, and Ruby. The TypeScript SDK also exposes OpenAI tool schemas and dependency-free LangChain, LlamaIndex, and AutoGPT hooks.

TypeScript SDK
const ha = new HeadlessAnalytics({ writeKey: process.env.HA_API_KEY! });
await ha.track("order.created", { properties: { revenue: 149 } });
const health = await ha.getBusinessHealth("default");
const usage = await ha.getApiUsage();
const tools = ha.openAITools();
const callbacks = [ha.langChainCallbackHandler({ agentId: "growth-agent" })];

Enterprise Connectors

Connector ingestion normalizes external records into events, entities, attribution, sync records, and health state. Supported providers include Salesforce, HubSpot, Shopify, Stripe, Amazon, Walmart, QuickBooks, Xero, NetSuite, Google Ads, Meta Ads, GA4, Resend, YouTube, Twitch, Discord, TikTok, Roblox, Fortnite, ServiceNow, Jira, Asana, Linear, Procore, ServiceTitan, Fieldwire, QR.io, RFID, sensors, robotics, and generic records.

Full Hypervisor Governance

Analytics can recommend actions, but consequential execution should route through governance. The enforcement flow validates API access, DecisionObject state, authority grants, context contracts, trust tier, compliance mapping, and attestation evidence before returning `allow`, `deny`, `escrow`, or `needs_human_approval`.

DecisionObject

AuthorityGrant

ContextContract

EnforcementReceipt

Exports And Destinations

Export bounded operating graphs, proof trails, or event batches to GraphNative, SovereignProof, Snowflake, BigQuery, Redshift, S3, GCS, or custom HTTPS endpoints. Every external push records a receipt with destination, status, request ID, response status, external ID, error, and payload hash.

Acceptance Stories

Marco, DTC brand operator

Every bottle carries a QR code. Every scan feeds attribution. Every order traces back to a campaign. His agents optimize spend, flag anomalies, and route scale decisions through governance — all without Marco logging into a dashboard.

Loic, creator game studio

Asset launches across Roblox and Fortnite. YouTube performance. Merch drops. Streaming spikes. His copilot reads the operating graph, recommends when to promote, and exports proof trails when partner royalties are due.

Ryan, electrical contractor

Leads become takeoffs. Takeoffs become scheduled jobs. Jobs track crews, inventory, and field photos. When a job runs over, his hypervisor flags it before the invoice goes out — and routes the replan through governed approval.

Endpoint Map

POST/api/ingestCanonical event ingestion.
POST/api/trackablesCreate QR, barcode, RFID, sensor, robot, agent, MCP, or CLI identifiers.
POST/api/trackRecord a generated trackable usage event.
POST/api/connectors/ingestNormalize records from enterprise systems into the event graph.
POST/api/metrics/queryQuery metric definitions and recent event counts.
POST/api/graphqlQuery the flexible GraphQL-compatible headless data surface.
POST/api/intelligence/agent-contextReturn agent-readable changes, anomalies, proof gaps, and next actions.
POST/api/funnels/queryCalculate conversion and workflow progression.
POST/api/attribution/queryRead attribution touchpoints by source, channel, campaign, and entity.
GET/api/businesses/{id}/healthFetch operating health and recommendations.
GET/api/usageFetch API usage metering for billing, quotas, agents, and connectors.
GET/api/healthCheck production environment readiness without exposing secrets.
POST/api/analytics/whats-changedPeriod-over-period diff with revenue deltas, event diffs, and new/disappeared event types.
POST/api/analytics/event-searchFree-text search across events, properties, and actors.
POST/api/governance/enforceAsk the Full Hypervisor for allow, deny, escrow, or approval.
POST/api/exports/destinationsExport records to warehouses, data lakes, or custom HTTPS destinations.

The machine-readable OpenAPI document is available at GET /api/openapi.

Give Your Agent a Memory.

API keys in minutes. Proof envelopes on every query. Capture canonical events from apps, agents, and trackables — headless by default.

  1. 1Create a workspace
  2. 2Get API keys
  3. 3Send your first event