Skip to content

Upload an image

POST /api/marketing/images

Uploads the file to the account library and returns the hash that goes in link_data.image_hash. The content is sent as base64 and the file cannot exceed 7 MB: encoded it weighs a third more and Neike’s body parser cuts at 10 MB. Requires the marketing:manage scope.

FieldTypeDescription
ad_account_idstringrequiredMeta ad account, with prefix. Example: "act_123".
namestringoptionalName under which it is stored in Meta.
bytes_base64stringrequiredFile content in base64, without the data: prefix. Maximum 7 MB.
StatusDescriptionSchema
200—UploadedImageDto
Terminal window
curl -X POST https://api.neike.dev/api/marketing/images \
-H "x-neike-api-key: whk_live_…" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "act_123",
"bytes_base64": "string"
}'
FieldTypeDescription
hashstringrequiredHash to use in link_data.image_hash.
urlstringoptional—
widthnumberoptional—
heightnumberoptional—
namestringoptional—