Skip to content

Working with Advertisements

API Updates for Advertisements (02.06.2025)

The following changes have been made to the Advertisement list, Create advertisement, and Get advertisement details API endpoints:

  1. New parameter target_bots:
    Added the target_bots parameter for targeting configuration. See the body parameter descriptions in the method documentation, as well as the request and response examples.

  2. Added bot validation method (/api/advertisement/bots/validate?validate?bots=bot_1&bots=bot_2&bots=bot_3&account_id={account_id}):

    json
    {
    	"bots": [
    		{
    			"id": 123456789,
    			"title": "Bot name 1",
    			"url": "t.me/bot_1",
    			"photo_url": "https://cdn4.telesco.pe/file/path_to_photo_url_for_bot_1.jpg"
    		},
    		{
    			"id": 123456780,
    			"title": "Bot name 2",
    			"url": "t.me/bot_2",
    			"photo_url": "https://cdn4.telesco.pe/file/path_to_photo_url_for_bot_2.jpg"
    		}
    	],
    	"errors": [
    		{
    			"code": "advertisement__target_bot_daily_users_limit_error",
    			"detail": "Advertisement: Target bot must have 1000+ daily users",
    			"url": "bot_3"
    		}
    	]
    }
  3. New parameter tg_event_id:

    Added the new tg_event_id parameter for Pixel Tag configuration. See the body parameter descriptions in the create and edit advertisement methods.

WARNING

Update as of 04.09.2025: A limit has been introduced on the limit parameter — a maximum of 500 records in the response.

GET v2/advertisement/?show_deleted=false&period=today&offset=0&limit=50&advertisement_titles=&campaign_names=

Usage example

http
https://client.adstat.pro/api/v2/advertisement/?period=today

Query parameters

ParameterTypeDescription
periodStringFilter results by creation time: today, all, yesterday, starts_month.
offsetNumberPagination offset (default: 0).
limitNumberNumber of records in the response (maximum: 500, default: 50). Previously, there was no cap.

Response example

json
{
	"data": [
		{
			"account_name": "SOME_test",
			"action_type": null,
			"ad_text": "example text",
			"ad_type": "target_bots",
			"advertisement_title": "example title",
			"balance": 0.0,
			"campaign_id": 12345,
			"campaign_name": "Default",
			"clicks": 0,
			"cpc": 0,
			"cpm": 3.0,
			"cps": 0,
			"created_dt": "09.01.1998 09:04:26",
			"ctr": 0,
			"cvr": 0,
			"goals": 0,
			"id": 1364756,
			"impressions": 0,
			"kktu_codes": [],
			"object": "t.me/example",
			"opened": null,
			"spent": 0,
			"status": "stopped",
			"status_updated_dt": "1998-01-09T09:29:27.311931+00:00",
			"target_topics": []
		}
	]
}

Response field descriptions

FieldTypeDescription
account_nameStringAccount name.
action_typeString/nullTarget action type.
ad_textStringCreative text.
ad_typeStringAdvertisement type (target_channels, target_users, target_search, target_bots).
advertisement_titleStringAdvertisement title.
balanceNumberAdvertisement balance.
campaign_idNumberCampaign ID.
campaign_nameStringCampaign name.
clicksNumberNumber of clicks.
cpcNumberCost per click.
cpmNumberCost per thousand impressions.
cpsNumberCost per goal.
created_dtStringCreation date and time.
ctrNumberClick-through rate.
cvrNumberConversion rate.
goalsNumberNumber of goals achieved.
idNumberUnique advertisement ID.
impressionsNumberNumber of impressions.
kktu_codesArray of stringsKKTU codes.
objectStringPromoted object.
openedNumber/nullVideo opens.
spentNumberAmount spent.
statusStringAdvertisement status.
status_updated_dtStringStatus update date and time.
target_topicsArray of stringsTargeting topic list.

Create advertisement

WARNING

Update as of 21.05.2026: Added the ad_object parameter. The field becomes required when targeting a channel invite link.

POST /api/advertisement/telegram/

Usage example

http
https://client.adstat.pro/api/advertisement/telegram/

Body parameters

FieldTypeDescription
campaign_idNumberCampaign ID.
titleStringAdvertisement title.
textStringAdvertisement text.
promote_urlStringPromoted object URL.
ad_objectStringRequired when targeting a channel invite link. URL of the destination Telegram channel.
cpmNumberCost per 1,000 impressions.
budgetNumberAdvertising budget.
langsArray of stringsTargeting languages.
topicsArray of numbersTargeting topics.
topics_verboseArray of stringsTopic identifiers.
channelsArray of numbersTargeting channels.
channels_verboseArray of stringsChannel identifiers.
exclude_topicsArray of numbersExcluded topics.
exclude_topics_verboseArray of stringsExcluded topic identifiers.
exclude_channelsArray of numbersExcluded channels.
exclude_channels_verboseArray of stringsExcluded channel identifiers.
media_tokenStringMedia file token.
other_infoStringERID token (for manual labeling).
split_byArray of stringsTargeting split parameters.
ad_sourceStringCreation source (web_api).
ad_typeStringTargeting type (target_channels, target_users, target_bots).
countriesArray of stringsTargeting countries.
locationsArray of stringsTargeting cities.
locations_verboseArray of stringsCity identifiers.
audiencesArray of numbersTargeting audiences.
exclude_audiencesArray of numbersExcluded audiences.
website_nameStringWebsite name (for external links).
views_per_userNumberViews per user limit.
show_pictureBooleanShow avatar.
promote_url_picture_idStringObject image ID.
exclude_politicBooleanExclude political content.
all_topics_interested_usersBooleanTarget users interested in all topics.
deviceStringTargeting device (all).
target_user_channelsArray of stringsUser targeting channels.
target_user_channels_verboseArray of stringsUser channel identifiers.
exclude_target_user_channelsArray of stringsExcluded user channels.
exclude_target_user_channels_verboseArray of stringsExcluded user channel identifiers.
button_typeStringButton type (open_website).
daily_budgetNumberDaily budget limit.
after_moderation_statusStringStatus after moderation.
start_dateString (ISO 8601)Start date.
end_dateString (ISO 8601)End date.
scheduleObjectDelivery schedule.
use_selected_timezoneBooleanUse timezone.
schedule_timezoneNumberSchedule timezone.
promote_url_typeStringURL type (website, channel).
currency_codeStringCurrency code (EUR).
use_account_currencyBooleanUse account currency.
only_cryptoBooleanShow only in crypto channels.
exclude_cryptoBooleanExclude crypto channels.
kktu_idsArray of stringsKKTU identifiers.
target_searchArray of strings/nullSearch target queries.
target_botsArray of objects/nullBots for targeting.
tg_event_idString/nullPixel Tag event identifier

Body example

json
{
	"campaign_id": 4567123,
	"title": "123testBody_title",
	"text": "123testBody",
	"promote_url": "t.me/somechannel",
	"ad_object": "t.me/target_channel",
	"cpm": 2,
	"budget": 0.01,
	"only_crypto": false,
	"exclude_crypto": false,
	"media_token": "zHN9jkeds9KpcX34XoaslFXnKUqzyr3K5tBx0xAcr2_MGIisHaXA3BLnfB1yOcFudOa8qC",
	"audiences": [],
	"exclude_audiences": [],
	"langs": [],
	"topics": [1, 2],
	"topics_verbose": [],
	"channels": [],
	"channels_verbose": [],
	"exclude_topics": [],
	"exclude_topics_verbose": [],
	"exclude_channels": [],
	"exclude_channels_verbose": [],
	"split_by": [],
	"other_info": null,
	"ad_source": "web_api",
	"ad_type": "target_bots",
	"countries": [],
	"locations": [],
	"locations_verbose": [],
	"website_name": "",
	"views_per_user": 1,
	"show_picture": false,
	"promote_url_picture_id": null,
	"all_topics_interested_users": false,
	"device": "all",
	"target_user_channels": [],
	"target_user_channels_verbose": [],
	"exclude_target_user_channels": [],
	"exclude_target_user_channels_verbose": [],
	"button_type": null,
	"daily_budget": 0,
	"after_moderation_status": "on hold",
	"start_date": null,
	"end_date": null,
	"schedule": {
		"mon": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"tue": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"wed": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"thu": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"fri": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"sat": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"sun": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		]
	},
	"use_selected_timezone": true,
	"schedule_timezone": 10800,
	"promote_url_type": "channel",
	"currency_code": "EUR",
	"use_account_currency": false,
	"kktu_ids": ["some_uid_kktu"],
	"target_search": null,
	"target_bots": [
		{
			"id": 123456789,
			"url": "t.me/bot_1"
		},
		{
			"id": 123456780,
			"url": "t.me/bot_2"
		}
	],
	"tg_event_id": "JuKiaLISFD"
}

Get advertisement details

GET /api/advertisement/telegram/{ad_id}

Usage example

http
https://client.adstat.pro/api/advertisement/telegram/{ad_id}

Query parameters

ParameterTypeDescription
ad_idNumberAdvertisement identifier

Response example

json
{
	"ad_id": 0,
	"telegram_id": 999999999,
	"account_id": "ACCTEST_1111",
	"account_name": "TEST",
	"campaign_id": 56521378,
	"campaign_name": "Campaign test",
	"title": "Test promote title",
	"text": "Test promote text",
	"promote_url": "https://cryptosite.ru/",
	"promote_url_title": "Crypto Channel",
	"promote_url_photo": "/file/test_token.jpg",
	"media": {
		"token": "test_token",
		"url": "https://cdn4.telesco.pe/file/test_token.jpg",
		"type": "image"
	},
	"cpm": 1.5,
	"budget": 10.0,
	"langs": [],
	"topics": [],
	"channels": [],
	"exclude_topics": [],
	"exclude_channels": [],
	"other_info": "erid: test token",
	"decline_reason": [],
	"status": "active",
	"status_updated_dt": "2024-12-04T07:24:45.344358+00:00",
	"cannot_edit_fields": [],
	"ad_type": "target_bots",
	"countries": [],
	"user_locations": [],
	"audiences": [],
	"exclude_audiences": [],
	"is_audiences": false,
	"is_exclude_audiences": false,
	"website_name": "Crypto Site",
	"is_website": true,
	"views_per_user": 1,
	"show_picture": false,
	"exclude_politic": null,
	"promote_url_picture_id": "https://ads.telegram.org/file/test..asd",
	"all_topics_interested_users": null,
	"device": null,
	"target_user_channels": [],
	"exclude_target_user_channels": [],
	"button_type": "learn_more",
	"daily_budget": 2.0,
	"after_moderation_status": "active",
	"start_date": null,
	"end_date": null,
	"schedule": {
		"mon": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"tue": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"wed": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"thu": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"fri": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"sat": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		],
		"sun": [
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
			21, 22, 23
		]
	},
	"use_selected_timezone": true,
	"schedule_timezone": 10800,
	"website_photo_url": "test",
	"tg_account_type": 1,
	"currency": "EUR",
	"only_crypto": false,
	"exclude_crypto": false,
	"kktu_ids": ["some_uid_kktu"],
	"target_search": [],
	"target_bots": [
		{
			"url": "t.me/bot_1",
			"title": "Bot name 1",
			"photo_url": "https://cdn4.telesco.pe/file/path_to_photo_url_for_bot_1.jpg"
		},
		{
			"url": "t.me/bot_2",
			"title": "Bot name 2",
			"photo_url": "https://cdn4.telesco.pe/file/path_to_photo_url_for_bot_2.jpg"
		}
	],
	"event": { "tg_id": "KuliaGnSD", "name": "test1" }
}

Response field descriptions

ParameterTypeDescription
ad_idNumberUnique advertisement ID.
telegram_idNumberAdvertisement ID in Telegram.
account_idStringAccount ID.
account_nameStringAccount name.
campaign_idNumberCampaign ID.
campaign_nameStringCampaign name.
titleStringAdvertisement title.
textStringAdvertisement text.
promote_urlStringPromoted object URL.
promote_url_titleStringPromoted object title.
promote_url_photoStringPath to the object image.
mediaObjectMedia data (token, url, type).
cpmNumberCost per 1,000 impressions.
budgetNumberTotal budget.
langsArray of stringsTargeting languages.
topicsArray of stringsTargeting topics.
channelsArray of stringsTargeting channels.
exclude_topicsArray of stringsExcluded topics.
exclude_channelsArray of stringsExcluded channels.
other_infoStringAdditional information (ERID).
decline_reasonArray of objectsRejection reasons.
statusStringAdvertisement status.
status_updated_dtStringStatus update date.
cannot_edit_fieldsArray of stringsNon-editable fields.
ad_typeStringTargeting type.
countriesArray of stringsTargeting countries.
user_locationsArray of stringsTargeting cities.
audiencesArray of numbersTargeting audiences.
exclude_audiencesArray of numbersExcluded audiences.
is_audiencesBooleanAudience targeting is used.
is_exclude_audiencesBooleanExcluded audiences are used.
website_nameStringWebsite name.
is_websiteBooleanWhether the promoted object is a website.
views_per_userNumberViews per user limit.
show_pictureBooleanShow avatar.
exclude_politicBooleanExclude political content.
promote_url_picture_idStringObject image ID.
all_topics_interested_usersBooleanTarget users interested in all topics.
deviceStringTargeting device.
target_user_channelsArray of stringsUser targeting channels.
exclude_target_user_channelsArray of stringsExcluded user channels.
button_typeStringButton type.
daily_budgetNumberDaily budget limit.
after_moderation_statusStringStatus after moderation.
start_dateString (ISO 8601)Start date.
end_dateString (ISO 8601)End date.
scheduleObjectDelivery schedule.
use_selected_timezoneBooleanUse timezone.
schedule_timezoneNumberSchedule timezone.
website_photo_urlStringWebsite image URL.
tg_account_typeNumberTelegram account type.
currencyStringCurrency code.
only_cryptoBooleanShow only in crypto channels.
exclude_cryptoBooleanExclude crypto channels.
kktu_idsArray of stringsKKTU identifiers.
target_searchArray of strings/nullSearch target queries.
target_botsArray of objects/nullBots for targeting.
event.tg_event_idString/nullPixel Tag event identifier
event.nameString/nullPixel Tag event name

Edit advertisement

PUT /api/advertisement/telegram/{ad_id}

Usage example

http
https://client.adstat.pro/api/advertisement/telegram/{ad_id}

Query parameters

ParameterTypeDescription
ad_idNumberAdvertisement identifier

Body example

json
{
	"title": "123",
	"text": "test",
	"promote_url": "https://test.ru",
	"cpm": 2,
	"other_info": "erid: test",
	"media_token": null,
	"website_name": "Яндекс",
	"views_per_user": 1,
	"show_picture": false,
	"promote_url_picture_id": "test_token",
	"button_type": "open_website",
	"daily_budget": 0,
	"after_moderation_status": "active",
	"start_date": null,
	"end_date": null,
	"schedule": null,
	"use_selected_timezone": false,
	"schedule_timezone": null,
	"kktu_ids": ["some_uid_kktu"]
}

Body parameter descriptions

ParameterTypeDescription
titleStringAdvertisement title.
textStringAdvertisement text.
promote_urlStringPromoted object URL.
cpmNumberCost per 1,000 impressions.
other_infoStringERID token (for manual labeling).
media_tokenString/nullMedia file token.
website_nameStringWebsite name (for external links).
views_per_userNumberViews per user limit.
show_pictureBooleanShow avatar.
promote_url_picture_idStringObject image ID.
button_typeStringButton type (open_website).
daily_budgetNumberDaily budget limit.
after_moderation_statusStringStatus after moderation.
start_dateString (ISO 8601)Start date.
end_dateString (ISO 8601)End date.
scheduleObject/nullDelivery schedule.
use_selected_timezoneBooleanUse timezone.
schedule_timezoneNumber/nullSchedule timezone.
kktu_idsArray of stringsKKTU identifiers.

Upload media

POST api/v1/advertising/telegram/upload_media?account_id={account_id}

Usage example

http
https://clientapi.adstat.pro/api/v1/advertising/telegram/upload_media?account_id=ACC0000222

Query parameters

ParameterTypeDescription
account_idStringAccount identifier (ACC0000222).

Body

The request body includes the media parameter with a binary file.

JavaScript example:

javascript
const mediaFormData = new FormData();
mediaFormData.append("media", file);

Response

json
{
	"media_token": "test_token",
	"content_type": "image/jpeg",
	"error": null
}
ParameterTypeDescription
media_tokenStringUnique media file token.
content_typeStringFile MIME type (image/jpeg, video/mp4).
errorString/nullError description, or null on success.

ORD KKTU

Important information

For cabinets with automatic labeling, KKTU selection is required. An advertisement cannot be created without specifying a KKTU identifier.

Get available KKTU list

GET /api/kktu

Request example

http
https://clientapi.adstat.pro/api/kktu/

Response example

json
{
	"items": [
		{
			"id": "0193d46f-1888-7553-8d09-53116794ddb3",
			"tree_id": 1000000,
			"code": "1",
			"name": "АЛКОГОЛЬНЫЕ НАПИТКИ, ТАБАЧНЫЕ ИЗДЕЛИЯ",
			"children": [
				{
					"id": "0193d46f-1889-7cb1-b1a0-97f889d945ad",
					"tree_id": 1001000,
					"code": "1.1",
					"name": "АЛКОГОЛЬНЫЕ НАПИТКИ",
					"children": [
						{
							"id": "0193d46f-1889-7cb1-b1a0-9800191b62e9",
							"tree_id": 1001001,
							"code": "1.1.1",
							"name": "ВИНО",
							"children": []
						},
						{
							"id": "0193d46f-1889-7cb1-b1a0-98184fd25317",
							"tree_id": 1001002,
							"code": "1.1.2",
							"name": "КРЕПКИЕ АЛКОГОЛЬНЫЕ НАПИТКИ",
							"children": []
						},
						{
							"id": "0193d46f-1889-7cb1-b1a0-982f7acfc72c",
							"tree_id": 1001003,
							"code": "1.1.3",
							"name": "АЛКОГОЛЬНЫЕ НАПИТКИ (РАЗНОЕ)",
							"children": []
						},
						{
							"id": "0193d46f-1889-7cb1-b1a0-9830cb4b6bab",
							"tree_id": 1001004,
							"code": "1.1.4",
							"name": "СЛАБОАЛКОГОЛЬНЫЕ НАПИТКИ",
							"children": []
						}
					]
				},
				{
					"id": "0193d46f-1889-7cb1-b1a0-9842865b2e1b",
					"tree_id": 1002000,
					"code": "1.2",
					"name": "ТАБАЧНЫЕ ИЗДЕЛИЯ",
					"children": [
						{
							"id": "0193d46f-1889-7cb1-b1a0-985cd2f1e210",
							"tree_id": 1002001,
							"code": "1.2.1",
							"name": "ТАБАЧНЫЕ ИЗДЕЛИЯ",
							"children": []
						}
					]
				}
			]
		}
	]
}

How to fill kktu_ids

  • The kktu_ids field is filled with the id from the third nesting level.
  • You cannot use id values from the first or second level.
  • Only one value may be selected when creating or editing an advertisement.

Pixel Tag

Get available Pixel Tag events

GET /api/pixel_events/?account_id={account_id}

Request example

http
https://clientapi.adstat.pro/api/pixel_events/?account_id={account_id}

Response example

json
{
	"items": [
		{
			"id": "test_event_some_property",
			"pixel_id": "test_event_some_property",
			"tg_event_id": "test_event_some_property",
			"title": "test_event_some_property",
			"type": "custom",
			"status": "inactive",
			"ads_count": 1,
			"created_at": "2025-06-04T14:36:45+00:00",
			"last_triggered_at": null,
			"code_snippet": "<script>\ntgp(\"event\",\"test_event_some_property\");\n</script>"
		}
	]
}

How to fill tg_event_id

  • The tg_event_id field is filled with tg_event_id from the list of available Pixel Tag events.
  • Each cabinet has its own set of Pixel Tag events.
  • Only one value may be selected when creating or editing an advertisement.

Working with phone number audiences

Important: This functionality is available only for advertising cabinets with geolocation set to Uzbekistan.


Get available audiences

Method: GET

URL: /api/advertisement/telegram/{account_id}/audiences/

Request example:

GET https://clientapi.adstat.pro/api/advertisement/telegram/{account_id}/audiences/

Response example:

json
[
	{
		"telegram_id": 1,
		"title": "phone_numbers_1"
	},
	{
		"telegram_id": 2,
		"title": "phone_numbers_2"
	}
]

Create a new audience

Method: POST

URL: /api/advertisement/telegram/{account_id}/audiences

Creates a new audience list from an uploaded file with phone numbers.

Request example:

POST https://clientapi.adstat.pro/api/advertisement/telegram/ACC010101010101/audiences

Request parameters (Form Data):

FieldTypeDescriptionRequired
titleStringName of the audience being createdYes
audienceFileBinary file containing phone numbersYes

File format:

You can upload a CVS or txt file up to 10 MB containing a list of phone numbers or their SHA256 hashes, separated by commas or line breaks. Rules for building the number database:

• Phone number format — digits only, without plus signs or other symbols.

• The number must be in international format, i.e. start with 998 for Uzbekistan.

• The file must contain at least 1,000 phone numbers.

Request body example:

(The body is sent as multipart/form-data, so it is not serialized as JSON. Below is a conditional representation:)

http
Content-Type: multipart/form-data

title=12345
audience=<file with phone numbers>