API
The v1 API exposes a set of read-only endpoints for your analytics data, each gated by an API key bound to your workspace. This page covers everything: creating a key, authentication, the shared parameters, every endpoint, errors, and the llms.txt manifest.
The API is read-only: you use it to fetch your own analytics data, never to send data in.
Using AI to build it for you
Most people who use this API will have an AI write the code for them. For that you need an agentic coding tool that can actually create files and run commands on your computer: Claude Code or Codex. A regular chat like ChatGPT or Claude in the browser or the desktop app will not work for this, because it can only talk, not build or run anything.
Open Claude Code or Codex in an empty folder, copy this whole page with the button below, paste it in, and tell it what you want (for example, "fetch my revenue for last month and save it to a CSV"). Everything it needs to write and run the script is on this page: how to create a key, how to authenticate, the parameters, and every endpoint with example requests and responses.
Then paste it into Claude Code or Codex and tell it what data you want.
Creating an API key
API keys live in your account settings, not in a site's settings. From the dashboard:
- Open Account Settings (the org switcher is at the top left).
- In the left navigation, click Account.
- Scroll to the API Keys card.
- Under Create API Key, type a name (use something that tells you where the key is used, like
reporting-script) and click Create.
The new key appears under Your API Keys with its name, a masked preview of the key, and when it was created. Copy the full key when it is shown; for security only a masked preview is kept after that.
Account Settings
Manage your personal account settings
API Keys
Create API Key
Generate API keys to access analytics endpoints from your applications
Your API Keys
Keys are scoped to one workspace and inherit your site access, so a key can only read sites you can already see. Click Delete next to a key to revoke it; revocation is immediate.
Base URL
https://api.truemetriks.com/v1
Authentication
Every request requires an Authorization header with your key as a Bearer token:
Authorization: Bearer YOUR_API_KEY
A missing or invalid key returns 401. A valid key requesting a site you cannot access returns 403.
Common query parameters
Every endpoint accepts these:
| Param | Required | Description |
|---|---|---|
| site_id | yes | The site you are querying |
| start_date | yes | ISO 8601 date (e.g. 2026-05-01) |
| end_date | yes | ISO 8601 date (e.g. 2026-05-19) |
| timezone | no | IANA timezone for date bucketing (default: site timezone) |
| attribution | no | last_touch (default), first_touch, linear, time_decay |
| filters | no | JSON-encoded array of filter objects |
Endpoints
All endpoints are GET and read-only. GET /v1/overview returns the top-line totals for the period (the same headline numbers as the dashboard Main page); the endpoints below add detail, parameters, and breakdowns.
GET /v1/revenue
Revenue totals plus an optional daily time series and breakdowns by source, page, or product.
Parameters (common params plus):
| Param | Description |
|---|---|
| bucket | day (default), week, month for the time series |
| group_by | source, campaign, page, product (optional) |
| limit | Max rows in the group_by breakdown (default 50, max 500) |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/revenue?site_id=42&start_date=2026-05-01&end_date=2026-05-19&group_by=source&bucket=day"
{
"total_revenue": 48210.00,
"currency": "USD",
"conversions": 312,
"aov": 154.52,
"series": [
{ "date": "2026-05-01", "revenue": 2410.00, "conversions": 14 },
{ "date": "2026-05-02", "revenue": 3120.00, "conversions": 19 }
],
"breakdown": [
{ "source": "facebook / spring_sale_2026", "revenue": 18440.00, "conversions": 112, "aov": 164.64 },
{ "source": "google / brand_search", "revenue": 12210.00, "conversions": 88, "aov": 138.75 }
]
}
GET /v1/leads
A paginated list of Lead events with source, form, and conversion status.
Parameters (common params plus):
| Param | Description |
|---|---|
| page | Page number, 1-based (default 1) |
| page_size | Rows per page (default 50, max 500) |
| converted | true or false to filter on conversion status |
| form | Filter to a specific form name |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/leads?site_id=42&start_date=2026-05-01&end_date=2026-05-19&page_size=100"
{
"total": 1842,
"page": 1,
"page_size": 100,
"leads": [
{
"captured_at": "2026-05-19T14:20:31Z",
"email": "[email protected]",
"phone": null,
"source": "facebook / spring_sale_2026",
"form": "Typeform - Pre-call",
"converted": true,
"ltv": 189.00,
"first_purchase_at": "2026-05-19T14:22:08Z"
}
]
}
GET /v1/pages
Page-level traffic, conversions, conversion rate, and attributed revenue.
Parameters (common params plus):
| Param | Description |
|---|---|
| sort | revenue (default), views, cvr |
| page | Page number, 1-based |
| page_size | Rows per page (default 50, max 500) |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/pages?site_id=42&start_date=2026-05-01&end_date=2026-05-19"
{
"total": 1280,
"pages": [
{ "path": "/landing-a", "views": 5210, "conversions": 142, "cvr": 0.0273, "revenue": 21940.00 },
{ "path": "/pricing", "views": 3914, "conversions": 98, "cvr": 0.0250, "revenue": 15140.00 }
]
}
GET /v1/products
Per-product units, revenue, and AOV, plus ROAS when a Facebook catalog is connected. Covers any Purchase event that shipped content_ids.
Parameters (common params plus):
| Param | Description |
|---|---|
| sort | revenue (default), units, aov |
| limit | Max rows (default 50, max 500) |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/products?site_id=42&start_date=2026-05-01&end_date=2026-05-19"
{
"products": [
{
"content_id": "sku-pro-plan-yearly",
"name": "Pro plan (yearly)",
"units": 142,
"revenue": 26838.00,
"aov": 189.00,
"ad_spend": 8420.00,
"roas": 3.19
}
]
}
GET /v1/users
A paginated list of identified users (those who have called identify with at least an email) with sessions, orders, and LTV.
Parameters (common params plus):
| Param | Description |
|---|---|
| sort | ltv (default), last_seen, first_seen |
| page | Page number, 1-based |
| page_size | Rows per page (default 50, max 500) |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/users?site_id=42&start_date=2026-01-01&end_date=2026-05-19&sort=ltv"
{
"total": 8420,
"users": [
{
"user_id": "auth_uid_42",
"email": "[email protected]",
"first_seen": "2026-02-14T11:02:00Z",
"last_seen": "2026-05-19T14:22:08Z",
"sessions": 18,
"orders": 4,
"ltv": 782.00,
"first_source": "facebook / spring_sale_2026"
}
]
}
GET /v1/funnels
Saved funnels with per-step counts and conversion rates, with optional variant splits.
Parameters (common params plus):
| Param | Description |
|---|---|
| funnel_id | If set, returns just one funnel's full detail |
| split_by | Variant property to split steps by (e.g. landing) |
curl -H "Authorization: Bearer $TM_API_KEY" \
"https://api.truemetriks.com/v1/funnels?site_id=42&start_date=2026-05-01&end_date=2026-05-19"
{
"funnels": [
{
"funnel_id": 17,
"name": "Checkout funnel",
"steps": [
{ "name": "Landing page", "match": "page:/", "count": 12400, "rate": 1.0 },
{ "name": "Product view", "match": "event:ViewContent", "count": 7936, "rate": 0.640 },
{ "name": "Add to cart", "match": "event:AddToCart", "count": 3472, "rate": 0.280 },
{ "name": "Checkout started", "match": "event:InitiateCheckout", "count": 1116, "rate": 0.090 },
{ "name": "Purchase", "match": "event:Purchase", "count": 508, "rate": 0.041 }
]
}
]
}
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | AUTH_REQUIRED | No Authorization header |
| 401 | INVALID_API_KEY | Key not found, expired, or revoked |
| 403 | SITE_ACCESS_DENIED | Key valid but caller has no access to site_id |
| 400 | BAD_REQUEST | Missing or malformed parameter |
| 429 | RATE_LIMITED | Per-key rate limit hit; retry after the indicated delay |
Rate limits
100 requests per minute per key. Brief bursts up to 200 are accepted. The Retry-After header on a 429 response tells you when to retry.
llms.txt
For LLM crawlers and code-completion tools, we publish a flat, summary-only index of this docs site at:
https://docs.truemetriks.com/llms.txt
It includes one line per docs page (title, URL, one-sentence description) and the /v1/* endpoints with their methods, paths, and required parameters, plus a pointer to the marketing-site llms.txt. It excludes long-form page bodies, the blog, and any anonymized customer data. The file regenerates on every docs deploy, and is byte-identical to the previous deploy when nothing changed.
Frequently asked questions
Is the API read-only?
Yes. The API is read-only: you use it to fetch your own analytics data, never to send data in. All endpoints are GET.
Where do I create an API key?
API keys live in your account settings, not a site's settings. Open Account Settings, click Account in the left navigation, scroll to the API Keys card, and create a key. Keys are scoped to one workspace and inherit your site access.
What are the rate limits?
100 requests per minute per key, with brief bursts up to 200 accepted. A 429 response includes a Retry-After header telling you when to retry.