TrueTrackedTrueTracked

API Keys

An API key lets something run against your TrueTracked data without you sitting there: an n8n workflow, a nightly script, a CI job, or your own code. These cannot complete a browser login, so they carry a key instead.

If you are connecting Claude, ChatGPT or Claude Code, you do not need a key. Those log in through the browser. See the MCP Connector guide instead.

Keys are personal, not shared team credentials. A key reads exactly the data you can already see, and it stops working the moment your access does. If someone leaves your organisation, their keys lose access to your data immediately, without anyone having to remember to revoke them.

Create a Key

  1. Open your Profile, then the API Keys tab. There is also an API Keys link in dashboard settings that takes you to the same place.
  2. Click New API key and give it a name describing where it will run, for example "n8n nightly report". The name is how you know what you are revoking six months from now.
  3. Choose when it expires. Never is the default, because an unattended job that dies at 3am with no warning is worse than a key you can revoke in one click.
  4. Copy the key. It starts with tt_.

The key is shown once. We store it hashed, so we genuinely cannot show it to you again, not even from support. If you lose it, revoke it and create another. Treat it like a password: anyone holding it can read your analytics.

The Endpoint

One URL, the same one the AI connector uses:

https://mcp.truetracked.com/mcp

Send your key as either header, whichever your tool supports. Both work exactly the same:

Authorization: Bearer tt_your_key_here

X-API-Key: tt_your_key_here

This is an MCP endpoint, not a REST API. There is no /v1/campaigns to GET. You speak the Model Context Protocol over JSON-RPC to that one URL: tools/list to see what is available, tools/call to run one. Tools like n8n handle this for you, so the raw shape below only matters if you are writing the requests yourself.

n8n

  1. Add an MCP Client Tool node.
  2. Set the endpoint to https://mcp.truetracked.com/mcp
  3. Choose Bearer authentication and paste the key, or Header authentication with the name X-API-Key and the key as the value.
  4. The node fetches the available tools automatically. Wire it into your agent or workflow as normal.

curl, or Your Own Code

List everything the connector can do:

curl https://mcp.truetracked.com/mcp \
  -H "Authorization: Bearer tt_your_key_here" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Then run one. Start with list_websites, because the website value it returns is what every other tool takes as an argument:

curl https://mcp.truetracked.com/mcp \
  -H "Authorization: Bearer tt_your_key_here" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc":"2.0","id":2,"method":"tools/call",
    "params":{"name":"list_websites","arguments":{}}
  }'

Which comes back as something like this:

{
  "websites": [
    {
      "website": "my-store",
      "name": "My Store",
      "domain": "mystore.com",
      "currency": "GBP",
      "timezone": "Europe/London",
      "role": "admin"
    }
  ]
}

From there, pass "website": "my-store" to any other tool.

The Tools

Fifteen tools, all read-only. The table below is a map so you can see what is possible. Treat tools/list as the authority, not this page: it returns the live schema for every argument, including ones added after this was written.

ToolReturnsArguments beyond website
Start here. No data, no date range, cheap.
list_websitesEvery website you can reach, with its currency and timezoneNone. Takes no arguments at all.
list_metricsEvery metric name, what it means, and which basis it comes fromsurface
list_attribution_modelsThe attribution models and lookback windows you can ask forNone.
resolve_date_rangeTurns a preset such as "last month" into real dates in the site's timezonepreset
get_connection_statusHealth of each ad platform integration, and whether a sync looks staleNone.
Store level. Fast.
get_summary_metricsRevenue, orders, spend, ROAS, MER, profit for a period, optionally against a comparison periodcompare_start_date, compare_end_date
get_summary_timeseriesThe same figures broken out one row per dayDates only.
get_platform_ad_metrics_dailyRaw daily spend, impressions, clicks and CPC as the ad platform reports them. The cheapest way to answer a platform-reported question.platform
Attribution. These are the expensive ones.
get_platform_performanceChannel by channel, with platform-reported and TrueTracked-measured side by sideplatform, breakdown, attribution_model, attribution_window
get_campaign_performanceThe same, down to campaign, ad set and adplatform, breakdown, campaign_id, adset_id, ad_id, channel_type, attribution_model, attribution_window
get_performance_timeseriesChosen metrics over time for chosen campaigns or platforms, for trendsplatforms, campaign_ids, adset_ids, ad_ids, metrics, attribution_model, attribution_window
get_creativesAd creative performance with image and video URLs. Meta only, since other platforms do not report at this level.creative_type, search, sort, limit, offset
get_ordersIndividual orders with the channels that touched themsort, financial_status, source, is_new_customer, tt_identity_id, limit, offset
get_product_performanceWhich products sold, with revenue and units. Pass a campaign_id (plus platform) for the products that campaign actually drove; leave it off for store wide best sellers.platform, campaign_id, adset_id, ad_id, attribution_model, attribution_window, limit
get_customer_journeyOne person's full path across devices and visits. Needs a tt_identity_id, which get_orders returns.tt_identity_id (required), limit

Rules that apply to every tool

  • Dates are optional. Every data tool takes start_date and end_date as YYYY-MM-DD. Omit both and you get the last 30 complete days. Give one and you must give the other.
  • Dates are in the website's own timezone, not yours and not UTC. A store in Asia/Dhaka gets its own days.
  • Maximum span is 400 days for totals-style tools, and 186 days for anything returning one row per day. Ask for more and the call is rejected rather than silently truncated.
  • Every group of numbers carries a basis saying where it came from: platform reported, TrueTracked measured, or blended store. Read it before comparing two figures. They are supposed to differ.
  • Prefer the cheap tool. If the question is "what did Meta report as my CPC", get_platform_ad_metrics_daily answers it in a fraction of a second. The attribution tools take several seconds and only one runs at a time.

A worked example

Channel performance for August, on the TrueTracked attribution model:

curl https://mcp.truetracked.com/mcp \
  -H "Authorization: Bearer tt_your_key_here" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc":"2.0","id":3,"method":"tools/call",
    "params":{
      "name":"get_platform_performance",
      "arguments":{
        "website":"my-store",
        "start_date":"2026-08-01",
        "end_date":"2026-08-31"
      }
    }
  }'

Call list_attribution_models to see the values attribution_model accepts, and list_metrics for the metric names, rather than guessing them.

Claude Code with a Key

Claude Code accepts a key, but the browser login is the better option there:

claude mcp add --transport http truetracked https://mcp.truetracked.com/mcp \
  --header "Authorization: Bearer tt_your_key_here"

Some versions of Claude Code have a bug where the header is used when checking the connection but dropped on the actual requests. The result is a connector that reports itself as connected while every question fails. If you see that, remove it and add it again without the header, then run /mcp and choose Authenticate.

Limits

  • 10 keys per person. Revoke one to create another.
  • 5 new keys per hour.
  • 60 requests per minute per key. Your plan's overall limit still applies on top, and is the one you are more likely to meet.
  • Only one heavy report runs at a time across the whole connector. Campaign and platform performance queries are genuinely expensive. If you are polling on a schedule, space the requests out rather than firing them together.

When Something Fails

ResponseWhat it means
401The key is wrong, revoked, expired, or over its per minute limit. Check you copied the whole thing, including the tt_ at the front and with no trailing space.
403The key is fine, but you are not a member of the website you asked for. Call list_websites to see what you can reach.
402The plan no longer includes analytics, or the trial ended. See pricing.
429Too many requests. Slow down and retry.
Busy, try againA heavy report was already running. Wait a few seconds and repeat the call.

Revoking a Key

Delete it from Profile > API Keys. It stops working on the very next request, with nothing cached and no delay.

Every key shows when it was last used, so an unused key or one being used when you did not expect it is easy to spot. If a key has leaked, revoke it first and investigate afterwards. Creating a replacement takes seconds.

FAQ

Can a key write or change anything?

No. The connector is read-only. There is no tool that edits settings, pauses a campaign, or touches your ad accounts, so a key cannot do those things either.

Can I give a key to a contractor or agency?

You can, but it is the wrong tool for it. A key acts as you, so it sees every website you can see. Invite them to the organisation instead and let them create their own key. Then their access, and their key, ends when you remove them.

Can I use a key with ChatGPT?

No. ChatGPT cannot send custom headers to an MCP connector at all. It uses the browser login, which works fine. See the MCP Connector guide.

Does a key expire on its own?

Only if you chose an expiry when you created it. The default is never, so an automation keeps working until you revoke the key. There is no reminder email before an expiring key stops, which is why never is the default.

What happens to my keys if I lose access to a website?

The key keeps existing but stops returning that website's data, immediately. Access is re-checked on every request rather than stored in the key, so nothing outlives your membership.