API Reference
Videos, images and identities

Upload an image

POST/open_api/v1.3/file/image/ad/upload/
Base URL: https://tiktok-ads.mimicr.dev · provider: https://business-api.tiktok.com

Use this endpoint to upload an image by URL (UPLOAD_BY_URL) or by file (UPLOAD_BY_FILE, multipart with image_file and its MD5 in image_signature). Use it for the video cover (image_ids of a SINGLE_VIDEO ad) and for image ads. File names are unique per advertiser.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Headers

Access-Tokenstringrequired

Authorized access token, sent in this header (not Authorization: Bearer). Marketing API tokens never expire.

Body

application/json
advertiser_idstringrequired

Advertiser ID.

file_namestring

Image name.

upload_typestringrequired

Image upload method.

UPLOAD_BY_FILEUPLOAD_BY_URLUPLOAD_BY_FILE_ID
image_filestring

Required when upload_type is UPLOAD_BY_FILE. Image file.

image_signaturestring

Required when upload_type is UPLOAD_BY_FILE. MD5 of the image (used for server verification).

image_urlstring

Required when upload_type is UPLOAD_BY_URL. Image url address. Example: http://xxx.xxx.

Responses

200Response envelope {code, message, request_id, data}. code 0 (message "OK") is success. Validation and business errors also come with HTTP 200 and a non-zero code: check code, not the HTTP status.
codenumber

Return code. 0 means success; see the return codes appendix for the others.

messagestring

Return message: OK on success, otherwise the error description.

request_idstring

The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).

dataobject

Returned data.

Show child attributes
image_idstring

Image ID that is used to create ads.

material_idstring

Material ID.

is_carousel_usableboolean

Whether the source of the image is valid for Carousel Ads.

displayableboolean

Whether it can be displayed on the platform.

heightnumber

Image height.

widthnumber

Image width.

formatstring

Image Format.

image_urlstring

Image URL, valid for an hour and needs to be re-acquired after expiration.

signaturestring

MD5 of picture.

sizenumber

Image size in bytes.

file_namestring

Image name.

create_timestring

Creation time. UTC time. Format: 2020-06-10T07:39:14Z.

modify_timestring

Modification time. UTC time. Format: 2020-06-10T07:39:14Z.

501The route or feature is documented by TikTok but outside Mimicr's integration core: code 40014 with HTTP 501.
codeinteger

Return code. 0 means success; see the return codes appendix for the others.

messagestring

Return message: OK on success, otherwise the error description.

request_idstring

The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).