---
search:
  tags:
    - Line Items
    - POST
seo:
  description: >-
    Records one provider object that this… Reference for the POST
    /context/campaign-plans/{slug}/line-items/{lineItemId}/executions endpoint
    in the AdCrunch API.
sidebar:
  label: Record what a Line Item spawned
  badge: POST
title: Record what a Line Item spawned
type: openapi-operation
---
Records one provider object that this Line Item created. The caller that created the object writes this record, because only that caller knows which line the object belongs to.

A record is a **fact**, not an attempt. AdCrunch keeps the attempts in the mutation ledger.

This call refuses almost nothing. The provider object already exists, and a refusal would leave it live and untracked. A draft line records, an edited line records, and a line on a channel AdCrunch cannot write to records. The state of the line does not change, and neither does the state of the Campaign Plan.

The same object recorded again answers `200` with the existing row, and not `201`. The same object is the same provider, the same level and the same native id, on the same line.

AdCrunch never removes a record. It can tell you how many objects a line created. It cannot tell you how many objects a line must create, because a Campaign Plan never declares that number.

`POST /context/campaign-plans/{slug}/line-items/{lineItemId}/executions`

**Request body** (`application/json`, required)

- `advertiser_id` (string, required) — The ad account the object was created in.
- `entity_id` (string, required) — The \*\*native\*\* provider id, unprefixed — exactly as the Insight entities table holds it, which is what makes the two joinable.
- `entity_type` (string, required) — The provider’s own word for the level: campaign, adset, ad. Free text, because the vocabulary is the provider’s.
- `mutation_id` (string) — The \`mutationId\` of the Mutation that performed the write, when you know it. It links this fact to the attempt, and neither duplicates the other.
- `provider` (string, required)

Request body example:

```json
{
  "advertiser_id": "acc_1203456789012345",
  "entity_id": "23861234567890123",
  "entity_type": "campaign",
  "mutation_id": "mut_k3x9q2v7m4n8p1r5t6w0y2z4",
  "provider": "meta"
}
```

**Responses**

- `200` — This object was already recorded against this line. The existing row comes back unchanged, so the call is idempotent — recording twice does not inflate what the line has spawned.
- `201` — Recorded. Neither response shape was observed against the deployed service, because the verification organization has no connected advertiser — both are written from the Context Layer’s view type.
- `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\`.
- `422` — That ad account is not connected to this organization. \`error\` is \`advertiser\_not\_owned\`. Almost nothing else is refused here, deliberately: the provider object already exists, and refusing the record would leave it live and untracked.

Response example, 200:

```json
{
  "advertiserId": "acc_1203456789012345",
  "createdAt": 1772409600000,
  "entityId": "120210000000000",
  "entityType": "campaign",
  "id": "exe_7a4c12",
  "mutationId": "mut_k3x9q2v7m4n8p1r5t6w0y2z4",
  "provider": "meta"
}
```

Response example, 201:

```json
{
  "advertiserId": "acc_1203456789012345",
  "createdAt": 1772409600000,
  "entityId": "120210000000000",
  "entityType": "campaign",
  "id": "exe_7a4c12",
  "mutationId": "mut_k3x9q2v7m4n8p1r5t6w0y2z4",
  "provider": "meta"
}
```
