Line Items

Update a Line Item

Updates a Line Item. Send the base_revision you read. Omit a field to keep it. Send null to clear it.

Any change puts a validated line back into draft. Only that line changes. The Campaign Plan keeps its approval, because that approval speaks about the whole allocation. To open the gate again, validate the line again.

A write that changes nothing keeps the validation, and it does not move the revision.

The provider objects that the line already created do not change. This call never alters a live campaign.

patch/context/campaign-plans/{slug}/line-items/{lineItemId}

Request

  • Base URL: https://api.adcrunch.dev
  • URL: https://api.adcrunch.dev/context/campaign-plans/{slug}/line-items/{lineItemId}
  • Auth: HTTP bearer

Path parameters

lineItemIdstring required
slugstring required

Request body

advertiser_idstring nullable

null unlinks the ad account.

age_maxinteger nullable
age_mininteger nullable
base_revisioninteger required

The revision last read via GET — guards concurrent edits.

budgetnumber nullable

Whole units of the plan’s currency: 40.5 is €40.50. No more decimals than the currency has.

channel'meta' | 'tiktok' | 'snapchat' | 'google_search' | 'google_pmax' | 'google_display' | 'youtube' | 'programmatic_display' | 'linkedin' | 'x'

What is being bought, in a planner’s vocabulary — not a provider. Curated and deliberately incomplete.

countriesstring[]

The array is the value — sending [] clears the geography.

end_datestring nullable

null makes the line inherit the Campaign Plan’s end — which can flip the budget between a total and a daily rate. That is allowed, and it reverts the line to draft.

gender'all' | 'men' | 'women' nullable

Omit for undecided, which executes the same as "all".

objective'awareness' | 'engagement' | 'leads' | 'sales' | 'traffic' | 'app_promotion'

Provider-neutral outcome, translated at execution. There is deliberately no optimization goal here.

persona_idstring nullable
start_datestring nullable

Example request

{
  "base_revision": 2,
  "budget": 3000,
  "countries": [
    "FR",
    "BE",
    "NL"
  ]
}

Response

The Line Item, bare rather than wrapped — unlike the create, which also reports the Campaign Plan status. Any change returns a validated line to draft. executions lists what the line created, the same as a read of its Campaign Plan.

advertiserIdstring nullable required
ageMaxnumber nullable required
ageMinnumber nullable required

Each bound is independently optional, so "35+" is expressible.

budgetnumber nullable required

Whole units of the plan’s currency.

campaignPlanIdstring required
channel'meta' | 'tiktok' | 'snapchat' | 'google_search' | 'google_pmax' | 'google_display' | 'youtube' | 'programmatic_display' | 'linkedin' | 'x' required

The planner’s word for what is being bought, not a provider name. A plan may name a channel we cannot execute.

countriesstring[] required
createdAtnumber required

Milliseconds since the Unix epoch, UTC.

createdBystring required
effectiveEndDatestring nullable required

The line’s own bound where it has one, else the plan’s.

effectiveStartDatestring nullable required

A calendar date, YYYY-MM-DD.

endDatestring nullable required

A calendar date, YYYY-MM-DD.

executableboolean required

Whether this channel could be executed at all today. Derived from our capabilities, never a promise that it will be.

gender'all' | 'men' | 'women' nullable required
idstring required
objective'awareness' | 'engagement' | 'leads' | 'sales' | 'traffic' | 'app_promotion' required
personaIdstring nullable required

Explains the targeting; never supplies its values.

providerstring nullable required

Who sells this channel, or null when nobody we integrate with does.

revisionnumber required

Increments on every write. Send it back as base_revision to edit; a stale one answers 409.

startDatestring nullable required

A calendar date, YYYY-MM-DD.

status'draft' | 'validated' required

validated is the gate on execution.

unit'total' | 'daily' required

How budget reads, derived from the effective end date. Present → a total for the period; absent → a daily rate. A surface must print this beside the amount.

updatedAtnumber nullable required

Milliseconds since the Unix epoch, UTC.

Example response

{
  "advertiserId": "acc_1203456789012345",
  "ageMax": 44,
  "ageMin": 25,
  "budget": 3000,
  "campaignPlanId": "cpl_4e1a08",
  "channel": "meta",
  "countries": [
    "FR",
    "BE",
    "NL"
  ],
  "createdAt": 1768435200000,
  "createdBy": "usr_5d2b71",
  "effectiveEndDate": "2026-05-31",
  "effectiveStartDate": "2026-03-01",
  "endDate": null,
  "executable": true,
  "executions": [],
  "gender": "all",
  "id": "lni_2d9e77",
  "objective": "sales",
  "personaId": "psn_8c4a20",
  "provider": "meta",
  "revision": 3,
  "startDate": null,
  "status": "draft",
  "unit": "total",
  "updatedAt": 1769644800000
}

Changes

No recorded changes to this operation across all 1 revision of this API.