Update Campaigns

Why Update a Campaign?

Typically, a campaign runs for a specific duration of time, with flights in the campaign having a common theme, and an advertiser's ads that directly correlate with the campaign. During the course of a campaign, however, you may wish to make changes to a flight, the ads associated with a flight, or specifics about the campaign. In this case, you will want to use the Update Campaigns API call to make changes to an existing campaign.

API Syntax

When using the Update Campaigns API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

PUT https://api.kevel.co/v1/campaign/{CampaignID}

Where:

📘

Partial Update Supported

This endpoint supports partial update. API callers need only supply the attributes they want to change. Attributes not included in update requests will retain their previous values. To unset or clear an attribute, set its value to NULL.

The example below will deactivate an entity while leaving all other settings unchanged:

cURL

curl --location --request PUT 'https://api.kevel.co/v1/{entity_type}/{entity_id}' \
--header 'X-Kevel-ApiKey: {api_key}' \
--header 'Content-Type: application/json' \
--data '{"IsActive":false}'

Campaign Fields

Field Type Requirement Description
CampaignID int32 required ID of the Campaign
Id int32 required The ID of the Campaign
AdvertiserId int32 required The ID of the Advertiser
Name string required The name of the Campaign
IsActive boolean required Whether campaign is active or not
isDeleted boolean optional If want to delete, set to true

API Response

{
  "IsActive": true,
  "DontAffectParentFreqCap": null,
  "Flights": [],
  "DailyCapAmount": null,
  "FreqCapType": 0,
  "CapType": null,
  "IsFreqCap": false,
  "IsDeleted": false,
  "EndDateISO": null,
  "Price": 0,
  "IsArchived": false,
  "LifetimeCapAmount": null,
  "FreqCapDuration": null,
  "FreqCap": null,
  "SalespersonId": null,
  "AdvertiserId": 123456,
  "Name": "Nike Q4 Campaign",
  "Id": 56789,
  "CustomFieldsJson": null,
  "StartDateISO": "2018-11-11T00:00:00.0000000"
}

Example Request

curl -X PUT -H "X-Adzerk-ApiKey:<APIKEY>" -H "Content-Type:application/json" "https://api.kevel.co/v1/campaign/123456" --data-binary '{"Name":"Nike Q4 Campaign","Id":56789,"AdvertiserId":12345,"IsActive":true}'