ChaptersAPI
Getting started
Traffic
Team and integrations
Server and reference
DocumentationTeam and integrations
API: scripts, services and AI assistants
On this page
Everything you do in the admin panel is also available to programs: your own scripts, FBTool, Dolphin, CRM, BI, AI assistants. This chapter covers how to connect and gives examples of common tasks. The full description of each operation (fields, types, responses, errors) is in the specification: Settings → API in the admin panel, in Russian or English — by the interface language.
| Interface | Address | Purpose |
|---|---|---|
| Admin API | https://<admin domain>/admin_api/v1/… |
managing the tracker: objects, reports, logs, costs, conversions |
| Edge API | any campaign domain | traffic: the campaign link, Click API v3, network postbacks, LP click |
| MCP | POST https://<admin domain>/admin_api/v1/mcp |
AI assistants (Claude, Cursor) read reports and objects |
The OpenAPI 3.1 specifications are downloaded in the same place, Settings → API:
/admin_api/v1/openapi.yaml— Admin API;/admin_api/v1/openapi-edge.yaml— Edge API.
To get the English text, add ?lang=en. Both are generated from the code in every release and match the
running tracker. A contract test checks every response against them.
Access
- An API key is issued in Profile → API keys (an administrator also issues keys in “Users”).
- The key is passed in the
Api-Key: <key>header orAuthorization: Bearer <key>. - The key acts with the rights of its user. Other people’s objects are hidden from it just as they are from the user.
- The key is passed in the
- The key scope limits what the key can do. The scope table is in Integrations.
- The scope each operation needs is given in the specification (the “Access” line).
- Without the required scope the API returns 403
scope_required. - Issue a separate key with the minimal scope for each service: “Costs” is enough for FBTool, “Read” for BI.
- Allowed IPs — the key works only from the listed addresses. From the others the API returns 403
ip_not_allowed. - Admin panel only: users, rights, keys, 2FA, the postback key, plugins, backups and updates
cannot be changed with a key. The API returns 403
session_requiredto any API key, so that a leaked key cannot issue a new key or turn off protection. - The API responds only on the admin domain. It is not available on campaign domains or by IP.
- Rate limit: 20 requests per second per key by default (“Settings → Security”).
- Above the limit the API returns 429
rate_limited, and theretry_afterfield says in how many seconds to retry. - Many invalid keys from one address temporarily block that address.
- Above the limit the API returns 429
export AURUM=https://tracker.example.com/admin_api/v1
export AURUM_KEY=... # the key from the profile; in scripts, read it from an environment variable, not from code
curl -s "$AURUM/campaigns?state=active&limit=20" -H "Api-Key: $AURUM_KEY"
General rules
-
Data is JSON in UTF-8. A request body is up to 10 MB, a larger one gets 413
body_too_large. -
Money — decimal strings (
"12.50") in objects; numbers in reports. -
Time — UTC (ISO 8601,
2026-11-26T10:00:00Z). Reports and per-day selections accept a time zone (tz,timezone), and days are counted in it. -
Lists:
- filters in the query string:
state(active,disabled,all,deleted),search,group_id,tags, foreign keys (source_id=5,network_id=none— without an affiliate network); - pages —
offsetandlimit; the total count is in theX-Total-Countheader; - each list has its own filters, they are listed in the specification.
- filters in the query string:
-
Updates (
PATCH,PUT) are partial:- only the fields you send are changed;
- nested objects are merged by keys;
- arrays are replaced as a whole.
The exceptions are operations where some fields are written on every call (for example, user flags in
PUT /users/{id}): this is stated in the operation description. -
Overwrite protection: send
versionfrom the object you read. If the object has been changed in the meantime, the API returns 409version_conflict: read the object again and retry. -
Deletion —
DELETE /<objects>/{id}moves the object to the archive; to restore it —POST …/restore. -
Audit: every change goes to the activity log with the user, key and address.
-
An error is
{"error": {"code": "…", "message": "…", "fields": {…}}}:code— for the program; the table of codes is at the beginning of the specification;message— for a person;fields— field errors, with the 422validation_failedresponse.
-
Background jobs. Long operations respond with 202 and
{"job_id": N}: import, export of a large report, backup, cost sync. The state is atGET /jobs/{id}:status—queued,running,done,failedorcancelled;progress— from 0 to 1;- the result is in
result, the error inerror.
Poll every few seconds.
Examples
Campaigns: find, disable, update
# find by name (the response has the X-Total-Count header)
curl -s "$AURUM/campaigns?search=promo&state=all" -H "Api-Key: $AURUM_KEY"
# change one field without overwriting someone else's edit: version comes from the campaign you read
curl -s -X PATCH "$AURUM/campaigns/12" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" \
-d '{"name": "Promo RU — new", "version": 7}'
# disable
curl -s -X POST "$AURUM/campaigns/12/disable" -H "Api-Key: $AURUM_KEY"
Report — POST /report/build
curl -s -X POST "$AURUM/report/build" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" -d '{
"range": {"from": "2026-11-01", "to": "2026-11-25", "timezone": "Europe/Moscow"},
"grouping": ["day", "campaign"],
"metrics": ["clicks", "conversions", "revenue", "cost", "profit", "roi"],
"filters": [{"name": "country", "operator": "IN_LIST", "expression": ["RU", "KZ"]}],
"sort": [{"name": "profit", "order": "desc"}],
"summary": true
}'
- Dimensions and metrics are the same as in the report builder.
- A request in the Keitaro format (
dimensions+measuresormetrics,interval: "7_days_ago") is accepted too. - The response is synchronous. With
"allow_async": truea long report (over 5 s) responds with 202 and atoken, the result is atGET /report/async/{token}and is kept for 15 minutes. - Export to a file —
POST /report/exportwith{"report": {…}, "format": "csv"}; the formats arecsv,xlsx,html,json. Over 100 thousand rows go to a background job, and the finished file is downloaded viaGET /exports/{id}.
Click and conversion logs
With an API key the log works in the Keitaro clicks/log format — scripts written for Keitaro need no changes.
# campaign clicks for a day, newest first; next page — "offset": 1000
curl -s -X POST "$AURUM/clicks/log" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" -d '{
"range": {"from": "2026-11-25 00:00", "to": "2026-11-25 23:59", "timezone": "Europe/Moscow"},
"columns": ["sub_id", "datetime", "campaign", "stream_id", "country_code", "sub_id_1", "is_bot", "cost"],
"filters": [{"name": "country", "operator": "IN_LIST", "expression": ["MX", "CO"]}],
"campaign_id": [12, 15],
"limit": 1000
}'
- The response is
{rows, data, total}:rows— the rows,data— a copy of them (as in Keitaro),total— the total count. - Without
columnsyou get the Keitaro set:sub_id, time, campaign, stream, landing, offer, source, country, city, IP, user agent, referrer,sub_id_1…sub_id_5, bot and uniqueness flags, cost. The report builder dimensions are available too. limit— 100 by default, no more than 10,000; beyond that —offset. Withoutrange— today.- Conversions —
POST /conversions/login the same format. - The row count without the rows themselves —
…/log/count. - CSV export (
?format=csv) and the native log format (thebeforecursor) are available only in an admin panel session (/api/v1).
Costs — update_costs
As in Keitaro:
POST /campaigns/{id}/update_costs— per ad;- the batch
POST /clicks/update_costs— for several campaigns.
The rules (matching by a click parameter, days in the ad account time zone, repeats without doubling) are in the
“Cost transfer” section of the Integrations chapter. Ad platform impressions and reach — POST /ad_stats (same place).
Conversions: import and postback test
# import as rows (or CSV in the "text" field); send_s2s — send S2S and ad platform events
curl -s -X POST "$AURUM/conversions/import" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" -d '{
"rows": [{"subid": "3f2a1b9c0d", "status": "sale", "payout": "25.00", "currency": "USD", "tid": "A-1001"}],
"send_s2s": false
}'
# → 202 {"job_id": 812}; row errors — GET /conversions/import/812/errors
# a postback for a click via the postback handler, the result comes right away
curl -s -X POST "$AURUM/tools/postback_test" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" \
-d '{"subid": "3f2a1b9c0d", "params": {"status": "lead"}, "s2s": false}'
The key needs the “Conversions” scope.
Page leads log
GET /logs/page_leads?kind=landing|offer&page_id=&from=&to=&tz=&limit= — form submissions to the handlers of
landings and offers, administrators only (Landings and offers). The log contains visitors’
personal data, so:
- take only the fields you need in scripts;
- keep a key with this access separately.
Uploading a large landing ZIP in parts
A small archive is uploaded with one request: POST /landing_pages/{id}/upload, multipart/form-data, the
file field. A large one is better uploaded in parts, so a dropped connection does not lose what was already uploaded:
# 1. start: the same file (name, size, modification time) means the same upload; offset — the byte to continue from
curl -s -X POST "$AURUM/landing_pages/7/uploads" -H "Api-Key: $AURUM_KEY" -H "Content-Type: application/json" \
-d '{"name": "lp.zip", "size": 73400320}'
# → {"id": "…", "offset": 0, "part_size": …, "max_part": …}
# 2. parts: bytes in the body, position in Content-Range (repeating an accepted part is safe)
curl -s -X PUT "$AURUM/landing_pages/7/uploads/<id>" -H "Api-Key: $AURUM_KEY" \
-H "Content-Type: application/octet-stream" -H "Content-Range: bytes 0-8388607/73400320" --data-binary @part0
# a skipped part — 409 upload_gap with the offset to continue from
# 3. assemble the archive into a new landing revision
curl -s -X POST "$AURUM/landing_pages/7/uploads/<id>/complete" -H "Api-Key: $AURUM_KEY"
Offers use the same paths with offers instead of landing_pages.
Edge API
Edge API is the set of addresses on campaign domains that serve traffic. They need no API key. Protection comes from:
- the campaign alias;
- the click token;
- the postback key (Settings → Postback).
| Address | What it does |
|---|---|
/<alias>?<parameters> |
the campaign link: a click, routing by streams, a redirect or a page |
?_lp=1, ?_lp=1&_token=… |
a click from a landing to an offer (LP click) |
/click_api/v3?token=… |
Click API: the tracker’s decision for your own server or site, JSON |
/<postback key>/postback?subid=…&status=… |
a network postback: a conversion for a click |
The description is in the Campaigns and streams (link and macros), Conversions and postbacks (postbacks) and
Integrations (Click API, KClient) chapters. The full specification is openapi-edge.yaml.
MCP: AI assistants
POST /admin_api/v1/mcp — a Model Context Protocol server (JSON-RPC 2.0). An assistant (Claude, Cursor and others)
gets tools: reports, logs, object lists. Its rights are those of the key.
- A key with the “Read” scope is enough for reading.
- Changes via MCP (the
api_writetool) work only if writing via MCP is enabled in the system settings (“Security”). - An administrator with data questions enabled also gets
sql_schemaandsql_query(Team, settings, security). - Responses to the assistant are marked as untrusted data. Text from a click or a landing cannot give the assistant a command.
To connect in an MCP client — the address above and the Api-Key header.
Keitaro compatibility
Scripts written for Keitaro Admin API v1 work without changes: the same paths and object fields. What is supported:
report/buildin both formats;clicks/log,conversions/log;update_costs;streams/search;offers/{id}/archive;landing_pages/{id}/clone.
Details — in Integrations and Moving from Keitaro.
Didn’t find an answer?
Support