For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Overview Agent Access Ads ChatGPT + Codex user docs Use cases

API Reference

Get Ad Account Spend Limit Windows

GET
/ad_account/spend_limit_windows

View account spending limits.

Set a shared spending limit across all campaigns in an ad account. Choose a date range limit for a total allowance over a fixed period, or a daily limit for an allowance that renews each day. Campaign budgets still apply; account limits do not allocate spend between campaigns or pace delivery.

Note: Account spending limits are available only for ad accounts on postpaid invoice billing. Existing daily limits can still be viewed and removed if the account's billing changes. Reads require billing-read access or a permitted account-bound service key. Editing limits additionally requires spending-limit management permission.

Both types use the account currency and timezone:

  • Amounts are nonnegative integers in micros: 100000000 is 100 currency units. Use the currency's smallest unit, such as multiples of 10000 micros for USD. The maximum is 1 billion currency units (1000000000000000 micros).
  • Dates use YYYY-MM-DD. Limits start at midnight on the start date and end at midnight on the end date, in the account timezone. The end date is excluded.
  • Daily and date range limits cannot overlap. Existing scheduled limits are not removed when you create a daily limit.
  • Daily allowances do not carry over or change with daylight saving time. The account timezone cannot change while a daily limit exists.

Limits apply to billable ad spend, not taxes or the total invoice. Delivery can take time to stop after a limit is reached. Amount edits take effect on save and retain counted spend; a decrease below recorded spend is rejected. Edits are not retroactive: delayed charges use the limit effective when the event occurred, and concurrent billing can add spend while an edit is saved. A lower limit cannot undo spend already billed.

Read the configuration before making changes. Use the returned edit capabilities to determine which mutations are available. An omitted spent_micros does not mean zero spend. Configuration evaluation time is separate from spend-counter freshness.

Use daily_limits to inspect active and upcoming daily rules. The legacy daily_limit field selects the active or earliest upcoming rule. Send the current revision as expected_revision for daily mutations; use 0 only if the revision is absent. A false can_create_daily_limit does not by itself prevent editing an existing rule.

After a daily mutation returns 503, refresh before retrying: the change may have succeeded even if its response could not be loaded.

Get Ad Account Spend Limit Windows

curl https://api.ads.openai.com/v1/ad_account/spend_limit_windows \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
200 — Example
{
  "data": [
    {
      "amount_micros": 0,
      "can_delete": true,
      "can_edit": true,
      "can_edit_start_date": true,
      "end_date": "end_date",
      "io_id": "io_id",
      "name": "name",
      "start_date": "start_date",
      "status": "status",
      "window_id": "window_id",
      "spent_micros": 0
    }
  ],
  "object": "object",
  "can_create_daily_limit": true,
  "can_manage_spend_limits": true,
  "daily_limit": {
    "amount_micros": 0,
    "end_date": "end_date",
    "next_reset": "next_reset",
    "remaining_micros": 0,
    "spend_as_of": "spend_as_of",
    "spent_micros": 0,
    "start_date": "start_date",
    "status": "status",
    "timezone": "timezone",
    "window_id": "window_id"
  },
  "daily_limits": [
    {
      "amount_micros": 0,
      "end_date": "end_date",
      "next_reset": "next_reset",
      "remaining_micros": 0,
      "spend_as_of": "spend_as_of",
      "spent_micros": 0,
      "start_date": "start_date",
      "status": "status",
      "timezone": "timezone",
      "window_id": "window_id"
    }
  ],
  "earliest_daily_start_date": "earliest_daily_start_date",
  "earliest_dated_start_date": "earliest_dated_start_date",
  "evaluated_at": "evaluated_at",
  "revision": 0
}
Returns
data: array of object { amount_micros, can_delete, can_edit, 8 more }
amount_micros: integer
can_delete: boolean
can_edit: boolean
can_edit_start_date: boolean
end_date: string
io_id: string or null
name: string or null
start_date: string
status: string
window_id: string
spent_micros: optional integer
object: string
can_create_daily_limit: optional boolean
can_manage_spend_limits: optional boolean
daily_limit: optional object { amount_micros, end_date, next_reset, 7 more } or null
amount_micros: integer

Current daily billable ad-spend cap.

end_date: string or null

Exclusive account-local end date, YYYY-MM-DD; null means no end.

next_reset: string or null

Next account-local midnight with a fresh allowance, ISO 8601; null before activation or on the final protected day.

remaining_micros: integer or null
spend_as_of: string or null

Actual enforcement counter update timestamp, ISO 8601; null if unavailable.

spent_micros: integer or null

Enforcement-backed spend for this day; null if unavailable or not active.

start_date: string

First protected account-local date, YYYY-MM-DD.

status: string

active or upcoming.

timezone: string

Recorded IANA timezone; immutable while Daily exists.

window_id: optional string

Immutable Daily rule ID for targeted edits and removal.

daily_limits: optional array of object { amount_micros, end_date, next_reset, 7 more }

Active and upcoming Daily rules, ordered by start date ascending.

amount_micros: integer

Current daily billable ad-spend cap.

end_date: string or null

Exclusive account-local end date, YYYY-MM-DD; null means no end.

next_reset: string or null

Next account-local midnight with a fresh allowance, ISO 8601; null before activation or on the final protected day.

remaining_micros: integer or null
spend_as_of: string or null

Actual enforcement counter update timestamp, ISO 8601; null if unavailable.

spent_micros: integer or null

Enforcement-backed spend for this day; null if unavailable or not active.

start_date: string

First protected account-local date, YYYY-MM-DD.

status: string

active or upcoming.

timezone: string

Recorded IANA timezone; immutable while Daily exists.

window_id: optional string

Immutable Daily rule ID for targeted edits and removal.

earliest_daily_start_date: optional string

Earliest accounting-safe account-local start date for a new Daily rule; activation is never same-day. The full interval must also avoid dated and IO limits.

earliest_dated_start_date: optional string or null

Earliest account-local start date, YYYY-MM-DD, for new or retimed Date range limits after retained Daily protection; null if none. Does not restrict amount or metadata edits when the existing dates are unchanged.

evaluated_at: optional string

Evaluation timestamp, ISO 8601; distinct from spend reporting freshness.

revision: optional integer

Current configuration revision for conditional Daily mutations.

Returns Examples
200 — Example
{
  "data": [
    {
      "amount_micros": 0,
      "can_delete": true,
      "can_edit": true,
      "can_edit_start_date": true,
      "end_date": "end_date",
      "io_id": "io_id",
      "name": "name",
      "start_date": "start_date",
      "status": "status",
      "window_id": "window_id",
      "spent_micros": 0
    }
  ],
  "object": "object",
  "can_create_daily_limit": true,
  "can_manage_spend_limits": true,
  "daily_limit": {
    "amount_micros": 0,
    "end_date": "end_date",
    "next_reset": "next_reset",
    "remaining_micros": 0,
    "spend_as_of": "spend_as_of",
    "spent_micros": 0,
    "start_date": "start_date",
    "status": "status",
    "timezone": "timezone",
    "window_id": "window_id"
  },
  "daily_limits": [
    {
      "amount_micros": 0,
      "end_date": "end_date",
      "next_reset": "next_reset",
      "remaining_micros": 0,
      "spend_as_of": "spend_as_of",
      "spent_micros": 0,
      "start_date": "start_date",
      "status": "status",
      "timezone": "timezone",
      "window_id": "window_id"
    }
  ],
  "earliest_daily_start_date": "earliest_daily_start_date",
  "earliest_dated_start_date": "earliest_dated_start_date",
  "evaluated_at": "evaluated_at",
  "revision": 0
}