Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Record what a Line Item spawned

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. If you record the same object again, the answer is 200 with the existing row, and not 201.

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 plan never declares that number.

POST/context/campaign-plans/{slug}/line-items/{lineItemId}/executions
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>. Two credentials work.

An API key (acr_…) is what a server integration uses. Create one in the AdCrunch console under Settings → API keys — see https://docs.adcrunch.dev/account/api-keys. A key is bound to the organization that was active when you created it, and it keeps acting on that organization whatever you do later. It carries the permissions of the member who created it.

A session issued by the AdCrunch sign-in flow also works, which is how the console calls this service from the browser.

Either way the organization comes from the credential. There is no organization parameter.

Path parameters
lineItemIdstringrequired
matches ^lni_[\s\S]{0,}$
slugstringrequired
Request body
requiredapplication/json
advertiser_idstringrequired

The ad account the object was created in.

matches ^acc_[\s\S]{0,}$
entity_idstringrequired

The native provider id, unprefixed — exactly as the Insight entities table holds it, which is what makes the two joinable.

min length 1
entity_typestringrequired

The provider’s own word for the level: campaign, adset, ad. Free text, because the vocabulary is the provider’s.

min length 1
mutation_workflow_idstring

The mutation that performed the write, when known — links this fact to the attempt without either duplicating the other.

min length 1
providerstringrequired
Show properties
Any of:
string
string
string
string
string
string
string
string
string
string
string
string
string
string
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.

advertiserIdstringrequired
createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

entityIdstringrequired

The provider’s own id, unprefixed, so it joins to entities.

entityTypestringrequired

The provider’s word for the level — campaign, adset, ad.

idstringrequired
mutationWorkflowIdstring | nullrequired

The durable execution that performed the write, when known.

providerstringrequired
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.

advertiserIdstringrequired
createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

entityIdstringrequired

The provider’s own id, unprefixed, so it joins to entities.

entityTypestringrequired

The provider’s word for the level — campaign, adset, ad.

idstringrequired
mutationWorkflowIdstring | nullrequired

The durable execution that performed the write, when known.

providerstringrequired
401

No credential, or one that does not resolve. Send an API key or a session. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold campaign_plan:write. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

404

No such plan, or no Line Item with that id on it. error is not_found.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

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.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

Request
curl -X POST "https://api.adcrunch.dev/context/campaign-plans/string/line-items/string/executions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "advertiser_id": "string",
  "entity_id": "string",
  "entity_type": "string",
  "mutation_workflow_id": "string",
  "provider": "meta"
}'
Response
{
  "advertiserId": "string",
  "createdAt": 0,
  "entityId": "string",
  "entityType": "string",
  "id": "string",
  "mutationWorkflowId": "string",
  "provider": "string"
}