API Reference
Videos, images and identities

Upload a video

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

Use this endpoint to upload a video by URL (UPLOAD_BY_URL), by file (UPLOAD_BY_FILE, multipart with video_file and its MD5 in video_signature) or by binding an existing video_id (UPLOAD_BY_VIDEO_ID). For compatibility reasons data is an array with one video.

Mimicr does not download the URL: any http(s) URL becomes a 720×1280, 15-second mp4. Every upload returns a new video_id. File names are unique per advertiser: an explicit duplicate file_name returns 40002 Duplicated material name., and a duplicate name taken from the URL gets a _<unix time> suffix.

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

Video name.

upload_typestring

Video upload method.

UPLOAD_BY_FILEUPLOAD_BY_URLUPLOAD_BY_FILE_IDUPLOAD_BY_VIDEO_ID
video_filestring

Required when upload_type is UPLOAD_BY_FILE. Video file.

video_signaturestring

Required when upload_type is UPLOAD_BY_FILE. Video MD5 (used for server verification).

video_urlstring

Required when upload_type is UPLOAD_BY_URL. Video URL address, such as http://xxx.xxx. (1) File size: better within 10MB. (2) Verification: We will verify Content-Type in the response header. A common invalid media type is text (Content-Type = text/*, such as text/html, text/plain).

video_idstring

Required when upload_type is UPLOAD_BY_VIDEO_ID. Video ID.

is_third_partyboolean

The video is third party or not.

flaw_detectboolean

Whether to automatically detect an issue in your video.

auto_fix_enabledboolean

Whether to automatically fix the detected issue.

auto_bind_enabledboolean

Valid only when flaw_detect = true and auto_fix_enabled = true. Whether to automatically upload the fixed video to your creative library.

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[]

For compatibility reasons, an array with the uploaded video.

Show child attributes
video_cover_urlstring

Temporary URL for video cover, valid for six hours and needs to be re-acquired after expiration. The expiration time is included in the URL after the x-expires parameter, in the format of an Epoch/Unix timestamp in seconds.

formatstring

Video format.

preview_urlstring

Video preview link, valid for six hours and needs to be re-acquired after expiration. To find out the expiration time of the preview link, see preview_url_expire_time.

preview_url_expire_timestring

The expiration time of the video preview link, in the format of YYYY-MM-DD HH:MM:SS (UTC+0).

file_namestring

Video name.

displayableboolean

Whether it can be displayed on the platform.

heightnumber

Video height.

widthnumber

Video width.

bit_ratenumber

Bit rate in bps.

create_timestring

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

modify_timestring

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

signaturestring

Video file MD5.

durationnumber

Video duration, in seconds.

video_idstring

Video ID, which can be used to create ads.

sizenumber

Video size, in bytes.

material_idstring

Material ID.

allowed_placementsstring[]

Available placements. Due to music copyright, some materials generated by creative tools can only be shown on TikTok. It won't pass when they are created on other placements. For enum values, see Enumerations-Ad Management-Placement.

allow_downloadboolean

Whether the video is downloadable. Due to the music copyright, some materials generated by creative tools are only allowed to preview. It is prohibited to download and disseminate them.

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).