API Reference
Upload a video
/open_api/v1.3/file/video/ad/upload/https://tiktok-ads.mimicr.dev · provider: https://business-api.tiktok.comUse 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
Authorized access token, sent in this header (not Authorization: Bearer). Marketing API tokens never expire.
Body
application/jsonAdvertiser ID.
Video name.
Video upload method.
UPLOAD_BY_FILEUPLOAD_BY_URLUPLOAD_BY_FILE_IDUPLOAD_BY_VIDEO_IDRequired when upload_type is UPLOAD_BY_FILE. Video file.
Required when upload_type is UPLOAD_BY_FILE. Video MD5 (used for server verification).
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).
Required when upload_type is UPLOAD_BY_VIDEO_ID. Video ID.
The video is third party or not.
Whether to automatically detect an issue in your video.
Whether to automatically fix the detected issue.
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.
Return code. 0 means success; see the return codes appendix for the others.
Return message: OK on success, otherwise the error description.
The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).
For compatibility reasons, an array with the uploaded video.
Show child attributes
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.
Video format.
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.
The expiration time of the video preview link, in the format of YYYY-MM-DD HH:MM:SS (UTC+0).
Video name.
Whether it can be displayed on the platform.
Video height.
Video width.
Bit rate in bps.
Creation time. UTC time. Format: 2020-06-10T07:39:14Z.
Modification time. UTC time. Format: 2020-06-10T07:39:14Z.
Video file MD5.
Video duration, in seconds.
Video ID, which can be used to create ads.
Video size, in bytes.
Material ID.
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.
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.
Return code. 0 means success; see the return codes appendix for the others.
Return message: OK on success, otherwise the error description.
The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).