Creates an advertising campaign. Only campaigns of type basic can be created.
Method
create.campaigns
Description
Creates an advertising campaign. Only campaigns of type basic can be created.
Who has access
Agents and clients
The number of advertising campaigns available is determined by the client's service plan.
Request parameters
Name
Type
Required
Valid values
Description
access_token
string
yes
Session key used to authenticate the request
user_id
number
no
Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call get.customer_users.
name
string
yes
Advertising campaign name
description
string
no
Up to 255 characters
Advertising campaign description
status
enum
no
active
inactive
Advertising campaign status
site_id
number
yes
Unique site ID
campaign_conditions
object
no
Campaign matching conditions
Site block number assignment
site_blocks
array
no
Associates virtual numbers with site blocks. If omitted, no site blocks are configured. Cannot be provided when status is inactive; otherwise, invalid_parameters_combination is returned.
site_block_id
number
yes
Unique site block ID
phone_number_id
number
yes
Unique ID of the virtual number assigned to the site block. Retrieve available numbers with get.campaign_available_phone_numbers. If the ID is not returned by that method, entity_not_found is returned. A call_tracking number can be assigned to only one advertising campaign; if it is already assigned, already_in_use is returned.
redirection_phone_number_id
number
no
Unique ID of the forwarding number. Used only when phone_number_id refers to a call_tracking number. Retrieve available forwarding numbers with get.campaign_available_redirection_phone_numbers. This parameter is required for call_tracking numbers; otherwise, required_parameter_missed is returned. It must not be provided for va numbers; otherwise, invalid_parameters_combination is returned. Only IDs returned by get.campaign_available_redirection_phone_numbers are accepted; otherwise, invalid_parameter_value is returned. The va component is required; if it is not enabled, parameter_component_disabled is returned.
dynamic_call_tracking_enabled
boolean
no
true, false
Enables dynamic call tracking for the site block. Only available numbers without the "Use in Virtual PBX" flag and with the same area code as the block's default campaign number can be added to the pool. If too few numbers are available, additional numbers are purchased automatically. Calls to pool numbers follow the call-handling rules of the block's default campaign number. Can be true only for va or call_tracking numbers. Requires the dynamic_call_tracking component, cannot be used when status is inactive, and requires dynamic_call_tracking when enabled for any block.
Dynamic call tracking
dynamic_call_tracking
object
no
Dynamic call tracking settings. Required when dynamic_call_tracking_enabled is true for any site block. Requires the dynamic_call_tracking component.
reservation_time
enum
no
5m
10m
15m
20m
30m
1h
2h
4h
8h
1d
1w
How long a number remains assigned to a visitor. Default: 15m. After this period, the number may be assigned to another visitor, or remain assigned if sufficient call tracking numbers are available.
count_virtual_numbers
number
yes
Minimum: 1
Number of virtual numbers required for dynamic call tracking in each site block. If necessary, the specified number of numbers is purchased.
count_visits
number
yes
Minimum: 1
Estimated number of visits to the advertising campaign per day
Condition groups
group_conditions
array
yes
Maximum number of groups 30
Groups of campaign matching conditions
Conditions
conditions
array
yes
Maximum number of conditions for a group is 50
Conditions in the group
type
enum
yes
include
exclude
Condition behavior: include matches visits that satisfy the condition; exclude excludes them
campaign_parameter
enum
yes
Campaign parameter evaluated by the condition. See "Campaign parameters and operators".
value
string
yes
Value to compare against. Some campaign parameters accept predefined values; see "Campaign parameters and operators".
operator
enum
yes
=, sub, ~
Comparison operator. Supported values depend on campaign_parameter: = for exact matches, sub for substring matches, and ~ for regular expressions.