Skip to content

Working with cabinets

Cabinet list

INFO

GET accounts/telegram/names

Example:

http
https://client.adstat.pro/api/accounts/telegram/names

Parameters:

Pass <access_token> in HTTP headers as:

  • Authorization: "Bearer <access_token>"

Example successful response:

json
[
	{
		"account_uid": "ACC0000",
		"name": "string",
		"balance": 0,
		"mode": "string",
		"is_audience_allowed": false
	}
]

Response fields:

ParameterDescription
account_uidCabinet identifier
nameCabinet name
balanceCabinet balance
modeInternal technical parameter
is_audience_allowedInternal technical parameter

Single cabinet details

INFO

GET api/accounts/telegram/{account_uid}

Example:

http
https://client.adstat.pro/api/accounts/telegram/ACC0000

Parameters:

Pass <access_token> in HTTP headers as:

  • Authorization: "Bearer <access_token>"

Pass the cabinet identifieraccount_uid — in the URL. You can get it from the list of all cabinets.

Example successful response:

json
{
	"account_uid": "ACC0000",
	"name": "string",
	"balance": 0,
	"mode": "string",
	"is_audience_allowed": false
}

Response fields:

ParameterDescription
account_uidCabinet identifier
nameCabinet name
balanceCabinet balance
modeInternal technical parameter
is_audience_allowedInternal technical parameter

Detailed cabinet information

INFO

GET accounts/telegram/?query-params

Example:

http
https://client.adstat.pro/api/accounts/telegram/?limit=50&offset=0

Query parameters:

ParameterTypeDescription
account_nameStringFilter cabinets by cabinet name.
offsetNumberOffset in the result list.
limitNumberMaximum number of cabinets returned.
legal_nameStringFilter by legal name.

Example successful response:

json
{
	"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:

FieldTypeDescription
itemsArrayList of cabinet objects.
account_idStringUnique cabinet identifier.
account_nameStringCabinet name.
statusStringCabinet status.
active, inactive
balance_totalNumberTotal cabinet balance.
balance_availableNumberAvailable cabinet balance.
balance_activeNumberBalance of funds in cabinet ads.
balance_spentNumberSpent cabinet balance.
objectsArrayPromoted objects linked to the cabinet.
legal_nameStringLegal name of the cabinet.
category_keyStringCabinet category key.
category_nameStringCabinet category name.
countNumberNumber 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:

http
https://client.adstat.pro/api/accounts/set-default-kktu

Request body parameters:

ParameterTypeDescription
account_idstringUnique cabinet identifier
kktu_idstringUnique KKTU identifier

Example request body:

json
{
	"account_id": "string",
	"kktu_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}