Line Items

Add a Line Item

Adds a Line Item to a Campaign Plan. One Line Item is one thing you buy. It is coarser than an ad set, and it is not one campaign.

A Line Item holds the envelope of an intent, not a script for execution. One line can produce more than one provider object. Therefore it holds only what is the same for all of them. This is why a line has no optimization goal.

Only the channel and the objective are necessary. The new line starts in draft. If the Campaign Plan was approved, this call puts the Campaign Plan back into draft, and the answer tells you so.

post/context/campaign-plans/{slug}/line-items

Request

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

Path parameters

slugstring required

Request body

advertiser_idstring

The ad account this line runs through. On the line rather than the Campaign Plan, because an account belongs to one provider and a Campaign Plan spans several channels.

age_maxinteger
age_mininteger
budgetnumber

Whole units of the plan’s currency: 40.5 is €40.50. Whether it reads as a total or a daily rate is derived from the effective end date, never stored.

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

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

countriesstring[]

ISO 3166-1 alpha-2. Empty is a drafting state, not an error.

end_datestring

Omit to inherit the Campaign Plan’s. Present (here or inherited) makes the budget a total for the period; absent makes it a daily rate.

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

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

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

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

persona_idstring

Must belong to the Campaign Plan’s Brand. It explains the targeting and never supplies its values — the countries and age range above are what execute.

start_datestring

Omit to inherit the Campaign Plan’s.

Example request

{
  "advertiser_id": "acc_1203456789012345",
  "age_max": 44,
  "age_min": 25,
  "budget": 2500,
  "channel": "meta",
  "countries": [
    "FR",
    "BE"
  ],
  "gender": "all",
  "objective": "sales",
  "persona_id": "psn_8c4a20"
}

Response

The Line Item, and the Campaign Plan’s status after the insert. This is the one create here that wraps its row: adding a line to an approved plan returns that Campaign Plan to draft, and you have to be told. The line carries the dates it resolves to, the provider that sells its channel, and the unit its amount reads in.

campaignPlanStatus'draft' | 'approved' required

The plan’s status after the insert. Adding a row to an approved plan returns it to draft.

Example response

{
  "campaignPlanStatus": "draft",
  "lineItem": {
    "advertiserId": "acc_1203456789012345",
    "ageMax": 44,
    "ageMin": 25,
    "budget": 2500,
    "campaignPlanId": "cpl_4e1a08",
    "channel": "meta",
    "countries": [
      "FR",
      "BE"
    ],
    "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": 1,
    "startDate": null,
    "status": "draft",
    "unit": "total",
    "updatedAt": null
  }
}

Changes

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