Update Campaign

PATCH /a/campaigns/{campaignId}

Partially update a campaign: send only the fields to change. Payout and revenue are in the campaign currency and payment model. Dates are Y-m-d H:i:s in the campaign timezone; endDate must be after startDate (the stored value is used for whichever one is not sent). Returns the updated campaign.

Authentication

Domain ID — your network's tenant ID (header: X-Domain-Id)

API Key (header: X-Api-Key)

Secret Key (header: X-Api-Secret)

No API key yet? Start a 14-day free trial and generate a key from your dashboard's security settings. No credit card required.

Parameters

NameInTypeRequiredDescription
campaignIdpathintegerYes

Request Body *

Content-Type: application/json

FieldTypeRequiredDescription
campaignNamestringNo
advertiserIdintegerNo
statusstring (active | pending | ended)No
visibilitystring (public | requireapproval | private)No
urlstringNo
previewUrlstringNo
payoutnumberNo
revenuenumberNo
startDatestringNo
endDatestringNo
descriptionstringNo
termsstringNo
privateNotestringNo

Responses

StatusDescription
200Campaign updated; data is the campaign after the change
404Campaign not found
422Validation error

Response fields (inside data)

FieldTypeDescription
campaignIdinteger
advertiserIdinteger
advertiseId deprecatedintegerMisspelled duplicate of advertiserId; will be removed.
campaignNamestring
statusstring (active | pending | ended)
visibilitystring (public | requireapproval | private)public: any affiliate can run it; requireapproval: affiliates apply first; private: only affiliates you assign.
previewUrlstring
urlstringDestination (offer) URL, with tracking macros such as {click_id}.
paymentModelstringPayment model code, e.g. CPA, CPL, CPS, CPI.
payoutnumber | stringWhat the affiliate earns per conversion: a number, or a string such as "12.5%" when the payment model is a percentage of the sale (CPS, CPAS, RevShare, IB).
revenuenumber | stringWhat the advertiser pays you per conversion; same format as payout.
currencystring
startDatestringY-m-d H:i:s, in the campaign timezone.
endDatestringY-m-d H:i:s, in the campaign timezone.
descriptionstringPlain text (HTML removed).
termsstringPlain text (HTML removed).
categoriesarray of strings
eventsarray of objectsConversion events (goals) of the campaign.
events[].namestring
events[].tokenstringEvent token to send in postbacks.
targetingRulesarray of objectsActive targeting rules.
targetingRules[].idinteger
targetingRules[].namestring
targetingRules[].action_onstringWhich traffic the rule acts on, e.g. All, Click Only, Conversion only.
targetingRules[].conditionsarray of objectsConditions (field, operator, value).
targetingRules[].fallback_urlstring
targetingRules[].fallback_campaign_idinteger
cappingRulesarray of objectsActive caps.
cappingRules[].idinteger
cappingRules[].namestring
cappingRules[].cap_typestring (shared | individual)shared: one cap for all affiliates together; individual: a cap per affiliate.
cappingRules[].typestring (gross_clicks | unique_clicks | gross_conversions | approved_conversions | pending_conversions)What is counted against the cap.
cappingRules[].periodstring (hourly | daily | weekly | monthly)How often the cap resets.
cappingRules[].valueintegerCap limit per period.
cappingRules[].over_cap_actionstring (stop | conversion_accept | conversion_reject | conversion_pending)Once the cap is reached: stop = stop the campaign; conversion_accept / conversion_reject / conversion_pending = keep tracking and mark further conversions approved, rejected or pending.
cappingRules[].eventstringEvent token(s) the cap counts, if limited to events.
cappingRules[].timezonestringTimezone the cap period resets in.
payoutRulesarray of objectsActive payout rules (prices that override the campaign price when their conditions match).
payoutRules[].idinteger
payoutRules[].namestring
payoutRules[].modelstring
payoutRules[].conditionsarray of objects
payoutRules[].affiliate_pricenumber | stringWhat the affiliate earns under this rule (number, or "x%" for percentage models).
payoutRules[].advertiser_pricenumber | stringWhat the advertiser pays under this rule (number, or "x%").
payoutRules[].currencystring
creativesarray of objectsApproved creatives. file is set for banner_image, video and email; email for email; content for html_ad and sms_text.
creatives[].idinteger
creatives[].titlestring
creatives[].typestringBanner Image, Email Creative, SMS Text, Video or Html ad.
creatives[].fileobject
creatives[].file.urlstring
creatives[].file.namestring
creatives[].file.content_typestring
creatives[].emailobject
creatives[].email.sender_namestring
creatives[].email.subject_linestring
creatives[].contentobject
creatives[].content.codestring
landingPagesarray of objects
landingPages[].namestring
landingPages[].urlstring
landingPages[].typestring