ThoughtMetric

ThoughtMetric API

A read-only REST API for your marketing attribution data. Pull the same performance, channel, campaign, product, customer and order figures that power your dashboard into your own warehouse, reporting stack or spreadsheets.

Base URL

Every endpoint below is relative to this base. All requests are GET and return JSON.

Base URL
https://thoughtmetric.io/api/v1

Authentication

Authenticate with a bearer token in the Authorization header. Your API key lives in the dashboard under Configure → API, together with the Project ID you will pass as projectId.

Header
Authorization: Bearer 2019962dcf7a7b1fedc4563b9aaf9fc87426f278

Keys are scoped to an organization. A request for a project that does not belong to your organization returns 401 Unauthorized, the same as a missing or invalid key. Treat your key as a secret: it grants read access to all of your organization's data, so keep it server-side rather than in browser or mobile code.

Identifying a store

Every endpoint needs a projectId, which tells the API which store to report on. Pass your Project ID, which looks like ID-bcd0aa692ce7e6b2 and is shown on the API settings page. The older numeric project ID is still accepted, so existing integrations keep working.

Common parameters

These are accepted by every endpoint. Individual endpoints may add more.

projectId string, required The Project ID of the store you are querying.
startDate string, required Start of the reporting window, YYYY-MM-DD. Inclusive.
endDate string, required End of the reporting window, YYYY-MM-DD. Inclusive.
interval string, required Bucket size for time series: day, week, month or year. Required on every endpoint, though endpoints without an over_time series ignore it.
model string, optional Attribution model: first, last, position, linearNonDirect or linearPaid. Defaults to the model configured on the project. Endpoints reporting blended totals ignore it.
Six month limit. The window between startDate and endDate may not exceed six months. Longer ranges are rejected with a 422. Page through long histories with successive requests.

Rate limits

Requests are limited to 15 per minute per API key. Going over returns 429 Too Many Requests.

Errors

Errors come back with a matching HTTP status and, apart from rate limiting, a JSON body with a single error key.

401 Unauthorized Missing, malformed or unknown API key, or the key's organization does not own the requested project.
422 Unprocessable Entity A required parameter is missing, the projectId does not resolve to a project, the interval is not one of day/week/month/year, or the date range exceeds six months.
429 Too Many Requests Rate limit exceeded. Retry after a short pause.
500 Internal Server Error Something went wrong on our side. Retry, and contact support if it persists.
422 response
{
  "error": "Invalid interval: valid values are day, week, month, year"
}