Upload Image
Upload an image URL or image file and return a file id.
The same endpoint also accepts multipart/form-data with a binary file.
Set purpose to account_favicon when you upload an image for account brand
review. The image must be at least 128 × 128 pixels.
To resolve an icon from the client's website, send its image_url and
purpose: account_favicon.
To upload a local image, send purpose as a multipart form field.
Assign the returned file_id with
POST /ad_account/brand.
Pass the returned file_id when you create or update an ad creative.
For an ad with multiple images, upload each image separately under the same
ad account and pass the returned IDs in creative.file_ids. Use 4–6 distinct
square (1:1) images in display order. See
Create an ad with multiple images
for requirements and a complete example.
Upload Image
curl https://api.ads.openai.com/v1/upload \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
-d '{
"image_url": "https://example.com/assets/workspace-planner-card.png"
}'{
"file_id": "file_901"
}Body ParametersJSON
Returns Examples
{
"file_id": "file_901"
}