Skip to content

Copy a Campaign

Request

Copy a campaign

Security
Auth0(Required scopes: offline_accessmanage:services)
Path
campaign_idintegerrequired

Numeric ID of the campaign object

Bodyapplication/jsonrequired
advertiser_idinteger
namestring, <= 256 charactersrequired
start_datestring, (date-time)
end_datestring, (date-time)
merit_pixelsArray of objects, <= 10 items

Merit pixels for multi-merit attribution (up to 10 per campaign). If merit_pixel_id is updated then merit_pixels will be synchronized with it. If merit_pixels is updated then merit_pixel_id will be synchronized with it. Update both fields at the same time is not supported.

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).
statusbooleanrequired
Default:true
copy_assigned_site_listsboolean

If true copy everything under 'site lists'

Default:false
copy_vendor_contractsboolean

If true copy everything under 'vendor contracts'

Default:false
copy_brain_settingsboolean

Used to be called 'remember_source'. If true set the source_campaign_id to campaign id

Default:false
copy_audience_in_brainboolean

If true copy 'custom_brain_selections'

Default:false
copy_viewabilityboolean

If true then copy viewability fields

Default:false
budgetobject
merit_pixel_idinteger or nulldeprecated

Deprecated. Use merit_pixels instead. If merit_pixel_id is updated then merit_pixels will be synchronized with it. If merit_pixels is updated then merit_pixel_id will be synchronized with it. Update both fields at the same time is not supported.

curl -i -X POST \
  'https://api.mediamath.com/api/v3.0/campaigns/{campaign_id}/copy' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "advertiser_id": 0,
    "name": "string",
    "start_date": "2019-08-24T14:15:22Z",
    "end_date": "2019-08-24T14:15:22Z",
    "merit_pixel_id": 0,
    "merit_pixels": [
      {
        "pixel_id": 1,
        "weight": 1,
        "funnel_position": 1
      }
    ],
    "status": true,
    "copy_assigned_site_lists": false,
    "copy_vendor_contracts": false,
    "copy_brain_settings": false,
    "copy_audience_in_brain": false,
    "copy_viewability": false,
    "budget": {
      "flights": [
        {
          "start_date": "2019-08-24T14:15:22Z",
          "end_date": "2019-08-24T14:15:22Z",
          "total_budget": 0.1,
          "total_impression_budget": 100
        }
      ]
    }
  }'

Responses

Campaign response

Bodyapplication/json
dataobject(campaign_full_with_inherited)
metaobject(single_metadata)
Response
{ "data": { "archived": false, "status": true, "name": "string", "service_type": "SELF", "io_name": "string", "io_reference_num": "string", "is_programmatic_guaranteed": true, "political": false, "source_campaign_id": 7, "zone_name": "string", "viewability": { … }, "identity": { … }, "ad_server": { … }, "pacing": { … }, "attribution": { … }, "vendor_contracts": [ … ], "mfa_avoidance": "INHERIT", "targeting_identity_level": "INHERIT", "id": 0, "entity_type": "string", "version": 0, "advertiser_id": 0, "created_on": "2019-08-24T14:15:22Z", "updated_on": "2019-08-24T14:15:22Z", "locked_on": "2019-08-24T14:15:22Z", "v3_usage": true, "duration": { … }, "goals": { … }, "budget": { … }, "frequency": { … }, "inventory": { … }, "site_lists": [ … ], "custom_brain_selections": [ … ], "strategies": { … }, "strategy_groups": { … }, "inherited_mfa_avoidance": "INHERIT", "inherited_mfa_from": "Organization", "inherited_targeting_identity_level": "INDIVIDUAL" }, "meta": { "status": "success" } }