Use the v3 REST API for new integrations. It covers campaigns, clicks, conversions, reports, attribution and other ClickServer features. The p202 CLI uses the same API. The original v1 reports endpoint remains available for older integrations.
Creating an API key
Both APIs use the same keys. Log in to Prosper202, open My Account > Personal Settings and go to the API keys section. Click Generate an API key (once you have a key, the button reads Generate key). Each key can be revealed, copied or revoked from the same section.
One key per integration
Create a separate key for every app, script or agent that calls the API. When you no longer need one, revoke its key. Revocation blocks the next request made with that key. Other keys keep working.
Keys created in Personal Settings have no scope restriction and act with the user's permissions. To limit a script or agent's access, create a scoped key with p202 user apikey create --scope or POST /api/v3/users/{id}/api-keys. A scope such as read or reports:read narrows what the key can do. Scoped keys work only with the v3 API; the v1 endpoint refuses them.
Treat keys like passwords. Anyone holding one can read your data, and a full-access key can change it.
REST API v3
The base URL is your tracking domain followed by /api/v3/:
https://your-domain.com/api/v3/
Requests and responses use JSON, with money and counts returned as numbers. Unknown body fields and invalid values return 422 with the field name; they are not silently ignored. For reports, clicks, conversions, LTV and attribution reads, time_from and time_to accept Unix seconds, a date such as 2026-10-01 (in the account’s time zone), or a time with its offset, such as 2026-10-01T09:30:00Z.
Authentication
Send your key as a bearer token in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
A missing or unknown key returns 401. Insufficient scope returns 403 with a message naming the required scope. If the user's role cannot view campaign data, reports, clicks and conversions return null for money and counts, with "masked": true, matching the web UI's restrictions. GET /api/v3/system/health and GET /api/v3/versions do not require a key.
Example: list your campaigns
curl https://your-domain.com/api/v3/campaigns \
-H "Authorization: Bearer YOUR_API_KEY"
Campaigns are returned in data. The pagination object contains total, limit and offset. Add ?limit= (50 by default, up to 500) and &offset= to page through a long list.
GET /api/v3/ with your key returns a map of every endpoint group.
What the v3 API covers
| Area | Paths under /api/v3 | What you can do |
|---|---|---|
| Setup | /campaigns, /aff-networks, /ppc-networks, /ppc-accounts, /trackers, /landing-pages, /text-ads, /rotators | Create, read, update and delete your campaign setup, including rotator rules, and get its tracking links, landing page code and postback URLs. All except rotators also support /bulk-upsert. |
| Traffic | /clicks, /conversions, /events | Read clicks, list, record and delete conversions, send events from your own backend, and perform the Update section's operations: change past click costs, record converted SubIDs and upload revenue reports. |
| Reports | /reports/summary, /reports/breakdown, /reports/timeseries, /reports/daypart, /reports/weekpart, /reports/groups | Read the data used by the report screens. |
| Attribution | /attribution/... | Models, credited reports, conversion journeys, the worker queue and exports. See Attribution below. |
| Goals | /goals | Define goals, such as an opt-in or a sale, each with its own payout, and attach them to campaigns. |
| Customer value | /ltv/... | Customers, companies, revenue, subscriptions, products, cohorts, MRR and predictions, plus outbound webhooks. |
| Forecasts | /forecast-events | Record dated events, such as a sale or a holiday, and the effect you expect them to have on your forecasts. |
| Apps | /apps | Register iOS and Android apps, read SKAdNetwork and AdAttributionKit postbacks and Android installs, and manage SKAN encodings. |
| Users | /users | Users, roles, API keys and preferences. |
| Operations | /system, /sync, /changes, /audit, /staged-changes, /capabilities | Check health, cron and errors; copy setup between installations; review proposed changes; and inspect server capabilities and the key's user, roles and scopes. |
For every endpoint's fields and options, see the API reference in the Prosper202 source for 1.9.79.
Prefer a command line?
The p202 CLI uses this API. Set the installation URL with p202 config set-url, set the API key with p202 config set-key, and check the connection with p202 whoami. Every command supports JSON output for scripts and AI agents. From 1.9.80, the CLI needs only an active free ClickServer licence on the install, with no paid subscription (1.9.78 and 1.9.79 need Prosper202 ClickServer Pro or its 7-day trial). Without one, most commands stop with exit code 6 and a hint that says what to do. The REST API is available on every installation, free or Pro.
Connect an AI assistant
From 1.9.78, AI apps that use MCP (the Model Context Protocol) can read your reports and campaign setup and, only if you allow it, propose or make changes. From 1.9.80, these connections need only an active free ClickServer licence, as the CLI does; 1.9.78 and 1.9.79 need ClickServer Pro or its trial.
- claude.ai and other hosted AI apps: add Tracking202’s connector,
https://mcp.tracking202.com/mcp, entered exactly, with/mcpat the end. In ChatGPT, turn on Developer mode under Settings › Apps & Connectors › Advanced settings first: ChatGPT adds custom connectors only in developer mode. Prosper202 for AI assistants has each app’s steps. The app sends you to your own install to sign in and approve the connection. The page shows which app is asking and where the connection goes, and you choose Read only, Read, and propose changes or Read and change. Your install must be reachable from the internet over HTTPS. - Apps on your computer (Claude Desktop, Claude Code, Cursor): run
p202 mcp.p202 mcp --read-onlyoffers only reads, andp202 --staged mcpturns every write into a proposal.
Hosted connections can read approximately 1 MB from your installation per request. Large lists or long-range forecasts may exceed that limit. The assistant is then asked to use filters, a shorter date range or fewer rows. p202 mcp on your own computer has no such limit.
Each approved connection creates an API key for your user with the access you selected. It is listed under My Account > Personal Settings > API keys labelled AI: <app> via mcp.tracking202.com. Revoke that key to disconnect the app; an app can also remove its own key. Approving a connection needs a role that can open Personal Settings, since it creates an API key. The connection can access campaigns, trackers, landing pages, traffic sources, rotators, reports, clicks and conversions within your role's permissions. It cannot access users, API keys or system settings. You apply a proposed change with p202 change apply or the /staged-changes API.
Attribution
Attribution endpoints are under /api/v3/attribution. Reading it needs the view_attribution_reports permission. Creating, changing or deleting a model also needs manage_attribution_models. A scoped key needs attribution:read to read and attribution:write to make changes.
| Method | Endpoint | Description |
|---|---|---|
GET | /attribution/models | List your models. Filter by type. |
POST | /attribution/models | Create a model: model_name, model_type (last_touch, first_touch, linear, time_decay or position_based), and optionally weighting_config, lookback_days, status and is_default. |
GET | /attribution/models/{id} | One model. |
PUT | /attribution/models/{id} | Change any of the fields above. A change to the type, weighting or lookback recomputes credit for every conversion. |
DELETE | /attribution/models/{id} | Delete a model. Add ?dry_run=1 to see what would be removed first. |
GET | /attribution/reports/breakdown | Credited conversions and revenue, grouped by group_by (campaign by default). model_id picks a model and compare_model_id adds a second one. |
GET | /attribution/reports/journeys | Journey length and time to convert across your conversions. |
GET | /attribution/conversions/{id}/journey | One conversion's clicks in order, and each model's share of the credit. |
GET | /attribution/queue | The attribution worker's backlog and failures. |
GET, POST | /attribution/exports | List or schedule CSV exports of a breakdown, optionally sent to a webhook. Each export also has GET /{id}, GET /{id}/download, POST /{id}/retry and DELETE /{id}. |
The Multi-touch Attribution QA Runbook shows how to check these results with the p202 CLI.
About
/api/v2/attribution: development builds between 1.9.55 and 1.9.76 had preview attribution endpoints under/api/v2/attribution. No release included them, and 1.9.76 removed them. Use the/api/v3/attributionendpoints above.
Original v1 reports endpoint
The v1 endpoint predates the v3 API. It still works for integrations built against it, but use v3 for anything new.
https://your-domain.com/api/v1/reports/
v1 accepts the key in the URL's apikey parameter. URLs can appear in server logs and browser history, so make v1 calls server to server. Revoke the key if a URL containing it is exposed.
Methods
The only method is reports, and it is required.
Arguments
Argument name: type (Required) - The report type. Supported values:
- keywords - Keyword report
- ips - IP report
- text_ads - text ad report
- referers - Referrer report
- countries - Country report
- cities - Cities report
- carriers - Carrier and ISP report
- landing_pages - Landing page report
Argument name: apikey (Required) - API key generated in Prosper202 and used for authentication.
Argument name: date_from (Optional) - Report start date in mm/dd/yyyy format. Send it with date_to; supplying only one returns “Wrong date format”. Leave both out for a report of the current day.
Argument name: date_to (Optional) - Report end date in mm/dd/yyyy format. Send it together with date_from.
Argument name: cid (Optional) - Campaign ID used to filter the report. Blank or 0 includes all campaigns. An ID that does not belong to your account returns “Campaign not found”.
Argument name: c1,c2,c3,c4 (Optional) - Filters by value stored in the
corresponding c1-4 variable (0 is a value like any other). If this is left out, every
click counts. Send each one once: c1[]=x returns “c1 takes one value”.
A database failure returns {"msg": "Database error", "error": true, "status": 500} with HTTP status 500.
Example v1 API request
https://your-domain.com/api/v1/reports/?type=countries&apikey=YOUR_API_KEY&date_from=03/24/2014&date_to=04/27/2014&cid=1&c1=c1var&c2=c2var&c3=c3var&c4=c4var