Ayrshare offers direct publishing of TikTok videos, comment management, and retrieval of advanced analytics for either your personal or business TikTok account.

TikTok asynchronously processes video and photos, so the JSON response will be status: “pending” for both immediate and scheduled posts. Once TikTok has completed processing, your registered Scheduled Action webhook will be called.

TikTok Video Post

JSON for a basic TikTok video post that is directly published:

TikTok Video Post
{
  "post": "The best TikTok \n video ever #bestvideo", // Max 2,200 characters with a line break
  "mediaUrls": ["https://img.ayrshare.com/012/tiktok.mp4"],
  "platforms": ["tiktok"]
}

Example JSON post response:

TikTok Video Post Response
{
  "status": "success",
  "errors": [],
  "postIds": [
    {
      "status": "success",
      "idShare": "video.7088122496758679353.nzLqBWbf",
      "id": "pending",
      "isVideo": true,
      "platform": "tiktok"
    }
  ],
  "id": "lb42orDhySAZmLWtj6b6",
  "refId": "23a9da9e0df1184a7a6a1fc2c60b8023aa9a32a1",
  "post": "The best TikTok video ever #bestvideo"
}
  • TikTok does not currently support line breaks in the post text. Included line breaks will be ignored.

  • Either one video or up to 35 images may be published. TikTok does not support a combination of video and images. Please see below for more details.

  • If the video does not end in a known extension, use isVideo.

TikTok Image Post

JSON for a basic TikTok image (photo) post that is directly published:

TikTok Image Post
{
  "post": "The best TikTok \n video ever #bestvideo", // Max 2,200 characters with a line break
  "mediaUrls": [
    "https://img.ayrshare.com/012/gb.jpg",
    "https://img.ayrshare.com/random/photo-1.jpg"
  ], // Up to 35 images
  "platforms": ["tiktok"]
}

Example JSON response:

TikTok Image Post Response
{
  "status": "success",
  "errors": [],
  "postIds": [
    {
      "status": "success",
      "idShare": "p_pub_url~v2.7408974036430047275",
      "id": "pending",
      "isVideo": false,
      "platform": "tiktok"
    }
  ],
  "id": "8815mJ5bWApEebWjE233",
  "tikTokId": "p_pub_url~v2.7408974036430047333",
  "refId": "9abf1426d6ce9122ef11c72bd62e59807c5cc333",
  "post": "Opportunity is missed by most people because it is dressed in overalls and looks like work - Thomas Edison"
}
  • TikTok does not currently support line breaks in the post text. Included line breaks will be ignored.

  • Either one video or up to 35 images may be published.
  • TikTok does not support a combination of video and images. Please see below for more details.

  • The images must be of type JPG, JPEG, or WEBP. TikTok does not accept PNG media files.
  • You may also select one of the image as the cover photo with the imageCoverIndex. By default, the first image is used. Please see below for details.

TikTok Processing

TikTok does asynchronous processing of videos and images, so the response will have the id field set to "pending". After TikTok completes their processing, usually within 1 - 2 minutes, the id field will be updated with the TikTok video id and a postUrl will be added.

  • You can retrieve the final status of the TikTok post using webhooks or the /history endpoint and usually takes up to 1-2 minutes to be available.

  • When the user publishes the video in the TikTok mobile app, a “scheduled” webhook will be sent with the subAction: "tikTokPublished".

  • If an error occurs, such as TikTok was unable to process the video or Ayrshare internal tests failed, the id field will be set to “failed” and the errors field will contain the error details.

  • The idShare is used for internal referencing the pending video.

TikTok Video Requirements

TikTok limits the API video publishing to 2 videos per minute with an upper limit of 20 videos per day.

TikTok Image Requirements

  • Please see TikTok Image Requirements.
  • Up to 35 images may be included in a post, at 20 MB per image.
  • The images must be of type JPG, JPEG, or WEBP. TikTok does not accept PNG media files.
  • TikTok’s post text character limit is 2,200.

TikTok limits the API video publishing to 6 photos per minute with an upper limit of 15 photos per day.

Additional TikTok Options

When publishing a TikTok video or images additional options are available.

Video Publishing Example:

TikTok Video Publishing
{
  "tikTokOptions": {
    "disableComments": true, // Default false. Disable comments on the published video.
    "disableDuet": true, // Default false. Disable duets on the published video.
    "disableStitch": true // Default false. Disable stitches on the published video.
  }
}

Image Publishing Example:

TikTok Image Publishing
{
  "tikTokOptions": {
    "imageCoverIndex": 1, // Use the second image in the mediaUrls.
    "title": "Amazing images"
  }
}

Available TikTok Options

autoAddMusic
boolean
default: false

Whether to automatically add recommended music to the post. If you set this field to true, you can change the music later in the TikTok app.

Media type: image

disableComments
boolean
default: false

Whether to disable comments on the published post.

Media type: video, image

disableDuet
boolean
default: false

Disable duets on the published video.

Media type: video

disableStitch
boolean
default: false

Disable stitch on the published video.

Media type: video

isAIGenerated
boolean
default: false

Whether to enable the AI-generated content toggle for the video post.

If you enable the toggle, your video will be labeled as “Creator labeled as AI-generated” once posted and can’t be changed. The “Creator labeled as AI-generated” label indicates that the content was completely AI-generated or significantly edited with AI.

Turning on the AI-generated content setting won’t affect the distribution of your video as long as it doesn’t violate TikTok’s Community Guidelines.

Media type: video

isBrandedContent
boolean
default: false

Whether to enable the Branded Content toggle. If this field is set to true, the video will be labeled as Branded Content, indicating you are in a paid partnership with a brand. A “Paid partnership” label will be attached to the video.

Media type: video, image

isBrandOrganic
boolean
default: false

Whether to enable the Brand Organic Content toggle. If this field is set to true, the video will be labeled as Brand Organic Content, indicating you are promoting yourself or your own business. A “Promotional content” label will be attached to the video.

Media type: video, image

imageCoverIndex
number
default: 0

The index of the mediaUrls to be used as the cover for the post.

Media type: image

title
string

The title of the post.

Media type: image

thumbNailOffset
number

The frame to use for the video cover.

Please see below.

Media type: video

visibility
string
default: "public"

How the post is shared and who can see it.

Values: public, private, followers, or friends.

Please see below.

Media type: image

Visibility Options

String ValueDescription
publicVisible to all TikTok users.
privatePrivate, only visible to the account itself.
followersOnly visible to followers of the account.
friendsOnly visible to mutual followers.

Video Thumbnail

Set a thumbnail for a TikTok video by selecting an offset frame. TikTok does not support uploaded images for thumbnails.

TikTok Video Thumbnail
{
  "tikTokOptions": {
    "thumbNailOffset": 30000 // milliseconds of offset image
  }
}

The offset is the location in milliseconds of the thumbnail frame. Default value is 0, which is the first frame of the video or reel.

TikTok Mentions

Mention another TikTok handle by adding @handle in the post text. For example:

TikTok Mention
{
  "post": "Love the @ayrshare social media api"
}

Please review the important rules on mentions.

Legacy TikTok Posting

Async posting is only used by older linked account that have not relinked TikTok.

TikTok does asynchronous processing of videos. They require that after uploading the video your user open their mobile TikTok app to finalize the processing.

Please see details on the TikTok process:

Legacy TikTok Linking

Additional examples on using the TikTok API.