---
search:
  tags:
    - Line Items
    - POST
seo:
  description: >-
    Adds a Line Item to a Campaign Plan. One Line Item is one… Reference for the
    POST /context/campaign-plans/{slug}/line-items endpoint in the AdCrunch API.
sidebar:
  label: Add a Line Item
  badge: POST
title: Add a Line Item
type: openapi-operation
---
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 body** (`application/json`, required)

- `advertiser_id` (string) — 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_max` (integer)
- `age_min` (integer)
- `budget` (number) — 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` (string, required) — What is being bought, in a planner’s vocabulary — not a provider. Curated and deliberately incomplete.
- `countries` (string[]) — ISO 3166-1 alpha-2. Empty is a drafting state, not an error.
- `end_date` (string) — 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` (string) — Omit for undecided, which executes the same as "all".
- `name` (string | null) — A short label of the Line Item, at most 60 characters after trimming. It is not unique, and it is not a handle: nothing looks a Line Item up by it. A blank name is no name. Omit it or send \`null\` for no name.
- `objective` (string, required) — Provider-neutral outcome, translated at execution. There is deliberately no optimization goal here.
- `persona_id` (string) — 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_date` (string) — Omit to inherit the Campaign Plan’s.
- `target_metric` (string) — The metric of the target. \`cpa\`, \`cpc\` and \`cpm\` are costs: lower is better. \`roas\` is a return: higher is better. Send it with \`target\_value\`.
- `target_value` (number) — The value of the target, greater than 0. For \`cpa\`, \`cpc\` and \`cpm\`: whole units of the plan’s currency, with no more decimals than the currency has (\`24.5\` is €24.50). For \`roas\`: a ratio with at most two decimals (\`3.5\`). Send it with \`target\_metric\`.

Request body example:

```json
{
  "advertiser_id": "acc_1203456789012345",
  "age_max": 44,
  "age_min": 25,
  "budget": 2500,
  "channel": "meta",
  "countries": [
    "FR",
    "BE"
  ],
  "gender": "all",
  "name": "Spring reach, France and Belgium",
  "objective": "sales",
  "persona_id": "psn_8c4a20",
  "target_metric": "cpa",
  "target_value": 24.5
}
```

**Responses**

- `201` — 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.
- `400` — The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. \`error\` is \`invalid\_request\`, and \`issues\` names each field. Nothing was changed.
- `401` — No API key, or one that does not resolve. See the security scheme. \`error\` is \`unauthorized\`.
- `402` — The organization has no active subscription. An owner subscribes at \`paywallUrl\`. \`error\` is \`organization\_unentitled\`.
- `403` — The caller does not hold \`campaign\_plan:write\`. \`error\` is \`forbidden\`.
- `404` — No Campaign Plan with that slug. \`error\` is \`not\_found\`.
- `422` — Eight codes share this status. \`invalid\_countries\` (each entry must be a two-letter ISO 3166-1 alpha-2 code; AdCrunch puts it in upper case for you and removes a duplicate); \`invalid\_age\_range\` (each bound is a whole number from 0 to 120, and the minimum may not exceed the maximum); \`invalid\_amount\` (whole units of the Campaign Plan’s currency, with no more decimals than the currency has, never negative); \`invalid\_window\`; \`invalid\_name\` (a name is at most 60 characters after trimming); \`invalid\_target\` (a target is a metric and a value sent together, the value is greater than 0, and a \`roas\` target has at most two decimals); \`persona\_not\_in\_brand\` (a Persona must belong to the Campaign Plan’s Brand, so a brandless plan can name none); \`advertiser\_not\_owned\`.

Response example, 201:

```json
{
  "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",
    "name": "Spring reach, France and Belgium",
    "objective": "sales",
    "personaId": "psn_8c4a20",
    "provider": "meta",
    "revision": 1,
    "startDate": null,
    "status": "draft",
    "targetMetric": "cpa",
    "targetValue": 24.5,
    "unit": "total",
    "updatedAt": null
  }
}
```
