Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Check a Line Item’s execution readiness

Tells you whether AdCrunch can execute a Line Item now, and if it cannot, why. Ask this before any provider call.

A line is not ready in these conditions:

  • Nobody validated the line.
  • AdCrunch cannot write to the channel. The answer names the provider that sells it.
  • The line has no ad account.
  • The ad account belongs to a different provider.
  • The currency of the ad account is different from the plan currency, or AdCrunch does not know that currency yet. To make it known, refresh the provider connection.
  • The dates do not resolve to a window.

AdCrunch never converts a currency. A converted budget is a different plan.

When the line is ready, the answer also gives the resolved window, and it tells you whether the budget goes to the provider as a lifetime total or as a daily rate.

GET/context/campaign-plans/{slug}/line-items/{lineItemId}/readiness
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
Responses
200

The verdict, discriminated on status. Every outcome is a 200, ready included: "this cannot run, and here is why" is an answer rather than a failed request.

One of:
object
advertiserIdstringrequired
budgetnumber | nullrequired
currencystringrequired

The plan’s currency, confirmed equal to the account’s.

endDatestring | nullrequired

A calendar date, YYYY-MM-DD.

providerstringrequired
startDatestring | nullrequired

A calendar date, YYYY-MM-DD.

statusstringrequired
Allowed:ready
unitstringrequired
Allowed:totaldaily
object
statusstringrequired

The gate. Approving the plan, or validating the line, opens it.

Allowed:not_validated
object
channelstringrequired
Allowed:metatiktoksnapchatgoogle_searchgoogle_pmaxgoogle_displayyoutubeprogrammatic_displaylinkedinx
providerstring | nullrequired

Who sells it, when someone does but we cannot write there yet.

statusstringrequired
Allowed:channel_not_executable
object
statusstringrequired
Allowed:no_advertiser
object
statusstringrequired
Allowed:advertiser_not_owned
object
actualstringrequired
expectedstringrequired
statusstringrequired
Allowed:provider_mismatch
object
advertiserIdstringrequired
statusstringrequired

Refresh the provider connection.

Allowed:account_currency_unknown
object
accountCurrencystringrequired
planCurrencystringrequired
statusstringrequired

Never converted. A converted budget is a different plan, and the planner allocated what they allocated.

Allowed:currency_mismatch
object
statusstringrequired
Allowed:no_window
object
endDatestringrequired

A calendar date, YYYY-MM-DD.

startDatestringrequired

A calendar date, YYYY-MM-DD.

statusstringrequired
Allowed:window_inverted
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:read. 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. This is the one readiness outcome that is not a 200, because the question itself has no subject.

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 GET "https://api.adcrunch.dev/context/campaign-plans/string/line-items/string/readiness" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "advertiserId": "string",
  "budget": 0,
  "currency": "string",
  "endDate": "string",
  "provider": "string",
  "startDate": "string",
  "status": "ready",
  "unit": "total"
}