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

List Audit Logs

GET
/audit_logs

List audit logs for the authenticated ad account.

Review changes to campaigns, ad groups, ads, and other resources in the ad account associated with your Ads API key.

Use Ads API-key authentication. This endpoint does not accept Ads OAuth access tokens.

Use resource IDs returned by the API, without a partition prefix, for campaign_id, ad_group_id, and ad_id. When you provide multiple filters, only entries that match all of them are returned. Time filters accept values from 946684800 through 4102444800.

Pass last_id as after to request the next page, or first_id as before to request the previous page. The has_more value indicates whether more results exist in the requested direction: forward for after, backward for before. On the first page, it indicates whether a next page exists. Keep the same filters and order when moving between pages.

Use audit-log IDs, not resource IDs, as cursors. Do not send after and before together. An invalid cursor returns HTTP 400 with the message "Invalid pagination cursor."

changes depends on the event type. For an updated name, it can contain "name": {"before": "Previous name", "after": "New name"}.

List Audit Logs

curl https://api.ads.openai.com/v1/audit_logs \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
200 — Example
{
  "data": [
    {
      "id": "id",
      "actor_id": "actor_id",
      "actor_type": "actor_type",
      "ad_group_id": "ad_group_id",
      "audit_log_type": "audit_log_type",
      "campaign_id": "campaign_id",
      "changes": {},
      "hierarchy_info": {},
      "item_name": "item_name",
      "obj_id": "obj_id",
      "obj_type": "obj_type",
      "ts": 0
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "object"
}
Query Parameters
actor_id: optional string

ID of the actor who made the change, not the affected user.

ad_group_id: optional string

Object ID of the ad group. Includes logs for the ad group and its ads.

ad_id: optional string

Object ID of the ad.

after: optional string

Audit-log ID from last_id to continue forward in the current order. Keep filters and order unchanged; do not also send before.

before: optional string

Audit-log ID from first_id to page backward in the current order. Do not also send after.

campaign_id: optional string

Object ID of the campaign. Includes logs for the campaign and its ad groups and ads.

end_time: optional integer

Inclusive end time as a Unix timestamp in seconds.

minimum946684800
maximum4102444800
limit: optional integer

Maximum logs per page; default 50, maximum 100.

minimum1
maximum100
order: optional "asc" or "desc"

Creation-time ordering; default desc. has_more describes continuation in the requested paging direction.

One of the following:
"asc"
"desc"
start_time: optional integer

Inclusive start time as a Unix timestamp in seconds.

minimum946684800
maximum4102444800
Returns
data: array of object { id, actor_id, actor_type, 9 more }
id: string
actor_id: string or null
actor_type: string
ad_group_id: string or null
audit_log_type: string
campaign_id: string or null
changes: unknown
hierarchy_info: unknown
item_name: string or null
obj_id: string

Object ID without the Habitat partition key.

obj_type: string
ts: integer or null
formatunixtime
first_id: string or null
has_more: boolean
last_id: string or null
object: string
Returns Examples
200 — Example
{
  "data": [
    {
      "id": "id",
      "actor_id": "actor_id",
      "actor_type": "actor_type",
      "ad_group_id": "ad_group_id",
      "audit_log_type": "audit_log_type",
      "campaign_id": "campaign_id",
      "changes": {},
      "hierarchy_info": {},
      "item_name": "item_name",
      "obj_id": "obj_id",
      "obj_type": "obj_type",
      "ts": 0
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "object"
}