Documentation sections

Admin API: settings

Admin API methods for tracker settings: general parameters and bot lists with a revision, geo profiles, exchange rates and audit log cleanup.

16 methods work with the same things as the Settings («Настройки») section of the panel: general parameters and bot lists, geo profiles, exchange rates and audit log cleanup. All methods need a token with Full access («Полный доступ») (full).

Authorization is described on the Admin API: overview and authorization page, and the format of requests and responses and the common error codes on the Request, response and error format page.

Settings and revision

The settings are one JSON object with keys and the service field _revision. The revision increases by 1 with every save. The tracker uses it to reject a write on top of someone else's changes.

KeyTypeValuesDefault
s2s_timeout_secintegerFrom 1 to 6010
report_attributionstringclick or conversionclick
allow_phpbooleantrue or falsetrue
bot_uaarray of stringsUp to 10000 lines, each one non-empty and up to 512 bytes—
bot_iparray of stringsUp to 10000 lines: an IP address or a CIDR subnet—
currencystringOnly USDUSD

s2s_timeout_sec is the time in seconds for one send of an outgoing S2S postback. It does not apply to Facebook Conversions API events.

What each parameter means is explained on the Settings: general parameters and bot lists and Bot detection and custom bot lists pages.

Get the settings

http
GET /api/v1/settings

Returns the saved keys and _revision. There are no parameters. A key that has never been saved is absent from the response — its default value applies. Until the settings have been changed, _revision is 0.

json
{"s2s_timeout_sec": 10, "report_attribution": "click", "allow_php": true, "bot_ua": ["MyScanner"], "bot_ip": ["203.0.113.0/24"], "_revision": 7}

Change the settings

http
PATCH /api/v1/settings
PUT /api/v1/settings

Changes only the keys you pass; the rest are kept. The bot_ua and bot_ip arrays are replaced entirely.

FieldTypeRequiredDescription
_revisioninteger, from 0PATCH — yes, PUT — noThe revision from the last GET /api/v1/settings response
keys from the table above—noNew values. null and unknown keys are not accepted

PUT without _revision saves the values without checking the revision. With _revision, both methods work the same way.

Response — code 200 and all settings with the new _revision.

bash
curl -X PATCH https://panel.example.com/api/v1/settings \
  -H "Api-Key: <token>" \
  -H "Content-Type: application/json" \
  -d '{"_revision":7,"s2s_timeout_sec":15,"bot_ip":["203.0.113.10","203.0.113.0/24"]}'
HTTPcodeWhen
400bad_requestThe body is not a JSON object: Ожидается JSON объект (a JSON object is expected)
422validation_revision is not an integer from 0: Некорректная версия настроек (invalid settings version)
409settings_conflictThe revision is out of date. Read the settings again and repeat the request with the new _revision
422validationAn invalid value, null or an unknown key. The reason is in message, for example Таймаут S2S: от 1 до 60 секунд (S2S timeout: from 1 to 60 seconds)
428revision_requiredPATCH without _revision
503settings_sync_pendingThe settings are saved, but applying them to traffic is not confirmed. Read the settings and save them again

Geo profiles

A geo profile is a named set of countries for the “GEO” («Гео») condition in a stream. Working with profiles in the panel is described on the Geo profiles page.

FieldTypeDescription
idstring, UUIDID of a custom profile. Built-in profiles have an empty string
namestringName
countriesarray of stringsTwo-letter ISO country codes in uppercase

Get the list of profiles

http
GET /api/v1/geo-profiles

Returns an array: first the 14 built-in profiles, then the custom ones in alphabetical order. There are no parameters. Built-in profiles cannot be changed or deleted.

Create a profile

http
POST /api/v1/geo-profiles
FieldTypeRequiredDescription
namestringyesName, up to 120 bytes. Spaces at the edges are trimmed. Must not match the name of a built-in profile (case-insensitive) or of another custom profile
countriesarray of stringsyesFrom 1 to 250 country codes. Case does not matter, duplicates are removed

Response — code 200 and the profile object with id.

bash
curl -X POST https://panel.example.com/api/v1/geo-profiles \
  -H "Api-Key: <token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"Tier 1","countries":["US","CA","GB","AU"]}'

Change a profile

http
PUT /api/v1/geo-profiles/{id}

Replaces the name and the country list of the {id} profile. The body fields are the same as when creating, and both are required. Response — code 200 and the profile object.

Errors of creating and changing:

HTTPcodeWhen
400bad_requestThe body is not a JSON object: Некорректный JSON (invalid JSON). Or {id} is not a UUID: некорректный идентификатор или значение (invalid ID or value)
404not_foundThere is no profile with this id
409conflictНазвание встроенного профиля зарезервировано (the name of a built-in profile is reserved) or Название уже занято (the name is already taken)
422validationУкажите название и от 1 до 250 стран (specify a name and from 1 to 250 countries) or Страны задаются двухбуквенными ISO-кодами (countries are set with two-letter ISO codes)

Delete a profile

http
DELETE /api/v1/geo-profiles/{id}

Deletes a custom profile. Response — code 204 with no body. Streams that already have the profile's countries inserted do not change. If there is no such profile — 404 with code not_found. If {id} is not a UUID — 400 with code bad_request.

Exchange rates

A rate is how many USD one unit of a currency costs on a date. How the tracker chooses a rate for conversion is described on the Currencies and rates page.

Get the rate history

http
GET /api/v1/currency-rates

Returns an array of manual and automatic rates — up to 1000 rows, newest dates first. There are no parameters.

FieldTypeDescription
currencystringThree-letter currency code
daystringDate in YYYY-MM-DD format, UTC
usd_ratenumberUSD for 1 unit of the currency
sourcestringmanual — a manual rate, Frankfurter — an automatic one

Add a manual rate

http
POST /api/v1/currency-rates
FieldTypeRequiredDescription
currencystringyesThree Latin letters, case does not matter. USD is not accepted
daystringyesThe date the rate starts to apply, YYYY-MM-DD
usd_ratenumberyesGreater than 0 and less than 1000000000

Response — code 201 and the added rate with source = manual.

json
{"currency": "EUR", "day": "2026-10-01", "usd_rate": 1.1, "source": "manual"}
HTTPcodeWhen
400bad_requestThe body is not a JSON object: invalid json
409currency_rate_existsA manual rate for this currency on this date already exists
422validationAn invalid currency code, date or rate: нужны валюта ISO, дата и положительный курс USD за единицу валюты (an ISO currency, a date and a positive USD rate per unit of currency are required)
Warning.

There are no methods to change or delete a rate. To correct a rate, add a new one with a different date.

Get the state of automatic rates

http
GET /api/v1/currency-rates/provider

There are no parameters. Response — code 200 and an object:

FieldTypeDescription
automaticbooleanWhether automatic rates are used. The default is true
sourcestringSource of the rates: Frankfurter
last_attemptRFC 3339 date or nullTime of the last update attempt
last_successRFC 3339 date or nullTime of the last successful update
last_errorstringAn empty string, or provider_unavailable if the last attempt failed
availablenumberHow many currencies have a rate no older than 7 days
stalenumberHow many currencies have a last rate older than 7 days

Turn automatic rates on or off

http
PUT /api/v1/currency-rates/provider
FieldTypeRequiredDescription
automaticbooleanyestrue — use automatic rates, false — manual rates only

Response — code 200 and the state object. Without the automatic field or with a body that is not JSON — 422 with code validation and the message Укажите режим обновления курсов (specify the rate update mode).

Update the rates now

http
POST /api/v1/currency-rates/refresh

Requests rates from the source outside the schedule. There is no body. The source is polled no more than once a minute: a repeated request made earlier returns the current state. Response — code 200 and the state object.

If the source did not respond — 502 with code currency_provider. The saved rates keep applying as long as they are no older than 7 days.

Audit log cleanup

Cleanup deletes old entries of the audit log and CSV exports whose term has expired. Before a one-time cleanup and before turning on auto-cleanup, you need a preview: it returns a token and a before boundary, which you pass in the next request. Rules and terms are described on the Data retention and audit log cleanup page.

Get the cleanup state

http
GET /api/v1/retention/status

There are no parameters. Response — code 200 and an object:

FieldTypeDescription
policy.enabledbooleanWhether the daily auto-cleanup is on
policy.audit_daysnumberFor how many recent days entries are kept. The default is 90
policy.revisionnumberRevision of the rule, 0 at first. It is passed when saving
policy.next_runRFC 3339 date or nullTime of the next run
runsarrayThe last 20 runs: id, created_at, source (manual or scheduled), before, audit_rows, expired_exports, state (ok or error)
audit_rowsnumberEntries in the audit log
export_rowsnumberSaved CSV exports
export_bytesnumberTheir size in bytes
expired_exportsnumberExports whose term has expired
trashobjectObjects in the trash: offers, landers, campaigns

Preview the cleanup

http
POST /api/v1/retention/preview

Counts how many entries the cleanup will affect. Deletes nothing.

FieldTypeRequiredDescription
daysintegeryesHow many recent days to keep, from 7 to 3650

Response — code 200:

FieldTypeDescription
preview.beforeRFC 3339 dateThe boundary: entries older than it will be cleaned up
preview.audit_rowsnumberAudit entries older than the boundary
preview.expired_exportsnumberExports whose term has expired
tokenstringConfirmation of the preview. Valid for 15 minutes and only for the same user, with the same term and boundary
daysnumberThe term from the request

Run the cleanup

http
POST /api/v1/retention/apply
FieldTypeRequiredDescription
daysintegeryesThe same term as in the preview
beforeRFC 3339 dateyespreview.before from the preview, unchanged
tokenstringyestoken from the preview

Response — code 200 and an object with the fields before, audit_rows, expired_exports — how many were deleted. One request deletes up to 10000 audit entries and up to 100 exports. If more remain, repeat the request: within 15 minutes the same before and token work, after that you need a new preview.

bash
curl -X POST https://panel.example.com/api/v1/retention/apply \
  -H "Api-Key: <token>" \
  -H "Content-Type: application/json" \
  -d '{"days":90,"before":"2026-07-06T12:00:00Z","token":"<token from the preview>"}'
Warning.

Deleted audit entries cannot be restored.

Save the auto-cleanup rule

http
PUT /api/v1/retention/policy

Turns the daily auto-cleanup on or off, or changes its term.

FieldTypeRequiredDescription
enabledbooleanyestrue — turn on, false — turn off
audit_daysintegeryesRetention term, from 7 to 3650. Required even when turning off
revisioninteger, from 0yespolicy.revision from the cleanup state
beforeRFC 3339 datewhen enabled = truepreview.before from a preview with days equal to audit_days
tokenstringwhen enabled = truetoken from the same preview

Response — code 200 and an object with enabled, audit_days, revision, next_run. revision in the response is 1 greater than the one you passed. After turning on, turning off or changing the term, next_run is in 24 hours.

Errors of the cleanup methods:

HTTPcodeWhen
409preview_requiredtoken or before is not from a preview, the preview is older than 15 minutes, or it was made with a different term. Repeat the preview
409revision_conflictThe rule was changed after it was read. Get the state again and repeat with the new revision
422validationThe body is not a JSON object, the term is outside the 7–3650 days range, or enabled or revision is missing
Updated Need help? ↗