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

Replace Custom Audience Members

POST
/custom_audiences/{custom_audience_id}/replace

Replace an existing audience using an uploaded file and its current revision.

Replace Custom Audience Members

curl https://api.ads.openai.com/v1/custom_audiences/$CUSTOM_AUDIENCE_ID/replace \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
    -d '{
          "expected_revision": 0,
          "file_id": "file_id"
        }'
200 — Example
{
  "custom_audience_id": "custom_audience_id",
  "operation": "operation",
  "operation_id": "operation_id",
  "status": "status",
  "failure_reason": {
    "code": "code",
    "message": "message"
  }
}
Header Parameters
"Idempotency-Key": string
pattern.*\S.*
minLength1
maxLength255
Path Parameters
custom_audience_id: string
Body Parameters
JSON
expected_revision: integer
minimum0
file_id: string
file_size: optional integer
minimum1
maximum500000000
filename: optional string
minLength1
maxLength255
identifier_resolution: optional "auto"
identifier_type: optional "email" or "phone" or "email_sha256" or 2 more
One of the following:
"email"
"phone"
"email_sha256"
"phone_number_sha256"
"gaid"
mimetype: optional string
minLength1
maxLength255
Returns
custom_audience_id: string
operation: string
operation_id: string
status: string
failure_reason: optional object { code, message }

Present only for failed operations with a known advertiser-actionable cause. Omitted for other failures and operations recorded without a failure reason.

code: string

Stable code for an advertiser-actionable failure.

message: string

Safe explanation and suggested corrective action.

Returns Examples
200 — Example
{
  "custom_audience_id": "custom_audience_id",
  "operation": "operation",
  "operation_id": "operation_id",
  "status": "status",
  "failure_reason": {
    "code": "code",
    "message": "message"
  }
}