# Create a Campaign

Create a campaign

Endpoint: POST /campaigns
Version: 3.0.1807
Security: Auth0

## Request fields (application/json):

  - `archived` (boolean)

  - `status` (boolean)

  - `name` (string, required)

  - `service_type` (string, required)
    Enum: "SELF", "MANAGED"

  - `io_name` (string)

  - `io_reference_num` (string)

  - `is_programmatic_guaranteed` (boolean)

  - `political` (boolean)

  - `source_campaign_id` (integer)
    Example: 7

  - `zone_name` (string)

  - `viewability` (object)

  - `viewability.vendor_id` (integer, required)
    Example: 34

  - `viewability.type` (string, required)
    Enum: "AUTO_TAG", "BYOV"

  - `viewability.sample_rate` (number, required)

  - `identity` (object)

  - `identity.device_graph_only` (boolean)

  - `identity.bid_min_devices` (integer)

  - `identity.connected_id_type` (string)
    Enum: "DETERMINISTIC_FIRST"

  - `ad_server` (object)

  - `ad_server.ad_server_id` (integer)
    Example: 19

  - `ad_server.ad_server_username` (string)

  - `ad_server.ad_server_password` (string)

  - `ad_server.use_default_ad_server` (boolean)

  - `ad_server.ad_server_fee` (number)

  - `pacing` (object)

  - `pacing.pacing_alert` (number)

  - `pacing.impression_cap_automatic` (boolean)

  - `pacing.impression_cap_amount` (integer)
    Example: 11

  - `pacing.impression_cap_type` (string)
    Enum: "even", "asap", "no-limit"

  - `pacing.spend_cap_type` (string)
    Enum: "even", "asap", "no-limit"

  - `pacing.spend_cap_amount` (number)

  - `pacing.spend_cap_automatic` (boolean)

  - `pacing.brain_intraday_pacing` (boolean)

  - `pacing.spend_pace_ahead` (boolean)
    feature still in development

  - `pacing.impression_pace_ahead` (boolean)
    feature still in development

  - `attribution` (object)

  - `attribution.has_custom_attribution` (boolean)

  - `attribution.custom_attribution_source` (string)
    Enum: "3rd Party Attribution", "T1 MTA via Neustar"

  - `attribution.pc_window_minutes` (integer)
    Example: 5

  - `attribution.pv_window_minutes` (integer)
    Example: 6

  - `attribution.pv_pct` (number)

  - `attribution.merit_pixel_id` (integer)
    Deprecated. Use `merit_pixels` instead.
If `merit_pixel_id` is set on create or update then `merit_pixels` will be synchronized with it.
If `merit_pixels` is set on create or update then `merit_pixel_id` will be synchronized with it.
Set up (update) both fields at the same time is not supported.
    Example: 17

  - `attribution.merit_pixels` (array)
    Merit pixels for multi-merit attribution (up to 10 per campaign).
If `merit_pixel_id` is set on create or update then `merit_pixels` will be synchronized with it.
If `merit_pixels` is set on create or update then `merit_pixel_id` will be synchronized with it.
Set up (update) both fields at the same time is not supported.
Send empty array to remove all pixels. Send only pixel id for element to reset other fields to default.
Validation rules:
- Each `pixel_id` must reference an event pixel that belongs to the campaign's advertiser.
- `pixel_id` values must be unique within the array.
- `weight` accepts values from 0.00 to 10.00 with at most 2 decimal places; at least one pixel must have a weight greater than 0.
- `funnel_position` values must be unique; if any pixel has a funnel position then all pixels must have one, with no gaps (1 to N).

  - `attribution.merit_pixels.pixel_id` (integer, required)

  - `attribution.merit_pixels.weight` (number)

  - `attribution.merit_pixels.funnel_position` (integer)

  - `attribution.conversion_type` (string)
    Enum: "every", "variable"

  - `attribution.conversion_variable_minutes` (integer)
    Deduplication window in minutes. Must be 1 or greater when conversion_type is variable. To attribute all merit events without a deduplication window, use conversion_type: every (in which case this value is ignored).
    Example: 1

  - `vendor_contracts` (array)

  - `vendor_contracts.vendor_id` (integer, required)
    Example: 23

  - `vendor_contracts.use_mm_contract` (boolean)

  - `vendor_contracts.price` (number)

  - `vendor_contracts.rate_card_type` (string)
    Enum: "CPM", "FIXED"

  - `mfa_avoidance` (string)
    Enum: "INHERIT", "ALLOW_ALL", "EXCLUDE_MFA"

  - `targeting_identity_level` (string)
    Enum: "INHERIT", "INDIVIDUAL", "HOUSEHOLD"

  - `advertiser_id` (integer, required)
    Example: 8

  - `goals` (object, required)

  - `goals.goal_type` (string, required)
    Enum: "spend", "reach", "cpc", "cpe", "cpa", "roi", "ctr", "vcr", "viewability_rate", "vcpm"

  - `goals.goal_alert` (number)

  - `goals.goal_value` (number, required)

  - `goals.goal_category` (string)
    Enum: "audience", "engagement", "response"

  - `budget` (object, required)

  - `budget.total_budget` (number)

  - `budget.total_impression_budget` (integer)
    Example: 18789

  - `budget.currency_code` (string, required)
    Example: USD

  - `budget.margin_pct` (number)

  - `budget.dynamic_budget_allocation_type` (string)
    Enum: "SBA_AUTO_ALLOCATION", "SBA_RECOMMENDATIONS_ONLY", "OFF"

  - `budget.dynamic_budget_allocation_applied` (string)

  - `budget.dynamic_budget_allocation_available` (string)

  - `budget.flights` (array, required)

  - `budget.flights.start_date` (string, required)

  - `budget.flights.end_date` (string, required)
    The latest end date of flight must be no more than 36 months after the earliest start date

  - `budget.flights.total_budget` (number, required)

  - `budget.flights.total_impression_budget` (integer)
    Example: 12345

  - `frequency` (object)

  - `frequency.frequency_type` (string)
    Enum: "even", "asap", "no-limit", "t1-optimized", "frequency_goal"

  - `frequency.frequency_interval` (string)
    Enum: "hour", "day", "week", "month", "not-applicable"

  - `frequency.frequency_amount` (integer)
    Example: 10

  - `frequency.use_mm_freq` (boolean)

  - `frequency.frequency_optimization` (boolean)

  - `inventory` (object)

  - `inventory.ads_txt_verified` (string)
    Enum: "ANY", "AUTHORIZED_ONLY", "AUTHORIZED_DIRECT_ONLY", "NONE"

  - `inventory.minimize_multi_ads` (boolean)

  - `inventory.override_suspicious_traffic_filter` (boolean)

  - `inventory.suspicious_traffic_filter_level` (integer)

  - `inventory.dcs_data_is_campaign_level` (boolean)

  - `inventory.restrict_targeting_to_deterministic_id` (boolean)

  - `inventory.restrict_targeting_to_same_device_id` (boolean)

  - `site_lists` (array)

  - `site_lists.id` (integer, required)
    Example: 55

  - `site_lists.assigned` (boolean, required)

  - `custom_brain_selections` (array)

  - `custom_brain_selections.selection_id` (integer)
    Example: 23

  - `custom_brain_selections.selection_type` (string)
    Enum: "Audience Target", "Data Pixel", "Event Pixel", "Segment", "Dynamic"

## Response 201 fields (application/json):

  - `data` (object)

  - `data.inherited_mfa_avoidance` (string)
    available if mfa_avoidance = INHERIT
    Enum: "INHERIT", "ALLOW_ALL", "EXCLUDE_MFA"

  - `data.inherited_mfa_from` (string)
    available if mfa_avoidance = INHERIT
    Enum: "Organization", "Agency", "Advertiser", "Campaign"

  - `data.inherited_targeting_identity_level` (string)
    available if targeting_identity_level = INHERIT
    Enum: "INDIVIDUAL", "HOUSEHOLD"

  - `meta` (object)

  - `meta.status` (string, required)
    Example: success

## Response 400 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 401 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 403 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

