Publishing Videos to TikTok Through ZakiPost

ZakiPost gives its users the ability to connect their personal TikTok accounts and publish videos to them programmatically. Thanks to this feature, the developer or user does not need to go through the complications of creating a dedicated application in the TikTok Developer Portal or wait for review approvals, but can instead rely directly on our ready-made and secure API to manage their account and publish to it with complete ease.

The process is simple and secure: all that's required is to connect your personal TikTok account to our platform through TikTok's official authentication screen. Once this step is complete, you will immediately receive programmatic access keys dedicated to your account, which give you complete freedom to automate and publish your videos directly using any development environment or programming tool you prefer.

1. How the Process Works for the User

The process consists of three steps:

  1. Obtain the account's access keys (client_key and client_secret) from the API keys settings page.
  2. Connect your personal TikTok account using the "Connect TikTok" button, which is the only step in which the user goes through TikTok's official consent screen.
  3. Use the access keys together with the connected account identifier (internal_token) to send publish requests from any programming environment that supports sending HTTP requests.

Once these steps are complete, the ZakiPost platform handles the technical details involved in dealing with TikTok: refreshing tokens, storing them in encrypted form, sending the actual publish request, and verifying its outcome shortly after submission.

2. Account API Keys

When an account is created on ZakiPost, two keys are generated automatically and permanently tied to the account:

Key Description
client_key A public identifier starting with zp_key_, used to identify the account on every request.
client_secret A private secret key for authentication, which you can view at any time through your account settings, and which remains fixed and does not change.

These two keys are fixed to ensure the stability of your programmatic connection. You can always view or copy them at any time through the API keys settings page, with the recommendation to keep your keys confidential and not share them with any untrusted parties.

These two keys have no relation to the TikTok account itself; rather, they are the means of authentication between the user and the ZakiPost server. They must be sent with every publish request via the following two HTTP headers:

X-ZakiPost-Client-Key: zp_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-ZakiPost-Client-Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Since these keys are standard HTTP credentials, they can be used from any environment capable of sending HTTP requests, regardless of the programming language or tool used.

3. Connecting a TikTok Account

ZakiPost provides a "Connect TikTok" button within the dashboard, and clicking it triggers the following sequence:

  1. Generating a random protection code (state) that is temporarily stored to prevent request forgery attempts.
  2. Redirecting the user to TikTok's official consent screen.
  3. After the user approves, they are redirected back to ZakiPost, which verifies the validity of the request and exchanges the authorization code for a valid access token.
  4. The token is encrypted and stored securely, and is never displayed to the user or any other party at any time.
  5. An internal identifier dedicated to this account is generated, to be used later when sending publish requests.

Once this step is complete, the TikTok account appears within the user's list of connected accounts, and publishing to it via the ZakiPost API becomes possible.

4. Publishing a Video via the API

The publish endpoint accepts POST requests in the following format:

POST https://api.zakipost.com/v1/tiktok/publish
Content-Type: application/json
X-ZakiPost-Client-Key: zp_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-ZakiPost-Client-Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

{
  "video_url": "https://example.com/video.mp4",
  "tiktok_account_id": "internal-token-uuid",
  "title": "Caption text with hashtags",
  "privacy_level": "PUBLIC_TO_EVERYONE",
  "disable_comment": false,
  "disable_duet": false,
  "disable_stitch": false,
  "ai_generated_content": true
}

Field Reference

Field Description
video_url A direct link to the video to be published; it must be readable from the server.
tiktok_account_id The internal account identifier (internal_token) obtained after connecting the TikTok account.
title The caption text accompanying the video; it is preferable to include hashtags within it.
privacy_level The requested privacy level for the video. You can use one of the following values: PUBLIC_TO_EVERYONE (for everyone), MUTUAL_FOLLOW_FRIENDS (for mutual followers), or SELF_ONLY (private). Note that acceptance of these values depends on the settings and status of the connected TikTok account.
disable_comment / disable_duet / disable_stitch Boolean values to control interaction options with the video after it is published.
ai_generated_content A flag indicating that the content is fully or partially produced by artificial intelligence, in accordance with the disclosure requirements applicable at TikTok.

Success Response

{
  "success": true,
  "message": "Publishing process started.",
  "data": {
    "publish_id": "v_pub_xxxxxxxxxxxxxxxx"
  }
}

This response indicates that the publish request was accepted and the immediate execution process has started. There is no need for a long wait, as the actual processing and publishing of the video to the TikTok account takes place within a few seconds (usually within 15 seconds) from the moment the request is successfully sent.

5. Common Errors and Their Meanings

Status Likely Cause
401 Unauthorized The client_key or client_secret is incorrect or was not sent within the headers.
402 Payment Required The points balance in the account is insufficient to complete the publish operation.
403 Forbidden The current plan does not include API access permission, or the subscription has expired.
Invalid API credentials You must make sure both keys were copied in full without extra spaces.
Insufficient points A minimum of 400 points is required in the balance to complete a single publish operation.

6. Important Notes on Privacy Level and Publishing Limits

Publishing operations to TikTok through any external application, including ZakiPost, are subject to TikTok's policies for its Content Posting API. These policies include restrictions that may change from time to time, such as the actual privacy level available for publishing, and the number of publish operations permitted per account within a specific time period. The user is advised to check the status of their account and the actual options available through the API keys settings page.

7. Quick Summary

Question Answer
Do I need to register my own TikTok application? No. We have fully prepared the infrastructure to save you time; all you need is to connect your personal account to our platform and start publishing immediately without any additional complications.
How is a TikTok account connected? Through the "Connect TikTok" button within the ZakiPost dashboard, which is TikTok's standard consent step.
What is required to publish programmatically? The account's two API keys, and the account identifier (internal_token) for each connected TikTok account.
Can any programming tool be used? Yes. Any environment capable of sending an HTTP POST request can use the API.
Where can I find my account's API keys? They can be accessed and managed through the API keys settings page.