Working with cabinets
Cabinet list
INFO
GET accounts/telegram/names
Example:
https://client.adstat.pro/api/accounts/telegram/namesParameters:
Pass <access_token> in HTTP headers as:
Authorization: "Bearer <access_token>"
Example successful response:
[
{
"account_uid": "ACC0000",
"name": "string",
"balance": 0,
"mode": "string",
"is_audience_allowed": false
}
]Response fields:
| Parameter | Description |
|---|---|
account_uid | Cabinet identifier |
name | Cabinet name |
balance | Cabinet balance |
mode | Internal technical parameter |
is_audience_allowed | Internal technical parameter |
Single cabinet details
INFO
GET api/accounts/telegram/{account_uid}
Example:
https://client.adstat.pro/api/accounts/telegram/ACC0000Parameters:
Pass <access_token> in HTTP headers as:
Authorization: "Bearer <access_token>"
Pass the cabinet identifier — account_uid — in the URL. You can get it from the list of all cabinets.
Example successful response:
{
"account_uid": "ACC0000",
"name": "string",
"balance": 0,
"mode": "string",
"is_audience_allowed": false
}Response fields:
| Parameter | Description |
|---|---|
account_uid | Cabinet identifier |
name | Cabinet name |
balance | Cabinet balance |
mode | Internal technical parameter |
is_audience_allowed | Internal technical parameter |
Detailed cabinet information
INFO
GET accounts/telegram/?query-params
Example:
https://client.adstat.pro/api/accounts/telegram/?limit=50&offset=0Query parameters:
| Parameter | Type | Description |
|---|---|---|
| account_name | String | Filter cabinets by cabinet name. |
| offset | Number | Offset in the result list. |
| limit | Number | Maximum number of cabinets returned. |
| legal_name | String | Filter by legal name. |
Example successful response:
{
"items": [
{
"account_id": "ACC0000",
"account_name": "account name",
"status": "active",
"balance_total": 0,
"balance_available": 0,
"balance_active": 0,
"balance_spent": 0,
"objects": ["t.me/example"],
"legal_name": "legal name",
"category_key": "education",
"category_name": "Education"
}
],
"count": 1
}Response fields:
| Field | Type | Description |
|---|---|---|
| items | Array | List of cabinet objects. |
| account_id | String | Unique cabinet identifier. |
| account_name | String | Cabinet name. |
| status | String | Cabinet status. active, inactive |
| balance_total | Number | Total cabinet balance. |
| balance_available | Number | Available cabinet balance. |
| balance_active | Number | Balance of funds in cabinet ads. |
| balance_spent | Number | Spent cabinet balance. |
| objects | Array | Promoted objects linked to the cabinet. |
| legal_name | String | Legal name of the cabinet. |
| category_key | String | Cabinet category key. |
| category_name | String | Cabinet category name. |
| count | Number | Number of cabinets in the list. |
Default KKTU for a cabinet
This method sets the default KKTU for a cabinet. If KKTU is not specified manually when creating a campaign and a default KKTU is configured for the cabinet, it is applied automatically to the new campaign.
Method:
PATCH /api/accounts/set-default-kktu
Example request:
https://client.adstat.pro/api/accounts/set-default-kktuRequest body parameters:
| Parameter | Type | Description |
|---|---|---|
| account_id | string | Unique cabinet identifier |
| kktu_id | string | Unique KKTU identifier |
Example request body:
{
"account_id": "string",
"kktu_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}