Skip to content

Read an ad account's spend policy

PubNio API ads.getSpendPolicy: read an ad account's spend policy. Request fields, examples in five clients, errors, and idempotency.

Read an ad account’s spend policy with GET /api/v1/ads/accounts/{accountId}/spend-policy. Requires an API key with the ads_read scope or a signed-in workspace member.

Request

Returns monthly and daily caps, per-campaign budget limits, kill-switch state, and revision from stored rows. A missing policy reports configured=false with revision 0. No provider call happens during the request.

Parameter In Type Required
accountId path UUID Yes
workspaceId query UUID Yes

Response

  • HTTP 200: AdSpendPolicy with accountId, currency, configured, monthlyCap, dailyCap, maxCampaignDailyBudget, maxCampaignLifetimeBudget, killSwitchActive, killSwitchAt, killSwitchReason, revision, updatedAt.

The OpenAPI document has each field’s type.

Examples

const policy = await workspace.ads.spendPolicy(accountId);
policy = workspace.ads.get_spend_policy(account_id)
curl "https://pubnio.com/api/v1/ads/accounts/$ACCOUNT_ID/spend-policy?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio ads get-spend-policy "$ACCOUNT_ID"
async () => {
  const accountId = "<accountId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/ads/accounts/${accountId}/spend-policy`,
    query: { workspaceId: codemode.workspaceId },
  });
  return response.data;
};

Errors

It declares no problem of its own.

It declares the problems every Ads operation and most operations declare.

Idempotency

None needed: a read is safe to retry.

Limits

Type to search…

↑↓ navigate↵ selectEsc close