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

Upload Blob

POST
/uploads

Upload a file and return a file id.

Upload a UTF-8 CSV or TXT customer list with the dedicated POST /uploads endpoint. Set purpose to custom_audience and save the returned file_id.

Use the file ID, original filename, MIME type, and exact file size to create a custom audience. You can also use an uploaded file to add, remove, or replace audience members. CSV files can combine email, phone, GAID, and hashed identifier columns when the audience request sets identifier_resolution to auto. See audience file requirements.

Upload Blob

curl https://api.ads.openai.com/v1/uploads \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
    -F 'file=@/path/to/file'
200 — Example
{
  "file_id": "file_id"
}
Body Parameters
Form Data
file: file

UTF-8 CSV or TXT audience file sent as multipart/form-data. Retain the returned file ID and the original filename, MIME type and exact byte size for the audience operation.

purpose: optional "custom_audience"

The upload's intended use. This field is required unless the authenticated ad account is enrolled in the custom-audience compatibility rollout. For enrolled accounts, an omitted value defaults to custom_audience.

Returns
file_id: string
Returns Examples
200 — Example
{
  "file_id": "file_id"
}