# TikTok (/integrations/tiktok)



{/* MANUAL-CONTENT-START:intro */}

Use [TikTok](https://www.tiktok.com/) to read the authenticated creator's profile and videos, send a video to their inbox as a draft, and track publishing status. The creator reviews and publishes drafts in TikTok; this integration does not publish them unattended. Webhooks can notify workflows about post and authorization changes.

{/* MANUAL-CONTENT-END */}

## OAuth scopes [#oauth-scopes]

Sim requests these scopes when someone connects a TikTok account. For a self-hosted deployment, register your own app with the provider using the settings below. See [Integrations and OAuth](/platform/self-hosting/integrations-oauth) for setup.

| Setting | Value |
| - | - |
| Redirect URI | `<NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/tiktok` |
| Environment variables | `TIKTOK_CLIENT_ID`, `TIKTOK_CLIENT_SECRET` |

| Scope | Description |
| - | - |
| `user.info.basic` | Read a user's profile info (open id, avatar, display name) |
| `user.info.profile` | Read a user's profile info (bio, verification status, username) |
| `user.info.stats` | Read a user's stats (follower, following, likes, and video counts) |
| `video.upload` | Share content to a creator's account as a draft for further edit and post |
| `video.list` | Read a user's public TikTok videos |

## Use the block [#usage-instructions]

Get user profile information including follower counts and video statistics. List and query videos with cover images, embed links, and metadata. Send uploaded videos to the TikTok inbox as drafts for human review and publishing, then track post status.

## Actions [#actions]

### TikTok Get User [#tiktok-get-user]

Get the authenticated TikTok user profile information including display name, avatar, bio, follower count, and video statistics.

#### Input [#input]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `fields` | string | No | Comma-separated allowlisted fields to return. open\_id and display\_name are always included. Available: open\_id, union\_id, avatar\_url, avatar\_large\_url, display\_name, bio\_description, profile\_deep\_link, is\_verified, username, follower\_count, following\_count, likes\_count, video\_count. Include avatar\_url or avatar\_large\_url to receive avatarFile. |

#### Output [#output]

| Parameter | Type | Description |
| - | - | - |
| `openId` | string | Unique TikTok user ID for this application |
| `unionId` | string | Unique TikTok user ID across all apps from the same developer |
| `displayName` | string | User display name |
| `bioDescription` | string | User bio description |
| `profileDeepLink` | string | Deep link to user TikTok profile |
| `isVerified` | boolean | Whether the account is verified |
| `username` | string | TikTok username |
| `followerCount` | number | Number of followers |
| `followingCount` | number | Number of accounts the user follows |
| `likesCount` | number | Total likes received across all videos |
| `videoCount` | number | Total number of public videos |
| `avatarFile` | file | Downloadable copy of the profile avatar image (largest available variant), stored as a workflow file so it can be chained into file-consuming blocks (e.g. attached to an email). |

### TikTok List Videos [#tiktok-list-videos]

Get a list of the authenticated user's TikTok videos with cover images, titles, and metadata. Supports pagination.

#### Input [#input-1]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `maxCount` | number | No | Maximum number of videos to return (1-20) |
| `cursor` | number | No | Cursor for pagination (from previous response) |

#### Output [#output-1]

| Parameter | Type | Description |
| - | - | - |
| `videos` | array | List of TikTok videos |
| ↳ `id` | string | Video ID |
| ↳ `title` | string | Video title |
| ↳ `coverImageUrl` | string | Signed TikTok CDN cover URL. It is public but time-limited, so consume it immediately. |
| ↳ `embedLink` | string | Embeddable video URL |
| ↳ `embedHtml` | string | HTML embed markup for the video |
| ↳ `duration` | number | Video duration in seconds |
| ↳ `createTime` | number | Unix timestamp when the video was created |
| ↳ `shareUrl` | string | Shareable video URL |
| ↳ `videoDescription` | string | Video description or caption |
| ↳ `width` | number | Video width in pixels |
| ↳ `height` | number | Video height in pixels |
| ↳ `viewCount` | number | Number of views |
| ↳ `likeCount` | number | Number of likes |
| ↳ `commentCount` | number | Number of comments |
| ↳ `shareCount` | number | Number of shares |
| `cursor` | number | Cursor for fetching the next page of results |
| `hasMore` | boolean | Whether there are more videos to fetch |

### TikTok Query Videos [#tiktok-query-videos]

Query specific TikTok videos by their IDs to get fresh metadata including cover images, embed links, and video details.

#### Input [#input-2]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `videoIds` | array | Yes | Array of video IDs to query (maximum 20) |

#### Output [#output-2]

| Parameter | Type | Description |
| - | - | - |
| `videos` | array | List of queried TikTok videos |
| ↳ `id` | string | Video ID |
| ↳ `title` | string | Video title |
| ↳ `coverImageUrl` | string | Signed TikTok CDN cover URL. It is public but time-limited, so consume it immediately. |
| ↳ `embedLink` | string | Embeddable video URL |
| ↳ `embedHtml` | string | HTML embed markup for the video |
| ↳ `duration` | number | Video duration in seconds |
| ↳ `createTime` | number | Unix timestamp when the video was created |
| ↳ `shareUrl` | string | Shareable video URL |
| ↳ `videoDescription` | string | Video description or caption |
| ↳ `width` | number | Video width in pixels |
| ↳ `height` | number | Video height in pixels |
| ↳ `viewCount` | number | Number of views |
| ↳ `likeCount` | number | Number of likes |
| ↳ `commentCount` | number | Number of comments |
| ↳ `shareCount` | number | Number of shares |

### TikTok Upload Video Draft [#tiktok-upload-video-draft]

Send an uploaded video to the authenticated user's TikTok inbox for manual editing and posting. The user must open TikTok and tap the inbox notification to complete the post. Rate limit: 6 requests per minute per user.

#### Input [#input-3]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `file` | file | Yes | Video file to upload from the workflow. Maximum size: 250 MB. |

#### Output [#output-3]

| Parameter | Type | Description |
| - | - | - |
| `publishId` | string | Unique identifier for tracking the draft status. Use this with the Get Post Status tool to check when the user has completed posting from their inbox. |

### TikTok Get Post Status [#tiktok-get-post-status]

Check the status of a video draft upload. Use the publishId returned from Upload Video Draft to track progress.

#### Input [#input-4]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `publishId` | string | Yes | The publish ID returned from a post/upload tool. |

#### Output [#output-4]

| Parameter | Type | Description |
| - | - | - |
| `status` | string | Current status of the post. Values: PROCESSING\_UPLOAD/PROCESSING\_DOWNLOAD (TikTok is processing the media), SEND\_TO\_USER\_INBOX (draft delivered, awaiting user action), PUBLISH\_COMPLETE (successfully posted), FAILED (check failReason). |
| `failReason` | string | Reason for failure if status is FAILED. Null otherwise. |
| `publiclyAvailablePostId` | array | Array of public post IDs (as strings) once the content is published and publicly viewable. Can be used to construct the TikTok post URL. |
| `uploadedBytes` | number | Number of bytes uploaded to TikTok for FILE\_UPLOAD posts |
| `downloadedBytes` | number | Number of bytes TikTok reports as downloaded |

## Triggers [#triggers]

A trigger starts a workflow when a supported event occurs in this service.

### TikTok Authorization Removed [#tiktok-authorization-removed]

Trigger when a user deauthorizes your TikTok app

#### Configuration [#configuration]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-5]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `reason` | number | Revocation reason (0 unknown, 1 user disconnect, 2 account deleted, 3 age change, 4 banned, 5 developer revoke) |

***

### TikTok Post Inbox Delivered [#tiktok-post-inbox-delivered]

Trigger when a draft notification is delivered to the creator inbox

#### Configuration [#configuration-1]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-6]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `publishId` | string | Content Posting API publish\_id |
| `publishType` | string | Publish type (e.g. DIRECT\_POST, INBOX\_SHARE) |

***

### TikTok Post No Longer Public [#tiktok-post-no-longer-public]

Trigger when a post is no longer publicly viewable on TikTok

#### Configuration [#configuration-2]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-7]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `publishId` | string | Content Posting API publish\_id |
| `publishType` | string | Publish type (e.g. DIRECT\_POST, INBOX\_SHARE) |
| `postId` | string | TikTok post\_id when the post is publicly available |

***

### TikTok Post Publicly Available [#tiktok-post-publicly-available]

Trigger when a published post becomes publicly viewable on TikTok

#### Configuration [#configuration-3]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-8]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `publishId` | string | Content Posting API publish\_id |
| `publishType` | string | Publish type (e.g. DIRECT\_POST, INBOX\_SHARE) |
| `postId` | string | TikTok post\_id when the post is publicly available |

***

### TikTok Post Publish Complete [#tiktok-post-publish-complete]

Trigger when a TikTok Content Posting publish completes

#### Configuration [#configuration-4]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-9]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `publishId` | string | Content Posting API publish\_id |
| `publishType` | string | Publish type (e.g. DIRECT\_POST, INBOX\_SHARE) |

***

### TikTok Post Publish Failed [#tiktok-post-publish-failed]

Trigger when a TikTok Content Posting publish fails

#### Configuration [#configuration-5]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `triggerCredentials` | string | Yes | TikTok Account |

#### Output [#output-10]

| Parameter | Type | Description |
| - | - | - |
| `event` | string | TikTok webhook event name |
| `createTime` | number | UTC epoch seconds when the event occurred |
| `userOpenId` | string | TikTok user open\_id for the connected account |
| `clientKey` | string | TikTok app client\_key that received the event |
| `publishId` | string | Content Posting API publish\_id |
| `publishType` | string | Publish type (e.g. DIRECT\_POST, INBOX\_SHARE) |
| `failReason` | string | Failure reason enum from TikTok when publishing fails |
