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.
| Key | Type | Values | Default |
|---|---|---|---|
s2s_timeout_sec | integer | From 1 to 60 | 10 |
report_attribution | string | click or conversion | click |
allow_php | boolean | true or false | true |
bot_ua | array of strings | Up to 10000 lines, each one non-empty and up to 512 bytes | — |
bot_ip | array of strings | Up to 10000 lines: an IP address or a CIDR subnet | — |
currency | string | Only USD | USD |
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
GET /api/v1/settingsReturns 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.
{"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
PATCH /api/v1/settings
PUT /api/v1/settingsChanges only the keys you pass; the rest are kept. The bot_ua and bot_ip arrays are replaced entirely.
| Field | Type | Required | Description |
|---|---|---|---|
_revision | integer, from 0 | PATCH — yes, PUT — no | The revision from the last GET /api/v1/settings response |
| keys from the table above | — | no | New 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.
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"]}'| HTTP | code | When |
|---|---|---|
400 | bad_request | The body is not a JSON object: Ожидается JSON объект (a JSON object is expected) |
422 | validation | _revision is not an integer from 0: Некорректная версия настроек (invalid settings version) |
409 | settings_conflict | The revision is out of date. Read the settings again and repeat the request with the new _revision |
422 | validation | An invalid value, null or an unknown key. The reason is in message, for example Таймаут S2S: от 1 до 60 секунд (S2S timeout: from 1 to 60 seconds) |
428 | revision_required | PATCH without _revision |
503 | settings_sync_pending | The 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.
| Field | Type | Description |
|---|---|---|
id | string, UUID | ID of a custom profile. Built-in profiles have an empty string |
name | string | Name |
countries | array of strings | Two-letter ISO country codes in uppercase |
Get the list of profiles
GET /api/v1/geo-profilesReturns 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
POST /api/v1/geo-profiles| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name, 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 |
countries | array of strings | yes | From 1 to 250 country codes. Case does not matter, duplicates are removed |
Response — code 200 and the profile object with id.
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
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:
| HTTP | code | When |
|---|---|---|
400 | bad_request | The body is not a JSON object: Некорректный JSON (invalid JSON). Or {id} is not a UUID: некорректный идентификатор или значение (invalid ID or value) |
404 | not_found | There is no profile with this id |
409 | conflict | Название встроенного профиля зарезервировано (the name of a built-in profile is reserved) or Название уже занято (the name is already taken) |
422 | validation | Укажите название и от 1 до 250 стран (specify a name and from 1 to 250 countries) or Страны задаются двухбуквенными ISO-кодами (countries are set with two-letter ISO codes) |
Delete a profile
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
GET /api/v1/currency-ratesReturns an array of manual and automatic rates — up to 1000 rows, newest dates first. There are no parameters.
| Field | Type | Description |
|---|---|---|
currency | string | Three-letter currency code |
day | string | Date in YYYY-MM-DD format, UTC |
usd_rate | number | USD for 1 unit of the currency |
source | string | manual — a manual rate, Frankfurter — an automatic one |
Add a manual rate
POST /api/v1/currency-rates| Field | Type | Required | Description |
|---|---|---|---|
currency | string | yes | Three Latin letters, case does not matter. USD is not accepted |
day | string | yes | The date the rate starts to apply, YYYY-MM-DD |
usd_rate | number | yes | Greater than 0 and less than 1000000000 |
Response — code 201 and the added rate with source = manual.
{"currency": "EUR", "day": "2026-10-01", "usd_rate": 1.1, "source": "manual"}| HTTP | code | When |
|---|---|---|
400 | bad_request | The body is not a JSON object: invalid json |
409 | currency_rate_exists | A manual rate for this currency on this date already exists |
422 | validation | An invalid currency code, date or rate: нужны валюта ISO, дата и положительный курс USD за единицу валюты (an ISO currency, a date and a positive USD rate per unit of currency are required) |
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
GET /api/v1/currency-rates/providerThere are no parameters. Response — code 200 and an object:
| Field | Type | Description |
|---|---|---|
automatic | boolean | Whether automatic rates are used. The default is true |
source | string | Source of the rates: Frankfurter |
last_attempt | RFC 3339 date or null | Time of the last update attempt |
last_success | RFC 3339 date or null | Time of the last successful update |
last_error | string | An empty string, or provider_unavailable if the last attempt failed |
available | number | How many currencies have a rate no older than 7 days |
stale | number | How many currencies have a last rate older than 7 days |
Turn automatic rates on or off
PUT /api/v1/currency-rates/provider| Field | Type | Required | Description |
|---|---|---|---|
automatic | boolean | yes | true — 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
POST /api/v1/currency-rates/refreshRequests 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
GET /api/v1/retention/statusThere are no parameters. Response — code 200 and an object:
| Field | Type | Description |
|---|---|---|
policy.enabled | boolean | Whether the daily auto-cleanup is on |
policy.audit_days | number | For how many recent days entries are kept. The default is 90 |
policy.revision | number | Revision of the rule, 0 at first. It is passed when saving |
policy.next_run | RFC 3339 date or null | Time of the next run |
runs | array | The last 20 runs: id, created_at, source (manual or scheduled), before, audit_rows, expired_exports, state (ok or error) |
audit_rows | number | Entries in the audit log |
export_rows | number | Saved CSV exports |
export_bytes | number | Their size in bytes |
expired_exports | number | Exports whose term has expired |
trash | object | Objects in the trash: offers, landers, campaigns |
Preview the cleanup
POST /api/v1/retention/previewCounts how many entries the cleanup will affect. Deletes nothing.
| Field | Type | Required | Description |
|---|---|---|---|
days | integer | yes | How many recent days to keep, from 7 to 3650 |
Response — code 200:
| Field | Type | Description |
|---|---|---|
preview.before | RFC 3339 date | The boundary: entries older than it will be cleaned up |
preview.audit_rows | number | Audit entries older than the boundary |
preview.expired_exports | number | Exports whose term has expired |
token | string | Confirmation of the preview. Valid for 15 minutes and only for the same user, with the same term and boundary |
days | number | The term from the request |
Run the cleanup
POST /api/v1/retention/apply| Field | Type | Required | Description |
|---|---|---|---|
days | integer | yes | The same term as in the preview |
before | RFC 3339 date | yes | preview.before from the preview, unchanged |
token | string | yes | token 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.
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>"}'Deleted audit entries cannot be restored.
Save the auto-cleanup rule
PUT /api/v1/retention/policyTurns the daily auto-cleanup on or off, or changes its term.
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | yes | true — turn on, false — turn off |
audit_days | integer | yes | Retention term, from 7 to 3650. Required even when turning off |
revision | integer, from 0 | yes | policy.revision from the cleanup state |
before | RFC 3339 date | when enabled = true | preview.before from a preview with days equal to audit_days |
token | string | when enabled = true | token 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:
| HTTP | code | When |
|---|---|---|
409 | preview_required | token 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 |
409 | revision_conflict | The rule was changed after it was read. Get the state again and repeat with the new revision |
422 | validation | The body is not a JSON object, the term is outside the 7–3650 days range, or enabled or revision is missing |