trackr.link has four ways in for code and agents: the Payments API for your backend, the collect endpoint the tracking script sends events to, the form endpoint your website's forms post to, and the MCP server for coding agents. The OpenAPI document at https://trackr.link/openapi.json describes the three HTTP endpoints, with an operation id, a description and a schema for every request and response.
Authentication
The Payments API takes the API token of one site as a bearer token. Create it on the site's Revenue settings in trackr.link. It reports payments for that site only, and a new token replaces the old one.
The MCP server takes a personal API token, created at https://app.trackr.link/settings/api-tokens. It acts with the permissions of the person who created it.
The collect endpoint needs no token. It accepts a hit only when the Origin header, or the Referer header, is on one of the site's domains. The form endpoint needs no token either, and stores a post from another domain as spam.
Record a payment
POST https://app.trackr.link/api/payments records a payment or a refund from any provider. It counts toward the visitor's latest visit in the 24 hours before the payment, so the dashboard shows revenue per channel, source and campaign.
curl https://app.trackr.link/api/payments \
-H "Authorization: Bearer $TRACKR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"transaction_id": "order_1001", "amount": 49.00, "currency": "USD", "visitor_id": "<window.trackr.visitor>"}'
| Field | Required | Description |
|---|---|---|
transaction_id |
Yes | Your provider's id for the payment, up to 255 characters. A repeated id is recorded once. |
amount |
Yes | The amount in the currency's main unit, such as 49.00, with up to 4 decimals. |
currency |
Yes | The three-letter ISO 4217 code, such as USD. |
visitor_id |
No | The 32-character value of window.trackr.visitor in the browser. Without it no visit is matched. |
occurred_at |
No | When the payment happened, as a date and time. Defaults to now. |
email |
No | The payer's email address. |
refund |
No | true when the transaction is a refund. |
The answer is 201 with the payment's id and matched_by (api or unmatched) for a new payment, and 200 for a transaction_id recorded before, so a retry is safe. A missing or unknown token answers 401, and an invalid field 422 with the errors of each field.
Send events
The tracking script sends every pageview, custom event and engagement time to POST https://app.trackr.link/api/collect. Send custom events through the script rather than to the endpoint:
window.trackr('event', 'Signup', { plan: 'free' });
Or mark an element, and each click on it sends the event:
<button data-trackr-event="Signup" data-trackr-prop-plan="free">Sign up</button>
Every hit that passes validation answers 202, whether it was stored or dropped, so the script never learns why a hit was left out. The body may be at most 8 KB, and each site may send 600 hits a minute. The install guides show how to add the script to each platform.
Send a form
Each form in trackr.link has an endpoint at https://forms.trackr.link/f/YOUR_FORM_ID, with its own id in place of YOUR_FORM_ID. A plain HTML form, a fetch call or a server posts to it, and each submission becomes a lead. The form endpoint reference lists its body types, fields, answers, spam checks and limits.
MCP server
Coding agents such as Claude Code and Codex connect to the MCP server at https://app.trackr.link/mcp over Streamable HTTP, with a personal API token as the bearer token. It creates sites, goals, funnels and forms and lists the events a site has received. Its server card, which describes the endpoint and its authentication before a client connects, is at https://app.trackr.link/mcp/server-card. Read more about the MCP server.
claude mcp add --transport http --scope user trackr \
https://app.trackr.link/mcp \
--header "Authorization: Bearer YOUR_API_TOKEN"
What is not in the API yet
There is no REST API for reading statistics or managing links yet. Read statistics in the dashboard, or export them as CSV files.