Developers » API methods » Ads API » ads.createAds
Ads APIads.createAds
Creates ads.
Please note! Maximum allowed number of ads created in one request is 5. Minimum size of ad audience is 50 people.

This method can be called with a user token. Access rights required: ads.
Parameters
account_idadvertising account ID.
required parameter
dataserialized JSON array of objects that describe created ads. Description of ad_specification objects see below.

Data example value:

[{
    "campaign_id": 123456,
    "ad_format": 1,
    "cost_type": 0,
    "cpc": 2.00,
    "category1_id" : 5,
    "title": "Test Title",
    "link_url" : "https://mysite.com",
    "name": "My ad"
}]

required parameter, string
ad_specification
campaign_idcampaign ID where the ad is to be created.
required parameter, int (number)
ad_formatad format:
  • 1 image and text;
  • 2 big image;
  • 4 community, square image;
  • 8 special community format;
  • 9 community post (an advertising post can be created using the wall.postAdsStealth method).
required parameter, int (number)
cost_typepayment type:
  • 0 pay-per-click;
  • 1 pay-per-impression.
required parameter, int (number))
cpcif cost_type is set to 0 - cost per click. The price is given in rubles with kopecks after the decimal point.
required parameter, fractional
cpmif cost_type is set to 1 - cost per 1000 impressions. The price is given in rubles with kopecks after the decimal point.
required parameter, fractional
impressions_limitIf ad_format is set to 9 limitation to impressions number per user. Allowed values: 1, 2, 3, 5, 10, 15, 20.
int (number)
impressions_limitedif cost_type is set to 1 and impressions_limit can not be specified a sign that the number of ad impressions is shown per user is limited.
  • 0 no limit;
  • 1 ad will be shown to each user of selected auditory no more than 100 times.
flag, can be 0 or 1
ad_platformPossible values:
    • (if ad_format = 1)
    • 0 VK and partners sites;
    • 1 VK only.
    • (if ad_format = 9)
    • all all platforms;
    • desktop web version;
    • mobile mobile version and apps.
ad_platform_no_wall For ad_format = 9 only. 1 don't show on communities walls (by default: 0).
all_limitTotal spending limit for the ad a whole number of rubles.
positive number
category1_idID of ad theme or sub-theme. If the ad has several themes, additional can be set in category2_id. See. ads.getCategories.
category2_idID of ad theme or sub-theme.
statusAd status:
  • 0 stopped
  • 1 running
    flag, can be 0 or 1
nameAd name (for internal identification and statistics).
string, 3-60 characters
titleAd title .
required parameter, string, 3-25 characters
descriptionAd description required if "pay-per-click" type is selected.
string, 3-60 characters
link_urlA link to the advertised object in the format
http://yoursite.cm
or
http://vk.cm/club1
If the link has "{ad_id}" or "{campaign_id}", they are replaced with the id of the ad or campaign, respectively, when a user clicks the link.
required parameter, string
link_domainThe advertised domain in the format
http://yoursite.cm

string
photoThis value is returned after a successful photo upload.
required parameter
videoThis value is returned after a successful video upload.
disclaimerDisplays a warning "use with caution" (only for medical products and services).
  • 1 - warning on.
flag, can be 0 or 1 
Targeting settingsTargeting settings. See description below.

Targeting settings
sexSex:
  • 0 any
  • 1 female
  • 2 male
required parameter, int (number) 
age_fromMinimum age. (0 not set).
required parameter, int (number)
age_toMaximum age. (0 not set).
required parameter, int (number)
birthdayBirthday. Set as sum of flags:
  • +1 - today
  • +2 - tomorrow
  • +4 - next week

int (number)
countryCountry. (0 not set).
,
citiesCities.
a sequence of comma separated numbers.
cities_notCities that must be withdrawn from targeting.
a sequence of comma separated numbers
statusesRelationship status:
  • 1 Single
  • 2 In a relationship
  • 3 Engaged
  • 4 Married
  • 5 It's complicated
  • 6 Actively searching
  • 7 In love
  • 8 In a civil union
a sequence of comma separated numbers 
groupsGroups.
a sequence of comma separated numbers
appsApplications.
a sequence of comma separated numbers
apps_notApplications that must be withdrawn from targeting.
a sequence of comma separated numbers
districtsCity districts.
a sequence of comma separated numbers
stationsSubway stations.
a sequence of comma separated numbers
streetsStreets.
a sequence of comma separated numbers
schoolsSchools.
a sequence of comma separated numbers
universitiesUniversities.
a sequence of comma separated numbers
positionsJob positions.
a sequence of comma separated numbers
religionsReligious views.
a sequence of comma separated numbers
interestsInterests.
a sequence of comma separated words
browsersBrowsers and devices.
a sequence of comma separated numbers
interest_categoriesInterests categories.
a sequence of comma separated numbers
user_devicesDevices.
a sequence of comma separated numbers
user_osOperating systems
a sequence of comma separated words
user_browsersInternet browsers.
a sequence of comma separated words
retargeting_groupsIDs of retargeting groups.
a sequence of comma separated numbers
retargeting_groups_notIDs of retargeting groups that must be withdrawn from targeting.
a sequence of comma separated numbers
payingPayments:
  • 1 didn't use VK payments;
  • 2 used VK paymetns.
 int (number) 
travellersOnly travellers.
  • 1 - enable this filter.
    flag, can be 0 or 1
school_fromSchool graduation year minimum. (0 not set).
required parameter, int (number)
school_toSchool graduation year maximum (0 not set).
required parameter, int (number)
uni_fromUniversity graduation year minimum (0 not set).
required parameter, int (number)
uni_toUniversity graduation year maximum (0 not set).
required parameter, int (number)
tagsSearch keywords.
a sequence of comma separated strings.
Result
Returns an array of responses for requests in data array. Respective object in an output array contains id of the created client (null if failed), and error_code and error_desc fields in case of error. Non-null id and error_code 602 mean that the client was created but some fields were probably not assigned to it because they were incorrect.
Errors
601Permission denied. You have requested too many actions this day. Try later.
602Some part of the request has not been completed
Global errors can occur while running. See their descriptions on this page.
Version historyShow all
5.62
messages.getHistoryAttachments method returns message_id field. User object has a new value of relationship status (8 "in a civil union").
5.59
Images sizes requeriments for advertisments has been updated. See this page for a further information.
5.16
Schools field is divided into two fields: schools and universities. Their id field is correct now.