Upload an image
POST /api/marketing/imagesUploads 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.
Request body
Section titled “Request body”| Field | Type | Description | |
|---|---|---|---|
ad_account_id | string | required | Meta ad account, with prefix. Example: "act_123". |
name | string | optional | Name under which it is stored in Meta. |
bytes_base64 | string | required | File content in base64, without the data: prefix. Maximum 7 MB. |
Responses
Section titled “Responses”| Status | Description | Schema |
|---|---|---|
200 | — | UploadedImageDto |
Example
Section titled “Example”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" }'UploadedImageDto
Section titled “UploadedImageDto”| Field | Type | Description | |
|---|---|---|---|
hash | string | required | Hash to use in link_data.image_hash. |
url | string | optional | — |
width | number | optional | — |
height | number | optional | — |
name | string | optional | — |