---
search:
  tags:
    - Line Items
    - PATCH
seo:
  description: >-
    Updates a Line Item. Send the base_revision you… Reference for the PATCH
    /context/campaign-plans/{slug}/line-items/{lineItemId} endpoint in the
    AdCrunch API.
sidebar:
  label: Update a Line Item
  badge: PATCH
title: Update a Line Item
type: openapi-operation
---
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 body** (`application/json`, required)

- `advertiser_id` (string | null) — null unlinks the ad account.
- `age_max` (integer | null)
- `age_min` (integer | null)
- `base_revision` (integer, required) — The revision last read via GET — guards concurrent edits.
- `budget` (number | null) — Whole units of the plan’s currency: \`40.5\` is €40.50. No more decimals than the currency has.
- `channel` (string) — What is being bought, in a planner’s vocabulary — not a provider. Curated and deliberately incomplete.
- `countries` (string[]) — The array is the value — sending \[\] clears the geography.
- `end_date` (string | null) — 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` (string | null) — 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 to keep the name. Send \`null\` or a blank string to clear it.
- `objective` (string) — Provider-neutral outcome, translated at execution. There is deliberately no optimization goal here.
- `persona_id` (string | null)
- `start_date` (string | null)
- `target_metric` (string | null) — Send it with \`target\_value\`: both to set the target, both \`null\` to clear it, or neither to keep it. One alone is \`invalid\_target\`.
- `target_value` (number | null) — 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
{
  "base_revision": 2,
  "budget": 3000,
  "countries": [
    "FR",
    "BE",
    "NL"
  ]
}
```

**Responses**

- `200` — 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 the list of Line Items.
- `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 such plan, or no Line Item with that id on it. \`error\` is \`not\_found\`.
- `409` — The Line Item moved since you read it. \`error\` is \`revision\_mismatch\`.
- `422` — Eight codes share this status. \`invalid\_countries\`, \`invalid\_age\_range\`, \`invalid\_amount\`, \`invalid\_window\`, \`invalid\_name\`, \`invalid\_target\`, \`persona\_not\_in\_brand\` or \`advertiser\_not\_owned\`. Each one is checked against the row as it would stand after the change, not against what you sent.

Response example, 200:

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